Skip to content

Commit

Permalink
Merge pull request #4220 from PowerShell/andschwa/fix-release-build
Browse files Browse the repository at this point in the history
Add assertion to build that PSES bits are built in release configuration, because it's way too easy to break that! We were building in release configuration, then running the tests...and the tests were then building (and overwriting the bits) in debug configuration.
  • Loading branch information
andyleejordan committed Oct 21, 2022
2 parents 1829acb + 4c4a112 commit 5d0cb89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .vsts-ci/templates/ci-general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ steps:
workingDirectory: $(Build.SourcesDirectory)/vscode-powershell
pwsh: ${{ parameters.pwsh }}

- task: PowerShell@2
displayName: Assert PowerShellEditorServices release configuration
inputs:
targetType: inline
script: |
$assembly = [Reflection.Assembly]::LoadFile("$(Build.SourcesDirectory)/vscode-powershell/modules/PowerShellEditorServices.VSCode/bin/Microsoft.PowerShell.EditorServices.VSCode.dll")
if ($assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $true).IsJITOptimizerDisabled) {
Write-Host "##vso[task.LogIssue type=error;] PowerShell Editor Services bits were not built in release configuration!"
exit 1
}
pwsh: ${{ parameters.pwsh }}

- publish: $(vsixPath)
artifact: vscode-powershell-vsix-$(System.JobId)
displayName: Publish extension artifact
Expand Down
4 changes: 2 additions & 2 deletions vscode-powershell.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ task RestoreEditorServices -If (Get-EditorServicesPath) {
}

Write-Host "`n### Building PSES`n" -ForegroundColor Green
Invoke-Build Build (Get-EditorServicesPath)
Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration
}
"Release" {
# When releasing, we ensure the bits are not symlinked but copied,
Expand All @@ -64,7 +64,7 @@ task RestoreEditorServices -If (Get-EditorServicesPath) {
# We only build if it hasn't been built at all.
if (!(Test-Path "$(Split-Path (Get-EditorServicesPath))/module/PowerShellEditorServices/bin")) {
Write-Host "`n### Building PSES`n" -ForegroundColor Green
Invoke-Build Build (Get-EditorServicesPath)
Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration
}

Write-Host "`n### Copying PSES`n" -ForegroundColor Green
Expand Down

0 comments on commit 5d0cb89

Please sign in to comment.