Make hosting bundle get prodcon runtime versions (#1435)
This commit is contained in:
parent
66ba370a0a
commit
fc39ea3bec
|
|
@ -290,3 +290,24 @@ function Get-MSBuildPath {
|
||||||
}
|
}
|
||||||
return $msbuild
|
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'."
|
||||||
|
}
|
||||||
|
|
@ -14,10 +14,9 @@ param(
|
||||||
[string]$Runtime64Zip,
|
[string]$Runtime64Zip,
|
||||||
[string]$BuildNumber = 't000',
|
[string]$BuildNumber = 't000',
|
||||||
[string]$SignType = '',
|
[string]$SignType = '',
|
||||||
|
[string]$PackageVersionPropsUrl = $null,
|
||||||
[string]$AccessTokenSuffix = $null,
|
[string]$AccessTokenSuffix = $null,
|
||||||
[string]$AssetRootUrl = $null,
|
[string]$AssetRootUrl = $null,
|
||||||
|
|
||||||
[switch]$clean
|
[switch]$clean
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -68,6 +67,14 @@ try {
|
||||||
$msbuildArgs += "-p:DotNetAccessTokenSuffix=$AccessTokenSuffix"
|
$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'
|
$msbuildArgs += '-t:Build'
|
||||||
|
|
||||||
Invoke-Block { & $msbuild `
|
Invoke-Block { & $msbuild `
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue