QuantumLibraries/Build/build.ps1

45 строки
1.2 KiB
PowerShell

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
$ErrorActionPreference = 'Stop'
& "$PSScriptRoot/set-env.ps1"
$all_ok = $True
function Build-One {
param(
[string]$action,
[string]$project
);
dotnet $action (Join-Path $PSScriptRoot $project) `
-c $Env:BUILD_CONFIGURATION `
-v $Env:BUILD_VERBOSITY `
/property:DefineConstants=$Env:ASSEMBLY_CONSTANTS `
/property:Version=$Env:ASSEMBLY_VERSION `
/property:QsharpDocsOutputPath=$Env:DOCS_OUTDIR
if ($LastExitCode -ne 0) {
Write-Host "##vso[task.logissue type=error;]Failed to build $project."
$script:all_ok = $False
}
}
Write-Host "##[info]Build Standard library"
Build-One 'publish' '../Standard.sln'
Write-Host "##[info]Build Chemistry library"
Build-One 'publish' '../Chemistry.sln'
Write-Host "##[info]Build Numerics library"
Build-One 'publish' '../Numerics.sln'
Write-Host "##[info]Build QML library"
Build-One 'publish' '../MachineLearning.sln'
Write-Host "##[info]Build Jupyter magic library"
Build-One 'publish' '../Magic.sln'
if (-not $all_ok) {
throw "At least one test failed execution. Check the logs."
}