Skip to content

Commit 399bc2d

Browse files
daxian-dbwTravisEz13
authored andcommitted
Specify the runtime when running 'dotnet restore' in 'Start-PSBuild' (PowerShell#6345)
# Conflicts: # build.psm1
1 parent cf5535c commit 399bc2d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

build.psm1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,19 +524,19 @@ Fix steps:
524524

525525
# handle Restore
526526
if ($Restore -or -not (Test-Path "$($Options.Top)/obj/project.assets.json")) {
527-
log "Run dotnet restore"
528-
529527
$srcProjectDirs = @($Options.Top, "$PSScriptRoot/src/TypeCatalogGen", "$PSScriptRoot/src/ResGen")
530-
$testProjectDirs = Get-ChildItem "$PSScriptRoot/test/*.csproj" -Recurse | ForEach-Object { [System.IO.Path]::GetDirectoryName($_) }
531528

532-
$RestoreArguments = @("--verbosity")
529+
$RestoreArguments = @("--runtime",$Options.Runtime,"--verbosity")
533530
if ($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent) {
534531
$RestoreArguments += "detailed"
535532
} else {
536533
$RestoreArguments += "quiet"
537534
}
538535

539-
($srcProjectDirs + $testProjectDirs) | ForEach-Object { Start-NativeExecution { dotnet restore $_ $RestoreArguments } }
536+
$srcProjectDirs | ForEach-Object {
537+
log "Run dotnet restore $_ $RestoreArguments"
538+
Start-NativeExecution { dotnet restore $_ $RestoreArguments }
539+
}
540540
}
541541

542542
# handle ResGen

0 commit comments

Comments
 (0)