From 58d0d8dee68dc89ae00e2f17fd144b102459e0a8 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Sun, 11 Dec 2016 22:33:10 -0800 Subject: [PATCH] Update powershell scripts as well --- src/Setup/PowerShell/install.ps1 | 17 +++++++++++++---- src/Setup/PowerShell/uninstall.ps1 | 15 ++++++++++++--- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/Setup/PowerShell/install.ps1 b/src/Setup/PowerShell/install.ps1 index 8178834faf7..9e3fbbf48f5 100644 --- a/src/Setup/PowerShell/install.ps1 +++ b/src/Setup/PowerShell/install.ps1 @@ -1,13 +1,22 @@ param($installPath, $toolsPath, $package, $project) -$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers" ) * -Resolve +if($project.Object.SupportsPackageDependencyResolution) +{ + if($project.Object.SupportsPackageDependencyResolution()) + { + # Do not install analyzers via install.ps1, instead let the project system handle it. + return + } +} + +$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers") * -Resolve foreach($analyzersPath in $analyzersPaths) { - # Install the language agnostic analyzers. if (Test-Path $analyzersPath) { - foreach ($analyzerFilePath in Get-ChildItem $analyzersPath -Filter *.dll) + # Install the language agnostic analyzers. + foreach ($analyzerFilePath in Get-ChildItem -Path "$analyzersPath\*.dll" -Exclude *.resources.dll) { if($project.Object.AnalyzerReferences) { @@ -38,7 +47,7 @@ foreach($analyzersPath in $analyzersPaths) $languageAnalyzersPath = join-path $analyzersPath $languageFolder if (Test-Path $languageAnalyzersPath) { - foreach ($analyzerFilePath in Get-ChildItem $languageAnalyzersPath -Filter *.dll) + foreach ($analyzerFilePath in Get-ChildItem -Path "$languageAnalyzersPath\*.dll" -Exclude *.resources.dll) { if($project.Object.AnalyzerReferences) { diff --git a/src/Setup/PowerShell/uninstall.ps1 b/src/Setup/PowerShell/uninstall.ps1 index 9130bcb5080..7d9c8cc1dc5 100644 --- a/src/Setup/PowerShell/uninstall.ps1 +++ b/src/Setup/PowerShell/uninstall.ps1 @@ -1,13 +1,22 @@ param($installPath, $toolsPath, $package, $project) -$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers" ) * -Resolve +if($project.Object.SupportsPackageDependencyResolution) +{ + if($project.Object.SupportsPackageDependencyResolution()) + { + # Do not uninstall analyzers via uninstall.ps1, instead let the project system handle it. + return + } +} + +$analyzersPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers") * -Resolve foreach($analyzersPath in $analyzersPaths) { # Uninstall the language agnostic analyzers. if (Test-Path $analyzersPath) { - foreach ($analyzerFilePath in Get-ChildItem $analyzersPath -Filter *.dll) + foreach ($analyzerFilePath in Get-ChildItem -Path "$analyzersPath\*.dll" -Exclude *.resources.dll) { if($project.Object.AnalyzerReferences) { @@ -38,7 +47,7 @@ foreach($analyzersPath in $analyzersPaths) $languageAnalyzersPath = join-path $analyzersPath $languageFolder if (Test-Path $languageAnalyzersPath) { - foreach ($analyzerFilePath in Get-ChildItem $languageAnalyzersPath -Filter *.dll) + foreach ($analyzerFilePath in Get-ChildItem -Path "$languageAnalyzersPath\*.dll" -Exclude *.resources.dll) { if($project.Object.AnalyzerReferences) { -- GitLab