-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dotnet] Create and ship a WorkloadDependencies.json file. Fixes #21768…
- Loading branch information
1 parent
ba733fb
commit 9853fef
Showing
7 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# generate-workload-dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include $(TOP)/scripts/template.mk | ||
$(eval $(call TemplateScript,GENERATE_WORKLOADDEPENDENCIES_JSON,generate-workloaddependencies-json)) |
39 changes: 39 additions & 0 deletions
39
scripts/generate-workloaddependencies-json/generate-workloaddependencies-json.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// arguments are: <platform> <version> <xcodeVersion> <sdkVersion> <outputPath> | ||
|
||
using System.IO; | ||
using System.Xml; | ||
|
||
var expectedArgumentCount = 5; | ||
if (args.Length != expectedArgumentCount) { | ||
Console.WriteLine ($"Need {expectedArgumentCount} arguments, got {args.Length}"); | ||
return 1; | ||
} | ||
|
||
var argumentIndex = 0; | ||
var platform = args [argumentIndex++]; | ||
var version = args [argumentIndex++]; | ||
var xcodeVersion = args [argumentIndex++]; | ||
var sdkVersion = args [argumentIndex++]; | ||
var outputPath = args [argumentIndex++]; | ||
|
||
var platformLowerCase = platform.ToLowerInvariant (); | ||
|
||
using (var writer = new StreamWriter (outputPath)) { | ||
writer.WriteLine ($"{{"); | ||
writer.WriteLine ($" \"microsoft.net.sdk.{platformLowerCase}\": {{"); | ||
writer.WriteLine ($" \"workload\": {{"); | ||
writer.WriteLine ($" \"alias\": [ \"{platformLowerCase}\" ],"); | ||
writer.WriteLine ($" \"version\": \"{version}\""); | ||
writer.WriteLine ($" }},"); | ||
writer.WriteLine ($" \"xcode\": {{"); | ||
writer.WriteLine ($" \"version\": \"[{xcodeVersion},)\","); | ||
writer.WriteLine ($" \"recommendedVersion\": \"{xcodeVersion}\""); | ||
writer.WriteLine ($" }},"); | ||
writer.WriteLine ($" \"sdk\": {{"); | ||
writer.WriteLine ($" \"version\": \"{sdkVersion}\""); | ||
writer.WriteLine ($" }}"); | ||
writer.WriteLine ($" }}"); | ||
writer.WriteLine ($"}}"); | ||
} | ||
|
||
return 0; |
5 changes: 5 additions & 0 deletions
5
scripts/generate-workloaddependencies-json/generate-workloaddependencies-json.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net$(BundledNETCoreAppTargetFrameworkVersion)</TargetFramework> | ||
</PropertyGroup> | ||
</Project> |
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong.