diff --git a/build/manifest.ps1 b/build/manifest.ps1 index 9b2e3bb1a6..a554791a8f 100644 --- a/build/manifest.ps1 +++ b/build/manifest.ps1 @@ -1,48 +1,65 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. -#!/usr/bin/env pwsh -#Requires -PSEdition Core +<# + .SYNOPSIS + Provides the list of artifacts (Packages and Assemblies) generated by this repository. + + .PARAMETER OutputFormat + Specifies if the output of this script should be a hashtable with the artifacts + as strings with the absolute path (AbsolutePath) or FileInfo structures. +#> +param( + [ValidateSet('FileInfo', 'AbsolutePath')] + [string] $OutputFormat = 'FileInfo' +); + +& "$PSScriptRoot\set-env.ps1" -& "$PSScriptRoot/set-env.ps1" if ($Env:ENABLE_VSIX -ne "false") { # The language server is only built if either the VS2019 or VS Code extension # is enabled. $VsixAssemblies = @( - "./src/QsCompiler/LanguageServer/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/Microsoft.Quantum.QsCompilationManager.dll", - "./src/QsCompiler/LanguageServer/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/Microsoft.Quantum.QsCore.dll", - "./src/QsCompiler/LanguageServer/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/Microsoft.Quantum.QsDataStructures.dll", - "./src/QsCompiler/LanguageServer/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/Microsoft.Quantum.QsLanguageServer.dll", - "./src/QsCompiler/LanguageServer/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/Microsoft.Quantum.QsSyntaxProcessor.dll", - "./src/QsCompiler/LanguageServer/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/Microsoft.Quantum.QsTextProcessor.dll", - "./src/QsCompiler/LanguageServer/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/Microsoft.Quantum.QsTransformations.dll" - ); - - # The VS2019 extension itself is only built if msbuild is present. - if (Get-Command msbuild -ErrorAction SilentlyContinue) { - $VsixAssemblies += @( - "./src/VisualStudioExtension/QsharpVSIX/bin/$Env:BUILD_CONFIGURATION/Microsoft.Quantum.VisualStudio.Extension.dll" - ); - } -} else { - $VsixAssemblies = @(); + ".\src\QsCompiler\LanguageServer\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.QsLanguageServer.dll", + ".\src\VisualStudioExtension\QsharpVSIX\bin\$Env:BUILD_CONFIGURATION\Microsoft.Quantum.VisualStudio.Extension.dll" + ); } +else { + $VsixAssemblies = @(); +} - -@{ +$artifacts = @{ Packages = @( "Microsoft.Quantum.Compiler", - "Microsoft.Quantum.Compiler.CommandLine", + "Microsoft.Quantum.DocumentationGenerator" "Microsoft.Quantum.ProjectTemplates", "Microsoft.Quantum.Sdk", - "Microsoft.Quantum.DocumentationGenerator" - ); + "qsc" + ) | ForEach-Object { Join-Path $Env:NUGET_OUTDIR "$_.$Env:NUGET_VERSION.nupkg" }; + Assemblies = $VsixAssemblies + @( - "./src/Documentation/DocumentationGenerator/bin/$Env:BUILD_CONFIGURATION/netstandard2.1/Microsoft.Quantum.DocumentationGenerator.dll", - "./src/QsCompiler/CommandLineTool/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/Microsoft.Quantum.QsCompiler.dll", - "./src/QsCompiler/CommandLineTool/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/Microsoft.Quantum.QsDocumentationParser.dll", - "./src/QsCompiler/CommandLineTool/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/qsc.dll", - "./src/QuantumSdk/Tools/BuildConfiguration/bin/$Env:BUILD_CONFIGURATION/netcoreapp3.1/publish/Microsoft.Quantum.Sdk.BuildConfiguration.dll" - ) | ForEach-Object { Get-Item (Join-Path $PSScriptRoot ".." $_) }; -} | Write-Output; + ".\src\Documentation\DocumentationGenerator\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.DocumentationGenerator.dll", + + ".\src\QsCompiler\Compiler\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsCompilationManager.dll", + ".\src\QsCompiler\Compiler\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsCompiler.dll", + ".\src\QsCompiler\Compiler\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsCore.dll", + ".\src\QsCompiler\Compiler\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsDataStructures.dll", + ".\src\QsCompiler\Compiler\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsDocumentationParser.dll", + ".\src\QsCompiler\Compiler\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsOptimizations.dll", + ".\src\QsCompiler\Compiler\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsSyntaxProcessor.dll", + ".\src\QsCompiler\Compiler\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsTextProcessor.dll", + ".\src\QsCompiler\Compiler\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsTransformations.dll" + + ".\src\QsCompiler\CommandLineTool\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qsc.dll", + + ".\src\QuantumSdk\Tools\BuildConfiguration\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.BuildConfiguration.dll" + ) | ForEach-Object { Join-Path $PSScriptRoot (Join-Path ".." $_) }; +} + +if ($OutputFormat -eq 'FileInfo') { + $artifacts.Packages = $artifacts.Packages | ForEach-Object { Get-Item $_ }; + $artifacts.Assemblies = $artifacts.Assemblies | ForEach-Object { Get-Item $_ }; +} + +$artifacts | Write-Output; diff --git a/build/pack.ps1 b/build/pack.ps1 index ff1cee4c6a..52ba41364a 100644 --- a/build/pack.ps1 +++ b/build/pack.ps1 @@ -264,9 +264,6 @@ if ("$Env:DOCS_OUTDIR".Trim() -ne "") { Pop-Location } -Write-Host "##[info]Verifying manifest..." -& (Join-Path $PSScriptRoot "manifest.ps1") - if (-not $all_ok) { throw "Packing failed. Check the logs." exit 1 diff --git a/build/steps.yml b/build/steps.yml index 0623033f7f..323b096c22 100644 --- a/build/steps.yml +++ b/build/steps.yml @@ -17,7 +17,6 @@ steps: workingDirectory: $(System.DefaultWorkingDirectory)/build - ## # VisualStudio Extension can't be built from the build script as msbuild is not available). ## @@ -32,5 +31,9 @@ steps: configuration: $(Build.Configuration) +- pwsh: ./manifest.ps1 + displayName: "List built packages & assemblies" + workingDirectory: '$(System.DefaultWorkingDirectory)/build' + condition: succeededOrFailed() - template: wrap-up.yml