44 [ValidateSet (' Debug' , ' Release' )]
55 $Configuration = $null ,
66 [switch ]
7- $IsOfficialBuild ,
7+ $ci ,
8+ [switch ]
9+ $sign ,
810 [Parameter (ValueFromRemainingArguments = $true )]
911 [string []]$MSBuildArgs
1012)
@@ -18,40 +20,44 @@ Import-Module -Force -Scope Local "$PSScriptRoot/src/common.psm1"
1820# Main
1921#
2022
23+ if ($env: CI -eq ' true' ) {
24+ $ci = $true
25+ }
26+
2127if (! $Configuration ) {
22- $Configuration = if ($env: CI -or $IsOfficialBuild ) { ' Release' } else { ' Debug' }
28+ $Configuration = if ($ci ) { ' Release' } else { ' Debug' }
2329}
2430
25- if ($IsOfficialBuild ) {
31+ if ($ci ) {
2632 $MSBuildArgs += ' -p:CI=true'
33+ }
2734
28- $CodeSign = -not $env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and ($IsWindows -or -not $IsCoreCLR )
29-
30- if ($CodeSign ) {
31- $astDir = " $PSScriptRoot /.build/tools/store/AzureSignTool/1.0.1/"
32- $AzureSignToolPath = " $astDir /AzureSignTool.exe"
33- if (-not (Test-Path $AzureSignToolPath )) {
34- New-Item $astDir - ItemType Directory - ErrorAction Ignore | Out-Null
35- Invoke-WebRequest https:// github.com / vcsjones/ AzureSignTool/ releases/ download/ 1.0 .1 / AzureSignTool.zip `
36- - OutFile " $astDir /AzureSignTool.zip"
37- Expand-Archive " $astDir /AzureSignTool.zip" - DestinationPath $astDir
38- }
39-
40- $nstDir = " $PSScriptRoot /.build/tools/store/NuGetKeyVaultSignTool/1.1.4/"
41- $NuGetKeyVaultSignTool = " $nstDir /tools/net471/NuGetKeyVaultSignTool.exe"
42- if (-not (Test-Path $NuGetKeyVaultSignTool )) {
43- New-Item $nstDir - ItemType Directory - ErrorAction Ignore | Out-Null
44- Invoke-WebRequest https:// github.com / onovotny/ NuGetKeyVaultSignTool/ releases/ download/ v1.1.4 / NuGetKeyVaultSignTool.1.1 .4. nupkg `
45- - OutFile " $nstDir /NuGetKeyVaultSignTool.zip"
46- Expand-Archive " $nstDir /NuGetKeyVaultSignTool.zip" - DestinationPath $nstDir
47- }
35+ $CodeSign = $sign -or ($ci -and -not $env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and ($IsWindows -or -not $IsCoreCLR ))
4836
49- $MSBuildArgs += " -p:AzureSignToolPath=$AzureSignToolPath "
50- $MSBuildArgs += " -p:NuGetKeyVaultSignTool=$NuGetKeyVaultSignTool "
37+ if ($CodeSign ) {
38+ $astDir = " $PSScriptRoot /.build/tools/store/AzureSignTool/1.0.1/"
39+ $AzureSignToolPath = " $astDir /AzureSignTool.exe"
40+ if (-not (Test-Path $AzureSignToolPath )) {
41+ New-Item $astDir - ItemType Directory - ErrorAction Ignore | Out-Null
42+ Invoke-WebRequest https:// github.com / vcsjones/ AzureSignTool/ releases/ download/ 1.0 .1 / AzureSignTool.zip `
43+ - OutFile " $astDir /AzureSignTool.zip"
44+ Expand-Archive " $astDir /AzureSignTool.zip" - DestinationPath $astDir
5145 }
52- else {
53- $MSBuildArgs += ' -p:CodeSign=false'
46+
47+ $nstDir = " $PSScriptRoot /.build/tools/store/NuGetKeyVaultSignTool/1.1.4/"
48+ $NuGetKeyVaultSignTool = " $nstDir /tools/net471/NuGetKeyVaultSignTool.exe"
49+ if (-not (Test-Path $NuGetKeyVaultSignTool )) {
50+ New-Item $nstDir - ItemType Directory - ErrorAction Ignore | Out-Null
51+ Invoke-WebRequest https:// github.com / onovotny/ NuGetKeyVaultSignTool/ releases/ download/ v1.1.4 / NuGetKeyVaultSignTool.1.1 .4. nupkg `
52+ - OutFile " $nstDir /NuGetKeyVaultSignTool.zip"
53+ Expand-Archive " $nstDir /NuGetKeyVaultSignTool.zip" - DestinationPath $nstDir
5454 }
55+
56+ $MSBuildArgs += " -p:AzureSignToolPath=$AzureSignToolPath "
57+ $MSBuildArgs += " -p:NuGetKeyVaultSignTool=$NuGetKeyVaultSignTool "
58+ }
59+ else {
60+ $MSBuildArgs += ' -p:CodeSign=false'
5561}
5662
5763$artifacts = " $PSScriptRoot /artifacts/"
0 commit comments