2019-07-19 22:10:51 +03:00
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
# Licensed under the MIT License.
|
|
|
|
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
|
|
|
|
& "$PSScriptRoot/set-env.ps1"
|
|
|
|
$all_ok = $True
|
|
|
|
|
|
|
|
function Pack-One() {
|
|
|
|
Param($project)
|
|
|
|
|
|
|
|
dotnet pack (Join-Path $PSScriptRoot $project) `
|
|
|
|
--no-build `
|
|
|
|
-c $Env:BUILD_CONFIGURATION `
|
|
|
|
-v $Env:BUILD_VERBOSITY `
|
|
|
|
-o $Env:NUGET_OUTDIR `
|
2020-01-13 22:39:44 +03:00
|
|
|
/property:PackageVersion=$Env:NUGET_VERSION
|
2019-07-19 22:10:51 +03:00
|
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
|
Write-Host "##vso[task.logissue type=error;]Failed to pack $project."
|
|
|
|
$script:all_ok = $False
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-23 10:00:31 +03:00
|
|
|
function Pack-Wheel() {
|
|
|
|
param(
|
|
|
|
[string] $Path
|
|
|
|
);
|
|
|
|
|
|
|
|
$result = 0
|
|
|
|
|
|
|
|
Push-Location (Join-Path $PSScriptRoot $Path)
|
|
|
|
python setup.py bdist_wheel sdist --formats=gztar
|
|
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
|
Write-Host "##vso[task.logissue type=error;]Failed to build $Path."
|
|
|
|
$script:all_ok = $False
|
|
|
|
} else {
|
|
|
|
Copy-Item "dist/*.whl" $Env:PYTHON_OUTDIR
|
|
|
|
Copy-Item "dist/*.tar.gz" $Env:PYTHON_OUTDIR
|
|
|
|
}
|
|
|
|
Pop-Location
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-07-19 22:10:51 +03:00
|
|
|
Write-Host "##[info]Pack Standard library"
|
|
|
|
Pack-One '../Standard/src/Standard.csproj'
|
|
|
|
|
|
|
|
Write-Host "##[info]Pack Chemistry library"
|
2020-06-24 22:19:24 +03:00
|
|
|
Pack-One '../Chemistry/src/Runtime/Runtime.csproj'
|
2019-07-19 22:10:51 +03:00
|
|
|
Pack-One '../Chemistry/src/DataModel/DataModel.csproj'
|
2020-06-24 22:19:24 +03:00
|
|
|
Pack-One '../Chemistry/src/Metapackage/Metapackage.csproj'
|
2019-07-19 22:10:51 +03:00
|
|
|
|
2019-11-15 03:49:48 +03:00
|
|
|
Write-Host "##[info]Pack QML library"
|
2020-01-13 22:39:44 +03:00
|
|
|
Pack-One '../MachineLearning/src/MachineLearning.csproj'
|
2019-11-15 03:49:48 +03:00
|
|
|
|
2019-07-19 22:10:51 +03:00
|
|
|
Write-Host "##[info]Pack Numerics library"
|
|
|
|
Pack-One '../Numerics/src/Numerics.csproj'
|
|
|
|
|
|
|
|
Write-Host "##[info]Pack chemistry magics library"
|
|
|
|
Pack-One '../Chemistry/src/Jupyter/Jupyter.csproj'
|
|
|
|
|
2020-06-24 03:09:17 +03:00
|
|
|
Write-Host "##[info]Pack chemistry tool"
|
|
|
|
Pack-One '../Chemistry/src/Tools/Tools.csproj'
|
|
|
|
|
2020-07-23 10:00:31 +03:00
|
|
|
if ($Env:ENABLE_PYTHON -eq "false") {
|
|
|
|
Write-Host "##vso[task.logissue type=warning;]Skipping Creating Python packages. Env:ENABLE_PYTHON was set to 'false'."
|
|
|
|
} else {
|
|
|
|
Write-Host "##[info]Packing Python wheel..."
|
|
|
|
python --version
|
|
|
|
Pack-Wheel '../Python/qsharp-chemistry'
|
|
|
|
Pack-Wheel '../Python/qsharp'
|
|
|
|
}
|
|
|
|
|
2019-07-19 22:10:51 +03:00
|
|
|
if (-not $all_ok) {
|
|
|
|
throw "At least one test failed execution. Check the logs."
|
|
|
|
}
|