Skip to content

Commit 0328995

Browse files
committed
Enable msbuildargs in installers build.ps1
1 parent 6064891 commit 0328995

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

run.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,7 @@ if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/bu
220220

221221
[string[]] $ProdConArgs = @()
222222

223-
Write-Output "About to check for URL"
224223
if ($PackageVersionPropsUrl) {
225-
Write-Output "We have URL"
226224
$IntermediateDir = Join-Path $PSScriptRoot 'obj'
227225
$PropsFilePath = Join-Path $IntermediateDir 'external-dependencies.props'
228226
New-Item -ItemType Directory $IntermediateDir -ErrorAction Ignore | Out-Null

src/Installers/Windows/build.ps1

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
#
44

55
#requires -version 5
6-
[cmdletbinding()]
6+
[CmdletBinding(PositionalBinding = $false)]
77
param(
88
[string]$Configuration = 'Debug',
99
[string]$BuildNumber = 't000',
1010
[string]$PackageVersionPropsUrl = $null,
1111
[string]$AccessTokenSuffix = $null,
1212
[string]$AssetRootUrl = $null,
1313
[string]$RestoreSources = $null,
14-
[switch]$clean
14+
[switch]$clean,
15+
[Parameter(ValueFromRemainingArguments = $true)]
16+
[string[]]$MSBuildArguments
1517
)
1618

1719
$ErrorActionPreference = 'Stop'
@@ -40,37 +42,35 @@ try {
4042
"-p:Configuration=$Configuration"
4143
}
4244

43-
[string[]] $msbuildArgs = @()
44-
4545
if ($AssetRootUrl) {
46-
$msbuildArgs += "-p:DotNetAssetRootUrl=$AssetRootUrl"
46+
$MSBuildArguments += "-p:DotNetAssetRootUrl=$AssetRootUrl"
4747
}
4848

4949
if ($RestoreSources) {
50-
$msbuildArgs += "-p:DotNetAdditionalRestoreSources=$RestoreSources"
50+
$MSBuildArguments += "-p:DotNetAdditionalRestoreSources=$RestoreSources"
5151
}
5252

5353
# PipeBuild parameters
54-
$msbuildArgs += "-p:SignType=${env:PB_SignType}"
55-
$msbuildArgs += "-p:IsFinalBuild=${env:PB_IsFinalBuild}"
54+
$MSBuildArguments += "-p:SignType=${env:PB_SignType}"
55+
$MSBuildArguments += "-p:IsFinalBuild=${env:PB_IsFinalBuild}"
5656

5757
if ($clean) {
58-
$msbuildArgs += '-t:Clean'
58+
$MSBuildArguments += '-t:Clean'
5959
}
6060

6161
if ($AccessTokenSuffix) {
62-
$msbuildArgs += "-p:DotNetAccessTokenSuffix=$AccessTokenSuffix"
62+
$MSBuildArguments += "-p:DotNetAccessTokenSuffix=$AccessTokenSuffix"
6363
}
6464

6565
if ($PackageVersionPropsUrl) {
6666
$IntermediateDir = Join-Path $PSScriptRoot 'obj'
6767
$PropsFilePath = Join-Path $IntermediateDir 'external-dependencies.props'
6868
New-Item -ItemType Directory $IntermediateDir -ErrorAction Ignore | Out-Null
6969
Get-RemoteFile "${PackageVersionPropsUrl}${AccessTokenSuffix}" $PropsFilePath
70-
$msbuildArgs += "-p:DotNetPackageVersionPropsPath=$PropsFilePath"
70+
$MSBuildArguments += "-p:DotNetPackageVersionPropsPath=$PropsFilePath"
7171
}
7272

73-
$msbuildArgs += '-t:Build'
73+
$MSBuildArguments += '-t:Build'
7474

7575
Invoke-Block { & $msbuild `
7676
WindowsInstallers.proj `
@@ -85,7 +85,7 @@ try {
8585
"-p:Configuration=$Configuration" `
8686
"-p:BuildNumber=$BuildNumber" `
8787
"-bl:$repoRoot/artifacts/logs/installers.msbuild.binlog" `
88-
@msbuildArgs
88+
@MSBuildArguments
8989
}
9090
}
9191
finally {

0 commit comments

Comments
 (0)