Commit 3a067cc
authored
[build] clean up past .NET 5 installations (#5103)
Context: https://docs.microsoft.com/dotnet/core/tools/dotnet-install-script
The `use-dot-net.yaml` template is leaving behind old installations
of .NET 5:
$ dotnet --list-sdks
3.1.201 [/Users/builder/.dotnet/sdk]
5.0.100-preview.6.20265.2 [/Users/builder/.dotnet/sdk]
5.0.100-preview.7.20307.3 [/Users/builder/.dotnet/sdk]
5.0.100-rc.1.20365.11 [/Users/builder/.dotnet/sdk]
5.0.100-rc.1.20411.10 [/Users/builder/.dotnet/sdk]
5.0.100-rc.1.20414.5 [/Users/builder/.dotnet/sdk]
5.0.100-rc.1.20426.3 [/Users/builder/.dotnet/sdk]
5.0.100-rc.2.20458.11 [/Users/builder/.dotnet/sdk]
We are currently using `dotnet-install.sh` or `dotnet-install.ps1` to
install nightly builds of .NET 5. These scripts basically download a
`.zip` file and extract them.
I added a new `remove_dotnet` parameter to delete the `dotnet`
directory completely. This will ensure we only have the versions of
.NET Core 3.x and .NET 5 specified in our build definition.
Usage would look like:
- template: yaml-templates/use-dot-net.yaml
parameters:
version: $(DotNetCorePreviewVersion)
remove_dotnet: true
- template: yaml-templates/use-dot-net.yaml
parameters:
version: $(DotNetCoreVersion)
Simply deleting the directories is similar to what the
[`dotnet-uninstall-pkgs.sh`][0] script does.
[0]: https://github.com/dotnet/sdk/blob/feae865a0614026d72ed9a9558d0111e5fcd5765/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh#L351 parent 696530d commit 3a067cc
File tree
4 files changed
+12
-2
lines changed- build-tools/automation
- yaml-templates
4 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
283 | 284 | | |
284 | 285 | | |
285 | 286 | | |
| 287 | + | |
286 | 288 | | |
287 | 289 | | |
288 | 290 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | | - | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
20 | | - | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| |||
0 commit comments