From 29cb337de90ddea566a0555bb14b43648eae28b4 Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Tue, 20 Oct 2020 10:00:52 -0700 Subject: [PATCH 1/9] Adding manifest file --- build/manifest.ps1 | 57 ++++++++++++++++++++++++++++++++++++++++++++++ build/steps.yml | 4 ++++ 2 files changed, 61 insertions(+) create mode 100644 build/manifest.ps1 diff --git a/build/manifest.ps1 b/build/manifest.ps1 new file mode 100644 index 0000000000..4fa397ad1c --- /dev/null +++ b/build/manifest.ps1 @@ -0,0 +1,57 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + + +<# + .SYNOPSIS + Provides the list of artifacts (Packages and Assemblies) generated by this repository. + + .PARAMETER ValidateAssemblies + Specifies if it should validate that the expected Assemblies exist. + + .PARAMETER ValidatePackages + Specifies if it should validate that the expected packages exist. +#> + +param( + [bool] $ValidateAssemblies = $True, + [bool] $ValidatePackages = $True +); + +& "$PSScriptRoot/set-env.ps1" + +$artifacts = @{ + Packages = @( + "Microsoft.Quantum.Compiler" + "Microsoft.Quantum.ProjectTemplates" + "Microsoft.Quantum.Sdk" + "qsc" + ); + Assemblies = @( + ".\src\QuantumSdk\Tools\BuildConfiguration\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.BuildConfiguration.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\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", + + ".\src\VisualStudioExtension\QsharpVSIX\bin\$Env:BUILD_CONFIGURATION\Microsoft.Quantum.VisualStudio.Extension.dll" + ) +} + +if ($ValidatePackages -eq $True) { + $artifacts.Packages = $artifacts.Packages | ForEach-Object { Get-Item (Join-Path $env:NUGET_OUTDIR "$_.$Env:NUGET_VERSION.nupkg") }; +} + +if ($ValidateAssemblies -eq $True) { + $artifacts.Assemblies = $artifacts.Assemblies | ForEach-Object { Get-Item (Join-Path $PSScriptRoot (Join-Path ".." $_)) }; +} + +$artifacts | Write-Output; diff --git a/build/steps.yml b/build/steps.yml index 0623033f7f..59ecb824a6 100644 --- a/build/steps.yml +++ b/build/steps.yml @@ -16,6 +16,10 @@ steps: displayName: "Pack NuGets and VS Code" workingDirectory: $(System.DefaultWorkingDirectory)/build +- pwsh: .\manifest.ps1 + displayName: "List built packages & assemblies" + workingDirectory: '$(System.DefaultWorkingDirectory)/build' + condition: succeededOrFailed() ## From 07abd5642777a6e46cf026f90e584a15e216d7db Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Tue, 20 Oct 2020 22:51:27 -0700 Subject: [PATCH 2/9] OutputFormat --- build/manifest.ps1 | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/build/manifest.ps1 b/build/manifest.ps1 index 4fa397ad1c..086edc0606 100644 --- a/build/manifest.ps1 +++ b/build/manifest.ps1 @@ -1,21 +1,17 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. - <# .SYNOPSIS Provides the list of artifacts (Packages and Assemblies) generated by this repository. - .PARAMETER ValidateAssemblies - Specifies if it should validate that the expected Assemblies exist. - - .PARAMETER ValidatePackages - Specifies if it should validate that the expected packages exist. + .PARAMETER OutputFormat + Specifies if the output of this script should be a hashtable with the artificats + as strings with the absolute path (AbsolutePath) or FileInfo structures. #> - param( - [bool] $ValidateAssemblies = $True, - [bool] $ValidatePackages = $True + [ValidateSet('FileInfo','AbsolutePath')] + [string] $OutputFormat = 'FileInfo' ); & "$PSScriptRoot/set-env.ps1" @@ -26,7 +22,8 @@ $artifacts = @{ "Microsoft.Quantum.ProjectTemplates" "Microsoft.Quantum.Sdk" "qsc" - ); + ) | ForEach-Object { Join-Path $Env:NUGET_OUTDIR "$_.$Env:NUGET_VERSION.nupkg" }; + Assemblies = @( ".\src\QuantumSdk\Tools\BuildConfiguration\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.BuildConfiguration.dll", @@ -43,15 +40,12 @@ $artifacts = @{ ".\src\QsCompiler\LanguageServer\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.QsTransformations.dll", ".\src\VisualStudioExtension\QsharpVSIX\bin\$Env:BUILD_CONFIGURATION\Microsoft.Quantum.VisualStudio.Extension.dll" - ) + ) | ForEach-Object { Join-Path $PSScriptRoot (Join-Path ".." $_) }; } -if ($ValidatePackages -eq $True) { - $artifacts.Packages = $artifacts.Packages | ForEach-Object { Get-Item (Join-Path $env:NUGET_OUTDIR "$_.$Env:NUGET_VERSION.nupkg") }; -} - -if ($ValidateAssemblies -eq $True) { - $artifacts.Assemblies = $artifacts.Assemblies | ForEach-Object { Get-Item (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; From 384dbf2673619f8ab293f1cc914bfc26ed0b42db Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Tue, 20 Oct 2020 22:52:15 -0700 Subject: [PATCH 3/9] consistent paths --- build/steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/steps.yml b/build/steps.yml index 59ecb824a6..92afb0cf58 100644 --- a/build/steps.yml +++ b/build/steps.yml @@ -16,7 +16,7 @@ steps: displayName: "Pack NuGets and VS Code" workingDirectory: $(System.DefaultWorkingDirectory)/build -- pwsh: .\manifest.ps1 +- pwsh: ./manifest.ps1 displayName: "List built packages & assemblies" workingDirectory: '$(System.DefaultWorkingDirectory)/build' condition: succeededOrFailed() From 82f1d530c358b28f75f07cb9c338567dba8457a7 Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Wed, 21 Oct 2020 11:57:52 -0700 Subject: [PATCH 4/9] manifest order --- build/steps.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build/steps.yml b/build/steps.yml index 92afb0cf58..323b096c22 100644 --- a/build/steps.yml +++ b/build/steps.yml @@ -16,11 +16,6 @@ steps: displayName: "Pack NuGets and VS Code" workingDirectory: $(System.DefaultWorkingDirectory)/build -- pwsh: ./manifest.ps1 - displayName: "List built packages & assemblies" - workingDirectory: '$(System.DefaultWorkingDirectory)/build' - condition: succeededOrFailed() - ## # VisualStudio Extension can't be built from the build script as msbuild is not available). @@ -36,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 From 7b07dd5ddda8700f394a67753846f1974b92f683 Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Thu, 22 Oct 2020 10:43:46 -0700 Subject: [PATCH 5/9] typo --- build/manifest.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/manifest.ps1 b/build/manifest.ps1 index 086edc0606..f22f05a10d 100644 --- a/build/manifest.ps1 +++ b/build/manifest.ps1 @@ -6,7 +6,7 @@ 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 artificats + 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( From ef596eedef3c5736ac95c1240f45418bbf1f33f7 Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Fri, 23 Oct 2020 15:26:29 -0700 Subject: [PATCH 6/9] Report dlls conditionally --- build/manifest.ps1 | 55 +++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/build/manifest.ps1 b/build/manifest.ps1 index ca7091bbfc..9295a8a0fb 100644 --- a/build/manifest.ps1 +++ b/build/manifest.ps1 @@ -10,38 +10,57 @@ as strings with the absolute path (AbsolutePath) or FileInfo structures. #> param( - [ValidateSet('FileInfo','AbsolutePath')] + [ValidateSet('FileInfo', 'AbsolutePath')] [string] $OutputFormat = 'FileInfo' ); & "$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.QsLanguageServer.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 = @(); +} + $artifacts = @{ Packages = @( - "Microsoft.Quantum.Compiler" - "Microsoft.Quantum.ProjectTemplates" - "Microsoft.Quantum.Sdk" + "Microsoft.Quantum.Compiler", + "Microsoft.Quantum.Compiler.CommandLine", + "Microsoft.Quantum.DocumentationGenerator" + "Microsoft.Quantum.ProjectTemplates", + "Microsoft.Quantum.Sdk", "qsc" ) | ForEach-Object { Join-Path $Env:NUGET_OUTDIR "$_.$Env:NUGET_VERSION.nupkg" }; - Assemblies = @( - ".\src\QuantumSdk\Tools\BuildConfiguration\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.BuildConfiguration.dll", - + 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\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\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", + ".\src\QsCompiler\CommandLineTool\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qsc.dll", - ".\src\VisualStudioExtension\QsharpVSIX\bin\$Env:BUILD_CONFIGURATION\Microsoft.Quantum.VisualStudio.Extension.dll" + ".\src\QuantumSdk\Tools\BuildConfiguration\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.BuildConfiguration.dll" ) | ForEach-Object { Join-Path $PSScriptRoot (Join-Path ".." $_) }; } From 5417a80f901c6084cea3f1993da89c47716a03cc Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Fri, 23 Oct 2020 15:49:22 -0700 Subject: [PATCH 7/9] -qsc --- build/manifest.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/manifest.ps1 b/build/manifest.ps1 index 9295a8a0fb..9e1c3821a1 100644 --- a/build/manifest.ps1 +++ b/build/manifest.ps1 @@ -41,8 +41,7 @@ $artifacts = @{ "Microsoft.Quantum.Compiler.CommandLine", "Microsoft.Quantum.DocumentationGenerator" "Microsoft.Quantum.ProjectTemplates", - "Microsoft.Quantum.Sdk", - "qsc" + "Microsoft.Quantum.Sdk" ) | ForEach-Object { Join-Path $Env:NUGET_OUTDIR "$_.$Env:NUGET_VERSION.nupkg" }; Assemblies = $VsixAssemblies + @( From e9626e3ea3781484a9f5f8a57927259743d0d823 Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Fri, 23 Oct 2020 15:56:56 -0700 Subject: [PATCH 8/9] +qsc,-CommandLine --- build/manifest.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/manifest.ps1 b/build/manifest.ps1 index 9e1c3821a1..6fb7c36a17 100644 --- a/build/manifest.ps1 +++ b/build/manifest.ps1 @@ -38,10 +38,10 @@ else { $artifacts = @{ Packages = @( "Microsoft.Quantum.Compiler", - "Microsoft.Quantum.Compiler.CommandLine", "Microsoft.Quantum.DocumentationGenerator" "Microsoft.Quantum.ProjectTemplates", - "Microsoft.Quantum.Sdk" + "Microsoft.Quantum.Sdk", + "qsc" ) | ForEach-Object { Join-Path $Env:NUGET_OUTDIR "$_.$Env:NUGET_VERSION.nupkg" }; Assemblies = $VsixAssemblies + @( From 3e67f262806c33959c8faf6a2a613dad2990080f Mon Sep 17 00:00:00 2001 From: Andres Paz Date: Fri, 23 Oct 2020 16:05:19 -0700 Subject: [PATCH 9/9] No manifest in pack --- build/manifest.ps1 | 12 +++--------- build/pack.ps1 | 3 --- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/build/manifest.ps1 b/build/manifest.ps1 index 6fb7c36a17..a554791a8f 100644 --- a/build/manifest.ps1 +++ b/build/manifest.ps1 @@ -14,22 +14,16 @@ param( [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.QsLanguageServer.dll" + ".\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" ); - - # 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 = @(); 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