Skip to content

Commit

Permalink
Playing with workload provisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
sandyarmstrong committed Feb 20, 2022
1 parent e3cbe65 commit d44a16a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
25 changes: 24 additions & 1 deletion eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,30 @@ try {

if ($restore) {
&(Ensure-DotNetSdk) tool restore
&(Ensure-DotNetSdk) workload install macos # TODO: Specify version

# TODO: Move this to Install-DotNetWorkload.ps1
# TODO: Implement the same thing in bash for build.sh
foreach ($workload in $GlobalJson.workloads.PSObject.Properties) {
$workloadName = $workload.Name
$shortWorkloadName = $workloadName.Substring($workloadName.LastIndexOf(".") + 1)

$rollbackJson = @{}
$rollbackJson[$workloadName] = $workload.Value.version

$rollbackFile = New-TemporaryFile
$rollbackJson | ConvertTo-Json | Set-Content -Path $rollbackFile

$sourcesArgs = @()
foreach ($source in $workload.Value.sources) {
$sourcesArgs += "--source"
$sourcesArgs += $source
}

# TODO: This requires elevated access, at least on Mac.
&(Ensure-DotNetSdk) workload install $shortWorkloadName --from-rollback-file $rollbackFile $sourcesArgs

Remove-Item $rollbackFile
}
}

try
Expand Down
9 changes: 9 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,14 @@
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22080.1",
"Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22080.1"
},
"workloads": {
"microsoft.net.sdk.macos": {
"version": "12.1.301-preview.13.4",
"sources": [
"https://aka.ms/dotnet6/nuget/index.json",
"https://api.nuget.org/v3/index.json"
]
}
}
}

0 comments on commit d44a16a

Please sign in to comment.