From 04dd2332ff217b0b6563b27d0ddeb74ad1b11476 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Fri, 11 Jan 2019 14:47:23 -0800 Subject: [PATCH] Disable signing of non-shipping packages Also clean up how $(SignCoreSdk) is set so that `build -sign` does so and allows a full dry run locally. --- eng/Signing.props | 16 ++++++++++++++++ eng/setbuildinfo.bat | 6 +++--- run-build.ps1 | 12 +++++++++--- 3 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 eng/Signing.props diff --git a/eng/Signing.props b/eng/Signing.props new file mode 100644 index 000000000..17360d175 --- /dev/null +++ b/eng/Signing.props @@ -0,0 +1,16 @@ + + + + + + + + + + true + + + diff --git a/eng/setbuildinfo.bat b/eng/setbuildinfo.bat index aa620286e..0465d8ab6 100644 --- a/eng/setbuildinfo.bat +++ b/eng/setbuildinfo.bat @@ -27,12 +27,12 @@ IF /I "%Architecture:~0,3%"=="ARM" ( ECHO ##vso[task.setvariable variable=TestParameter] ECHO ##vso[task.setvariable variable=RunTests]false - ECHO ##vso[task.setvariable variable=AdditionalBuildParameters]/p:SignCoreSdk=true /p:DotNetSignType=%SignType% ) ELSE ( ECHO NOT ARM ECHO ##vso[task.setvariable variable=TestParameter]-test ECHO ##vso[task.setvariable variable=RunTests]true - ECHO ##vso[task.setvariable variable=AdditionalBuildParameters]-sign /p:SignCoreSdk=true /p:DotNetSignType=%SignType% -) \ No newline at end of file +) + +ECHO ##vso[task.setvariable variable=AdditionalBuildParameters]-sign /p:DotNetSignType=%SignType% diff --git a/run-build.ps1 b/run-build.ps1 index 6fddefbb0..83815d7d4 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -7,15 +7,21 @@ param( [string]$Configuration="Debug", [string]$Architecture="x64", + [switch]$Sign=$false, [Parameter(ValueFromRemainingArguments=$true)][String[]]$ExtraParameters ) $RepoRoot = "$PSScriptRoot" -$ArchitectureParam="/p:Architecture=$Architecture" -$ConfigurationParam="-configuration $Configuration" +$Parameters = "/p:Architecture=$Architecture" +$Parameters = "$Parameters -configuration $Configuration" + +if ($Sign) { + $Parameters = "$Parameters -sign /p:SignCoreSdk=true" +} + try { - $ExpressionToInvoke = "$RepoRoot\eng\common\build.ps1 -restore -build $ConfigurationParam $ArchitectureParam $ExtraParameters" + $ExpressionToInvoke = "$RepoRoot\eng\common\build.ps1 -restore -build $Parameters $ExtraParameters" Write-Host "Invoking expression: $ExpressionToInvoke" Invoke-Expression $ExpressionToInvoke }