Skip to content

Commit 468212a

Browse files
authored
Fix configuration for PS v5 and v6 builds to be Debug/Release as it used to be to allow for actual debug builds (#1356)
1 parent e0507b9 commit 468212a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

build.psm1

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,10 @@ function Start-ScriptAnalyzerBuild
239239
}
240240
}
241241

242-
$config = "PSV${PSVersion}${Configuration}"
242+
$buildConfiguration = $Configuration
243+
if ((3, 4) -contains $PSVersion) {
244+
$buildConfiguration = "PSV${PSVersion}${Configuration}"
245+
}
243246

244247
# Build ScriptAnalyzer
245248
# The Rules project has a dependency on the Engine therefore just building the Rules project is enough
@@ -249,7 +252,7 @@ function Start-ScriptAnalyzerBuild
249252
if ( -not $script:DotnetExe ) {
250253
$script:DotnetExe = Get-DotnetExe
251254
}
252-
$buildOutput = & $script:DotnetExe build --framework $framework --configuration "$config" 2>&1
255+
$buildOutput = & $script:DotnetExe build --framework $framework --configuration "$buildConfiguration" 2>&1
253256
if ( $LASTEXITCODE -ne 0 ) { throw "$buildOutput" }
254257
}
255258
catch {
@@ -264,17 +267,17 @@ function Start-ScriptAnalyzerBuild
264267
Publish-File $itemsToCopyCommon $script:destinationDir
265268

266269
$itemsToCopyBinaries = @(
267-
"$projectRoot\Engine\bin\${config}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll",
268-
"$projectRoot\Rules\bin\${config}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll"
269-
"$projectRoot\Rules\bin\${config}\${framework}\Microsoft.PowerShell.CrossCompatibility.dll"
270+
"$projectRoot\Engine\bin\${buildConfiguration}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll",
271+
"$projectRoot\Rules\bin\${buildConfiguration}\${Framework}\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll"
272+
"$projectRoot\Rules\bin\${buildConfiguration}\${framework}\Microsoft.PowerShell.CrossCompatibility.dll"
270273
)
271274
Publish-File $itemsToCopyBinaries $destinationDirBinaries
272275

273276
$settingsFiles = Get-Childitem "$projectRoot\Engine\Settings" | ForEach-Object -MemberName FullName
274277
Publish-File $settingsFiles (Join-Path -Path $script:destinationDir -ChildPath Settings)
275278

276279
if ($framework -eq 'net452') {
277-
Copy-Item -path "$projectRoot\Rules\bin\${config}\${framework}\Newtonsoft.Json.dll" -Destination $destinationDirBinaries
280+
Copy-Item -path "$projectRoot\Rules\bin\${buildConfiguration}\${framework}\Newtonsoft.Json.dll" -Destination $destinationDirBinaries
278281
}
279282

280283
Pop-Location

0 commit comments

Comments
 (0)