Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix configuration for PS v5 and v6 builds to be Debug/Release and not PSV6Debug, etc. as it used to be able to produce actual debug builds #1356

Merged
merged 2 commits into from
Nov 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -264,17 +267,17 @@ 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

$settingsFiles = Get-Childitem "$projectRoot\Engine\Settings" | ForEach-Object -MemberName FullName
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
Expand Down