diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index d4a042048c..7f19a93804 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -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 diff --git a/vscode-powershell.build.ps1 b/vscode-powershell.build.ps1 index 8c9131f071..1e170a3a1f 100644 --- a/vscode-powershell.build.ps1 +++ b/vscode-powershell.build.ps1 @@ -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, @@ -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