Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Apress
committed
Oct 18, 2016
0 parents
commit 14f872a
Showing
2,086 changed files
with
3,391,294 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
1,592 changes: 1,592 additions & 0 deletions
1,592
chapter4/lib/AutoMapper.3.2.1/lib/MonoAndroid/AutoMapper.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
1,592 changes: 1,592 additions & 0 deletions
1,592
chapter4/lib/AutoMapper.3.2.1/lib/MonoTouch/AutoMapper.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
1,592 changes: 1,592 additions & 0 deletions
1,592
chapter4/lib/AutoMapper.3.2.1/lib/net40/AutoMapper.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+147 KB
...AutoMapper.3.2.1/lib/portable-windows8+net40+wp8+sl5+MonoAndroid+MonoTouch/AutoMapper.dll
Binary file not shown.
1,592 changes: 1,592 additions & 0 deletions
1,592
...AutoMapper.3.2.1/lib/portable-windows8+net40+wp8+sl5+MonoAndroid+MonoTouch/AutoMapper.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+147 KB
...pper.3.2.1/lib/portable-windows8+net40+wp8+wpa81+sl5+MonoAndroid+MonoTouch/AutoMapper.dll
Binary file not shown.
1,592 changes: 1,592 additions & 0 deletions
1,592
...pper.3.2.1/lib/portable-windows8+net40+wp8+wpa81+sl5+MonoAndroid+MonoTouch/AutoMapper.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
1,592 changes: 1,592 additions & 0 deletions
1,592
chapter4/lib/AutoMapper.3.2.1/lib/sl5/AutoMapper.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
1,592 changes: 1,592 additions & 0 deletions
1,592
chapter4/lib/AutoMapper.3.2.1/lib/windows8/AutoMapper.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
1,592 changes: 1,592 additions & 0 deletions
1,592
chapter4/lib/AutoMapper.3.2.1/lib/wp8/AutoMapper.xml
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
1,592 changes: 1,592 additions & 0 deletions
1,592
chapter4/lib/AutoMapper.3.2.1/lib/wpa81/AutoMapper.xml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<!-- Build sequence modification --> | ||
<Target Name="CopyAutoMapperAssembly" | ||
AfterTargets="ResolveAssemblyReferences"> | ||
<CreateItem Include="%(ReferencePath.FullPath)" | ||
Condition="$([System.String]::new('%(ReferencePath.Filename)').StartsWith('AutoMapper.'))"> | ||
<Output TaskParameter="Include" | ||
ItemName="_AutoMapperReference"/> | ||
</CreateItem> | ||
|
||
<Message Importance="low" Text="AutoMapper Platform Extension Assembly: %(_AutoMapperReference.FullPath)"/> | ||
|
||
<ItemGroup> | ||
<Content Include="$([MSBuild]::MakeRelative($(MSBuildProjectDirectory), %(_AutoMapperReference.FullPath)))" Condition="'%(_AutoMapperReference.FullPath)' != ''"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
20 changes: 20 additions & 0 deletions
20
chapter4/lib/AutoMapper.3.2.1/tools/MonoAndroid/Install.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
# This is the MSBuild targets file to add | ||
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Make the path to the targets file relative. | ||
$projectUri = new-object Uri($project.FullName, [System.UriKind]::Absolute) | ||
$targetUri = new-object Uri($targetsFile, [System.UriKind]::Absolute) | ||
$relativePath = [System.Uri]::UnescapeDataString($projectUri.MakeRelativeUri($targetUri).ToString()).Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar) | ||
|
||
# Add the import with a condition, to allow the project to load without the targets present. | ||
$import = $msbuild.Xml.AddImport($relativePath) | ||
$import.Condition = "Exists('$relativePath')" | ||
|
||
$project.Save() |
24 changes: 24 additions & 0 deletions
24
chapter4/lib/AutoMapper.3.2.1/tools/MonoAndroid/uninstall.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Find all the imports and targets added by this package. | ||
$itemsToRemove = @() | ||
|
||
# Allow many in case a past package was incorrectly uninstalled | ||
$itemsToRemove += $msbuild.Xml.Imports | Where-Object { $_.Project.EndsWith($package.Id + '.targets') } | ||
|
||
# Remove the elements and save the project | ||
if ($itemsToRemove -and $itemsToRemove.length) | ||
{ | ||
foreach ($itemToRemove in $itemsToRemove) | ||
{ | ||
$msbuild.Xml.RemoveChild($itemToRemove) | out-null | ||
} | ||
|
||
$project.Save() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
# This is the MSBuild targets file to add | ||
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Make the path to the targets file relative. | ||
$projectUri = new-object Uri($project.FullName, [System.UriKind]::Absolute) | ||
$targetUri = new-object Uri($targetsFile, [System.UriKind]::Absolute) | ||
$relativePath = [System.Uri]::UnescapeDataString($projectUri.MakeRelativeUri($targetUri).ToString()).Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar) | ||
|
||
# Add the import with a condition, to allow the project to load without the targets present. | ||
$import = $msbuild.Xml.AddImport($relativePath) | ||
$import.Condition = "Exists('$relativePath')" | ||
|
||
$project.Save() |
24 changes: 24 additions & 0 deletions
24
chapter4/lib/AutoMapper.3.2.1/tools/MonoTouch/uninstall.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Find all the imports and targets added by this package. | ||
$itemsToRemove = @() | ||
|
||
# Allow many in case a past package was incorrectly uninstalled | ||
$itemsToRemove += $msbuild.Xml.Imports | Where-Object { $_.Project.EndsWith($package.Id + '.targets') } | ||
|
||
# Remove the elements and save the project | ||
if ($itemsToRemove -and $itemsToRemove.length) | ||
{ | ||
foreach ($itemToRemove in $itemsToRemove) | ||
{ | ||
$msbuild.Xml.RemoveChild($itemToRemove) | out-null | ||
} | ||
|
||
$project.Save() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
# This is the MSBuild targets file to add | ||
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Make the path to the targets file relative. | ||
$projectUri = new-object Uri($project.FullName, [System.UriKind]::Absolute) | ||
$targetUri = new-object Uri($targetsFile, [System.UriKind]::Absolute) | ||
$relativePath = [System.Uri]::UnescapeDataString($projectUri.MakeRelativeUri($targetUri).ToString()).Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar) | ||
|
||
# Add the import with a condition, to allow the project to load without the targets present. | ||
$import = $msbuild.Xml.AddImport($relativePath) | ||
$import.Condition = "Exists('$relativePath')" | ||
|
||
$project.Save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Find all the imports and targets added by this package. | ||
$itemsToRemove = @() | ||
|
||
# Allow many in case a past package was incorrectly uninstalled | ||
$itemsToRemove += $msbuild.Xml.Imports | Where-Object { $_.Project.EndsWith($package.Id + '.targets') } | ||
|
||
# Remove the elements and save the project | ||
if ($itemsToRemove -and $itemsToRemove.length) | ||
{ | ||
foreach ($itemToRemove in $itemsToRemove) | ||
{ | ||
$msbuild.Xml.RemoveChild($itemToRemove) | out-null | ||
} | ||
|
||
$project.Save() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
# This is the MSBuild targets file to add | ||
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Make the path to the targets file relative. | ||
$projectUri = new-object Uri($project.FullName, [System.UriKind]::Absolute) | ||
$targetUri = new-object Uri($targetsFile, [System.UriKind]::Absolute) | ||
$relativePath = [System.Uri]::UnescapeDataString($projectUri.MakeRelativeUri($targetUri).ToString()).Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar) | ||
|
||
# Add the import with a condition, to allow the project to load without the targets present. | ||
$import = $msbuild.Xml.AddImport($relativePath) | ||
$import.Condition = "Exists('$relativePath')" | ||
|
||
$project.Save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Find all the imports and targets added by this package. | ||
$itemsToRemove = @() | ||
|
||
# Allow many in case a past package was incorrectly uninstalled | ||
$itemsToRemove += $msbuild.Xml.Imports | Where-Object { $_.Project.EndsWith($package.Id + '.targets') } | ||
|
||
# Remove the elements and save the project | ||
if ($itemsToRemove -and $itemsToRemove.length) | ||
{ | ||
foreach ($itemToRemove in $itemsToRemove) | ||
{ | ||
$msbuild.Xml.RemoveChild($itemToRemove) | out-null | ||
} | ||
|
||
$project.Save() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
# This is the MSBuild targets file to add | ||
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Make the path to the targets file relative. | ||
$projectUri = new-object Uri($project.FullName, [System.UriKind]::Absolute) | ||
$targetUri = new-object Uri($targetsFile, [System.UriKind]::Absolute) | ||
$relativePath = [System.Uri]::UnescapeDataString($projectUri.MakeRelativeUri($targetUri).ToString()).Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar) | ||
|
||
# Add the import with a condition, to allow the project to load without the targets present. | ||
$import = $msbuild.Xml.AddImport($relativePath) | ||
$import.Condition = "Exists('$relativePath')" | ||
|
||
$project.Save() |
24 changes: 24 additions & 0 deletions
24
chapter4/lib/AutoMapper.3.2.1/tools/windows8/uninstall.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Find all the imports and targets added by this package. | ||
$itemsToRemove = @() | ||
|
||
# Allow many in case a past package was incorrectly uninstalled | ||
$itemsToRemove += $msbuild.Xml.Imports | Where-Object { $_.Project.EndsWith($package.Id + '.targets') } | ||
|
||
# Remove the elements and save the project | ||
if ($itemsToRemove -and $itemsToRemove.length) | ||
{ | ||
foreach ($itemToRemove in $itemsToRemove) | ||
{ | ||
$msbuild.Xml.RemoveChild($itemToRemove) | out-null | ||
} | ||
|
||
$project.Save() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
# This is the MSBuild targets file to add | ||
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Make the path to the targets file relative. | ||
$projectUri = new-object Uri($project.FullName, [System.UriKind]::Absolute) | ||
$targetUri = new-object Uri($targetsFile, [System.UriKind]::Absolute) | ||
$relativePath = [System.Uri]::UnescapeDataString($projectUri.MakeRelativeUri($targetUri).ToString()).Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar) | ||
|
||
# Add the import with a condition, to allow the project to load without the targets present. | ||
$import = $msbuild.Xml.AddImport($relativePath) | ||
$import.Condition = "Exists('$relativePath')" | ||
|
||
$project.Save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Find all the imports and targets added by this package. | ||
$itemsToRemove = @() | ||
|
||
# Allow many in case a past package was incorrectly uninstalled | ||
$itemsToRemove += $msbuild.Xml.Imports | Where-Object { $_.Project.EndsWith($package.Id + '.targets') } | ||
|
||
# Remove the elements and save the project | ||
if ($itemsToRemove -and $itemsToRemove.length) | ||
{ | ||
foreach ($itemToRemove in $itemsToRemove) | ||
{ | ||
$msbuild.Xml.RemoveChild($itemToRemove) | out-null | ||
} | ||
|
||
$project.Save() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
# This is the MSBuild targets file to add | ||
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets') | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Make the path to the targets file relative. | ||
$projectUri = new-object Uri($project.FullName, [System.UriKind]::Absolute) | ||
$targetUri = new-object Uri($targetsFile, [System.UriKind]::Absolute) | ||
$relativePath = [System.Uri]::UnescapeDataString($projectUri.MakeRelativeUri($targetUri).ToString()).Replace([System.IO.Path]::AltDirectorySeparatorChar, [System.IO.Path]::DirectorySeparatorChar) | ||
|
||
# Add the import with a condition, to allow the project to load without the targets present. | ||
$import = $msbuild.Xml.AddImport($relativePath) | ||
$import.Condition = "Exists('$relativePath')" | ||
|
||
$project.Save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
param($installPath, $toolsPath, $package, $project) | ||
|
||
# Need to load MSBuild assembly if it's not loaded yet. | ||
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | ||
|
||
# Grab the loaded MSBuild project for the project | ||
$msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 | ||
|
||
# Find all the imports and targets added by this package. | ||
$itemsToRemove = @() | ||
|
||
# Allow many in case a past package was incorrectly uninstalled | ||
$itemsToRemove += $msbuild.Xml.Imports | Where-Object { $_.Project.EndsWith($package.Id + '.targets') } | ||
|
||
# Remove the elements and save the project | ||
if ($itemsToRemove -and $itemsToRemove.length) | ||
{ | ||
foreach ($itemToRemove in $itemsToRemove) | ||
{ | ||
$msbuild.Xml.RemoveChild($itemToRemove) | out-null | ||
} | ||
|
||
$project.Save() | ||
} |
Binary file not shown.
Oops, something went wrong.