Skip to content

Add assertion to build that PSES bits are built in release configuration #4220

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

Merged
merged 2 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
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
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