Make hosting bundle get prodcon runtime versions (#1435)

This commit is contained in:
Justin Kotalik 2018-09-27 16:44:40 -07:00 committed by GitHub
parent 66ba370a0a
commit fc39ea3bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 2 deletions

View File

@ -290,3 +290,24 @@ function Get-MSBuildPath {
}
return $msbuild
}
function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) {
if ($RemotePath -notlike 'http*') {
Copy-Item $RemotePath $LocalPath
return
}
$retries = 10
while ($retries -gt 0) {
$retries -= 1
try {
Invoke-WebRequest -UseBasicParsing -Uri $RemotePath -OutFile $LocalPath
return
}
catch {
Write-Verbose "Request failed. $retries retries remaining"
}
}
Write-Error "Download failed: '$RemotePath'."
}

View File

@ -14,10 +14,9 @@ param(
[string]$Runtime64Zip,
[string]$BuildNumber = 't000',
[string]$SignType = '',
[string]$PackageVersionPropsUrl = $null,
[string]$AccessTokenSuffix = $null,
[string]$AssetRootUrl = $null,
[switch]$clean
)
@ -68,6 +67,14 @@ try {
$msbuildArgs += "-p:DotNetAccessTokenSuffix=$AccessTokenSuffix"
}
if ($PackageVersionPropsUrl) {
$IntermediateDir = Join-Path $PSScriptRoot 'obj'
$PropsFilePath = Join-Path $IntermediateDir 'external-dependencies.props'
New-Item -ItemType Directory $IntermediateDir -ErrorAction Ignore | Out-Null
Get-RemoteFile "${PackageVersionPropsUrl}${AccessTokenSuffix}" $PropsFilePath
$msbuildArgs += "-p:DotNetPackageVersionPropsPath=$PropsFilePath"
}
$msbuildArgs += '-t:Build'
Invoke-Block { & $msbuild `