Specify the runtime when running 'dotnet restore' in 'Start-PSBuild' (#6345)

# Conflicts:
#	build.psm1
This commit is contained in:
Dongbo Wang
2018-07-06 14:35:24 -07:00
committed by Travis Plunk
parent cf5535c571
commit 399bc2d30a
+5 -5
View File
@@ -524,19 +524,19 @@ Fix steps:
# handle Restore
if ($Restore -or -not (Test-Path "$($Options.Top)/obj/project.assets.json")) {
log "Run dotnet restore"
$srcProjectDirs = @($Options.Top, "$PSScriptRoot/src/TypeCatalogGen", "$PSScriptRoot/src/ResGen")
$testProjectDirs = Get-ChildItem "$PSScriptRoot/test/*.csproj" -Recurse | ForEach-Object { [System.IO.Path]::GetDirectoryName($_) }
$RestoreArguments = @("--verbosity")
$RestoreArguments = @("--runtime",$Options.Runtime,"--verbosity")
if ($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent) {
$RestoreArguments += "detailed"
} else {
$RestoreArguments += "quiet"
}
($srcProjectDirs + $testProjectDirs) | ForEach-Object { Start-NativeExecution { dotnet restore $_ $RestoreArguments } }
$srcProjectDirs | ForEach-Object {
log "Run dotnet restore $_ $RestoreArguments"
Start-NativeExecution { dotnet restore $_ $RestoreArguments }
}
}
# handle ResGen