Skip to content

Commit

Permalink
[dotnet] Improve listing older tooling workloads we might depend on. (#…
Browse files Browse the repository at this point in the history
…22233)

Improve listing older tooling workloads we might depend on by not hardcoding version numbers.

Ref: dotnet/maui#27318
  • Loading branch information
rolfbjarne authored Feb 26, 2025
1 parent 97fbaaf commit a8168d3
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@
}).
ToDictionary (v => v.Item1, v => v.Item2, StringComparer.OrdinalIgnoreCase);

var sortedAllApiVersions = allApiVersions.
Select (v => {
v = v.Replace ("net", "");
v = v [0..v.IndexOf ('_')];
return v;
}).
Select (Version.Parse).
Distinct ().
OrderBy (v => v).
ToArray ();
var earliestDotNetVersion = sortedAllApiVersions.First ().Major;
var latestDotNetVersion = sortedAllApiVersions.Last ().Major;

var failed = false;
using (TextWriter writer = new StreamWriter (outputPath)) {
writer.WriteLine ($"{{");
Expand All @@ -61,10 +74,12 @@
writer.WriteLine ($" \"extends\": [");
if (platform == "macOS") {
writer.WriteLine ($" \"microsoft-net-runtime-mono-tooling\",");
writer.WriteLine ($" \"microsoft-net-runtime-mono-tooling-net8\",");
for (var i = earliestDotNetVersion; i < latestDotNetVersion; i++)
writer.WriteLine ($" \"microsoft-net-runtime-mono-tooling-net{i}\",");
} else {
writer.WriteLine ($" \"microsoft-net-runtime-{platformLowerCase}\",");
writer.WriteLine ($" \"microsoft-net-runtime-{platformLowerCase}-net8\",");
for (var i = earliestDotNetVersion; i < latestDotNetVersion; i++)
writer.WriteLine ($" \"microsoft-net-runtime-{platformLowerCase}-net{i}\",");
}
writer.WriteLine ($" ]");
writer.WriteLine ($" }},");
Expand Down

9 comments on commit a8168d3

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ [CI Build #a8168d3] Build passed (CodeQL) ✅

Pipeline on Agent
Hash: a8168d353b7da5d08c32e0022daaac837d731d84 [CI build]

Please sign in to comment.