Commit b529d52
authored
[build] use explicit folder names in DeleteExtractedWorkloadPacks (#6081)
When working on .NET 6, I've occasionally hit the build error:
Microsoft.NET.TargetFrameworkInference.targets(109,5):
error NETSDK1139: The target platform identifier android was not recognized.
After looking at the contents of `dotnet\packs`, I have an empty
folder such as:
~\android-toolchain\dotnet\packs\Microsoft.Android.Sdk.Windows\30.0.100-ci.main.76\
Yet the workload said it actually installed the pack:
Writing workload pack installation record for Microsoft.Android.Sdk version 30.0.100-ci.main.76...
I think the `dotnet workload` command must skip over folders if the
folder *exists*. It does not actually validate if content is missing.
To make matters worse, our logic would not actually delete folders
when using this wildcard:
<_PackFilesToDelete Include="$(DotNetPreviewPath)packs\Microsoft.Android*\**\*.*" />
Since there are no files, the `packs\Microsoft.Android.Sdk.Windows`
folder would not be deleted.
To solve this issue, I think we should just explicitly list each
folder. There are not that many, and I don't anticipate us having
a long list of packs.
Additionally, let's delete the `metadata` folder as it stores
information about which workloads are installed. It may be an
additional source of confusion down the road.1 parent 7c5fab1 commit b529d52
1 file changed
+14
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
126 | 135 | | |
127 | | - | |
| 136 | + | |
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
| |||
0 commit comments