From 7bf34dbb1c6fb47b76d0245bb3bb28439ed51756 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Sat, 26 Oct 2019 13:58:58 +0100 Subject: [PATCH] Fix configuration for PS v5 and v6 builds to be Debug/Release as it used to be to allow for actual debug builds --- build.psm1 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build.psm1 b/build.psm1 index 0b0d2517c..7abedef28 100644 --- a/build.psm1 +++ b/build.psm1 @@ -239,7 +239,10 @@ function Start-ScriptAnalyzerBuild } } - $config = "PSV${PSVersion}${Configuration}" + $buildConfiguration = $Configuration + if ((3, 4) -contains $PSVersion) { + $buildConfiguration = "PSV${PSVersion}${Configuration}" + } # Build ScriptAnalyzer # The Rules project has a dependency on the Engine therefore just building the Rules project is enough @@ -249,7 +252,7 @@ function Start-ScriptAnalyzerBuild if ( -not $script:DotnetExe ) { $script:DotnetExe = Get-DotnetExe } - $buildOutput = & $script:DotnetExe build --framework $framework --configuration "$config" 2>&1 + $buildOutput = & $script:DotnetExe build --framework $framework --configuration "$buildConfiguration" 2>&1 if ( $LASTEXITCODE -ne 0 ) { throw "$buildOutput" } } catch { @@ -264,9 +267,9 @@ function Start-ScriptAnalyzerBuild Publish-File $itemsToCopyCommon $script:destinationDir $itemsToCopyBinaries = @( - "$projectRoot\Engine\bin\${config}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll", - "$projectRoot\Rules\bin\${config}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll" - "$projectRoot\Rules\bin\${config}\${framework}\Microsoft.PowerShell.CrossCompatibility.dll" + "$projectRoot\Engine\bin\${buildConfiguration}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll", + "$projectRoot\Rules\bin\${buildConfiguration}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll" + "$projectRoot\Rules\bin\${buildConfiguration}\${framework}\Microsoft.PowerShell.CrossCompatibility.dll" ) Publish-File $itemsToCopyBinaries $destinationDirBinaries @@ -274,7 +277,7 @@ function Start-ScriptAnalyzerBuild Publish-File $settingsFiles (Join-Path -Path $script:destinationDir -ChildPath Settings) if ($framework -eq 'net452') { - Copy-Item -path "$projectRoot\Rules\bin\${config}\${framework}\Newtonsoft.Json.dll" -Destination $destinationDirBinaries + Copy-Item -path "$projectRoot\Rules\bin\${buildConfiguration}\${framework}\Newtonsoft.Json.dll" -Destination $destinationDirBinaries } Pop-Location