-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mono] new Sdk that selects mono runtime components #54432
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
5bab843
Work in progress: new Sdk that selects mono runtime components
lambdageek fad6101
Add props and targets description to the components doc
lambdageek cb34023
condition the _MonoRuntimeAvailableComponents by RuntimeIdentifier
lambdageek efc5caf
[cmake] Write a component-manifest.props file during build
lambdageek d974927
Build Microsoft.NETCore.App.Runtime.Mono.<RID>.Sdk shared framework n…
lambdageek cc468e3
put the compoonent-manifest.targets into the Sdk
lambdageek d5aae8f
delete WIP in mono/nuget/
lambdageek b213b70
fixup static component names in component-manifest.targets
lambdageek 731a419
delete fixed fixme
lambdageek 82dd4f2
add missing $
lambdageek a0a3803
fix whitespace
lambdageek a440aa2
[cmake] switch to configure_file instead of file(CONFIGURE)
lambdageek 434a38b
add missing trailing slashes in .props.in file
lambdageek 71c2376
Add new Sdk packs to the workload manifest
lambdageek 3fe371b
rework component-manifest.targets to use ItemGroups; move to new SDK
lambdageek d3bc250
Rename shared framework to Microsoft.NETCore.App.Runtime.Mono.<RID>.P…
lambdageek 8b5fd0a
Update manifest to include the new Props.Sdk and MonoTargets.Sdk
lambdageek dd03117
Move RuntimeConfigParserTask into Microsoft.NET.Runtime.MonoTargets.Sdk
lambdageek 12cd2a6
Add iossimulator-x86 props
lambdageek e6651b2
update components design doc
lambdageek 8d1e674
Fix typo
lambdageek b9be77f
improve docs
lambdageek db6a828
Add _MonoRuntimeComponentDontLink target output
lambdageek 5c88b3e
Drop component-manifest.props into runtime pack build/ directory
lambdageek 8a791ea
remove Microsoft.NETCore.App.Mono.Props.Sdk
lambdageek 016c88a
Import component-manifest.props from the runtime pack
lambdageek 49f5a65
Fix typos
lambdageek 66b33df
Apply suggestions from code review
lambdageek a217d4e
Add JsonToItemsTaskFactory
lambdageek c3cee96
fix whitespace
lambdageek 438f3ec
Do some validation earlier in _MonoComputeAvailableComponentDefinitions
lambdageek 29420e2
Read component-manifest.json using the JsonToItemsTaskFactory
lambdageek 58015a0
remove ResolvedRuntimePack import from WorkloadManifest.targets
lambdageek d3071da
Generate component-manifest.json in CMakeLists.txt
lambdageek 756e5a6
Fix some copy-paste nits
lambdageek 372df69
Use RuntimeFlavor==mono for runtime pack build directory
lambdageek 2cc01b6
Apply suggestions from code review
lambdageek 065a2bb
rename component-manifest to RuntimeComponentManifest
lambdageek 6957bcc
fixup nullability annotations
lambdageek dae9aeb
fix whitespace
lambdageek d5e6f0e
fix formatting
lambdageek eb0d0d4
Misc fixes to JsonToItemsTaskFactory
lambdageek 4874bd4
Rename MonoRuntimeComponentManifestReadTask
lambdageek 011e7ab
undo nullability annotation
lambdageek c332f7b
fix incorrect task parameter name
lambdageek 7d6ca6d
Remove Identity metadata from dictionary at json parsing time
lambdageek 174065e
Throw correct json deserializer exceptions
lambdageek 5ffc175
Catch JsonException in an async function
lambdageek 6213067
fixup comments
lambdageek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,16 @@ | ||
{ | ||
"items": { | ||
"_MonoRuntimeComponentLinking": [ | ||
{ "identity": "${TemplateMonoRuntimeComponentLinking}", "RuntimeIdentifier": "${TemplateRuntimeIdentifier}" }, | ||
], | ||
"_MonoRuntimeComponentSharedLibExt": [ | ||
{ "identity": "${TemplateMonoRuntimeComponentSharedLibExt}", "RuntimeIdentifier": "${TemplateRuntimeIdentifier}" }, | ||
], | ||
"_MonoRuntimeComponentStaticLibExt": [ | ||
{ "identity": "${TemplateMonoRuntimeComponentStaticLibExt}", "RuntimeIdentifier": "${TemplateRuntimeIdentifier}" }, | ||
], | ||
"_MonoRuntimeAvailableComponents": [ | ||
${TemplateMonoRuntimeAvailableComponents} | ||
], | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Microsoft.NET.Runtime.MonoTargets.Sdk.pkgproj
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,23 @@ | ||
<Project DefaultTargets="Build"> | ||
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" /> | ||
|
||
<PropertyGroup> | ||
<PackageDescription>Provides the tasks+targets, for consumption by mono-based workloads</PackageDescription> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(RepoTasksDir)RuntimeConfigParser\RuntimeConfigParser.csproj" /> | ||
<ProjectReference Include="$(RepoTasksDir)JsonToItemsTaskFactory\JsonToItemsTaskFactory.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageFile Include="Sdk\Sdk.props" TargetPath="Sdk" /> | ||
<PackageFile Include="Sdk\Sdk.targets" TargetPath="Sdk" /> | ||
<PackageFile Include="build\$(MSBuildProjectName).props" TargetPath="build" /> | ||
<PackageFile Include="Sdk\RuntimeConfigParserTask.props" TargetPath="Sdk" /> | ||
<PackageFile Include="Sdk\RuntimeComponentManifest.props" TargetPath="Sdk" /> | ||
<PackageFile Include="Sdk\RuntimeComponentManifest.targets" TargetPath="Sdk" /> | ||
</ItemGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" /> | ||
</Project> |
38 changes: 38 additions & 0 deletions
38
src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/README.md
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,38 @@ | ||
# Mono Runtime Host support targets | ||
|
||
This Sdk provides additional tasks and targets for workloads hosting the MonoVM .NET runtime. | ||
|
||
## component-manifest.targets | ||
|
||
See https://github.com/dotnet/runtime/blob/main/docs/design/mono/components.md | ||
|
||
## RuntimeConfigParserTask | ||
The `RuntimeConfigParserTask` task converts a json `runtimeconfig.json` to a binary blob for MonoVM's `monovm_runtimeconfig_initialize` API. | ||
To use the task in a project, reference the NuGet package, with the appropriate nuget source. | ||
|
||
### NuGet.config | ||
```xml | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" /> | ||
</packageSources> | ||
</configuration> | ||
``` | ||
|
||
### In the project file | ||
```xml | ||
<!-- Import the NuGet package into the project --> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Runtime.MonoTargets.Sdk" Version="<desired-dotnet-6-sdk-version>" /> | ||
</ItemGroup> | ||
|
||
<!-- Use the RuntimeConfigParser task in a target --> | ||
<Target> | ||
<RuntimeConfigParserTask | ||
RuntimeConfigFile="$(Path_to_runtimeconfig.json_file)" | ||
OutputFile="$(Path_to_generated_binary_file)" | ||
RuntimeConfigReservedProperties="@(runtime_properties_reserved_by_host)"> | ||
</RuntimeConfigParserTask> | ||
</Target> | ||
``` |
14 changes: 14 additions & 0 deletions
14
src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.props
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,14 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<JsonToItemsTaskFactoryTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\net6.0\JsonToItemsTaskFactory.dll</JsonToItemsTaskFactoryTasksAssemblyPath> | ||
<JsonToItemsTaskFactoryTasksAssemblyPath Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\net472\JsonToItemsTaskFactory.dll</JsonToItemsTaskFactoryTasksAssemblyPath> | ||
</PropertyGroup> | ||
<UsingTask TaskName="MonoRuntimeComponentManifestReadTask" TaskFactory="JsonToItemsTaskFactory.JsonToItemsTaskFactory" AssemblyFile="$(JsonToItemsTaskFactoryTasksAssemblyPath)"> | ||
<ParameterGroup> | ||
<_MonoRuntimeComponentSharedLibExt ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="false" Output="true" /> | ||
<_MonoRuntimeComponentStaticLibExt ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="false" Output="true" /> | ||
<_MonoRuntimeComponentLinking ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="false" Output="true" /> | ||
<_MonoRuntimeAvailableComponents ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="false" Output="true" /> | ||
</ParameterGroup> | ||
</UsingTask> | ||
</Project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this doc, could you include some example
.xml
snippets of what the new<ItemGroup>
's come out to be?