-
Notifications
You must be signed in to change notification settings - Fork 555
[One .NET] *.runtimeconfig.json support #6009
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9104fe7
[One .NET] *.runtimeconfig.json support
jonathanpeppers ff92920
Add @(_RuntimeConfigReservedProperties)
jonathanpeppers ea815d7
[WIP] Include blob in apk and load it on runtime
grendello ab244d5
Add runtime tests for AppContext
jonathanpeppers b60dace
Update AppContextTests.cs
jonathanpeppers 7ee681d
Include assemblies/rc.bin in App Bundles
jonathanpeppers ae31212
Add comment for have_runtime_config_blob
jonpryor 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 hidden or 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 hidden or 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
56 changes: 56 additions & 0 deletions
56
...oid.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.RuntimeConfig.targets
This file contains hidden or 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,56 @@ | ||
<!-- | ||
*********************************************************************************************** | ||
Microsoft.Android.Sdk.RuntimeConfig.targets | ||
|
||
MSBuild logic related to *.runtimeconfig.json files. | ||
|
||
See: https://github.com/dotnet/runtime/blob/b13715b6984889a709ba29ea8a1961db469f8805/src/mono/nuget/Microsoft.NET.Runtime.RuntimeConfigParser.Task/README.md | ||
|
||
*********************************************************************************************** | ||
--> | ||
<Project> | ||
|
||
<Import Sdk="Microsoft.NET.Runtime.RuntimeConfigParser.Task" Project="Sdk.props" /> | ||
|
||
<PropertyGroup> | ||
<!-- HACK: workaround https://github.com/dotnet/runtime/issues/53811 --> | ||
<RuntimeConfigParserTasksAssemblyPath>$([System.IO.Path]::GetDirectoryName($(RuntimeConfigParserTasksAssemblyPath)))/net6.0/$([System.IO.Path]::GetFileName($(RuntimeConfigParserTasksAssemblyPath)))</RuntimeConfigParserTasksAssemblyPath> | ||
<_BinaryRuntimeConfigPath>$(IntermediateOutputPath)$(ProjectRuntimeConfigFileName).bin</_BinaryRuntimeConfigPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<!-- | ||
See: https://docs.microsoft.com/en-us/dotnet/core/tutorials/netcore-hosting#step-3-%2D-prepare-runtime-properties | ||
These properties shouldn't be used in Xamarin.Android apps as there are no directories the runtime can search, | ||
everything related to assemblies or shared libraries must go through the Xamarin.Android native runtime. | ||
--> | ||
<_RuntimeConfigReservedProperties Include="TRUSTED_PLATFORM_ASSEMBLIES"/> | ||
<_RuntimeConfigReservedProperties Include="APP_PATHS"/> | ||
<_RuntimeConfigReservedProperties Include="APP_NI_PATHS"/> | ||
<_RuntimeConfigReservedProperties Include="NATIVE_DLL_SEARCH_DIRECTORIES"/> | ||
<_RuntimeConfigReservedProperties Include="PLATFORM_RESOURCE_ROOTS"/> | ||
<_RuntimeConfigReservedProperties Include="PINVOKE_OVERRIDE"/> | ||
</ItemGroup> | ||
|
||
<!-- | ||
TODO: | ||
* $(_BinaryRuntimeConfigPath) is in the root of $(IntermediateOutputPath). | ||
I did not add this to the .apk yet. | ||
--> | ||
|
||
<Target Name="_ParseRuntimeConfigFiles" | ||
AfterTargets="GenerateBuildRuntimeConfigurationFiles" | ||
Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true' " | ||
Inputs="$(ProjectRuntimeConfigFilePath)" | ||
Outputs="$(_BinaryRuntimeConfigPath)"> | ||
<RuntimeConfigParserTask | ||
RuntimeConfigFile="$(ProjectRuntimeConfigFilePath)" | ||
OutputFile="$(_BinaryRuntimeConfigPath)" | ||
RuntimeConfigReservedProperties="@(_RuntimeConfigReservedProperties)" | ||
/> | ||
<ItemGroup> | ||
<FileWrites Include="$(_BinaryRuntimeConfigPath)" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
</Project> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
Two questions:
case
line saying what field it's for. It's missing here. Should there be a comment?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.
Why insert as "field #7"? So that all the
bool
fields are together in e.g. https://github.com/xamarin/xamarin-android/pull/6009/files#diff-920537864b4d4fbcacfad5ebfdcfd73470855176b83f4c4592d604a7057b7d3dR108