-
Notifications
You must be signed in to change notification settings - Fork 528
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
[One .NET] *.runtimeconfig.json support #6009
Conversation
f8d38a9
to
7eb8e6e
Compare
WIP, I implemented the MSBuild side partially.
7eb8e6e
to
69eabe6
Compare
69eabe6
to
ea815d7
Compare
@@ -150,27 +151,32 @@ static ApplicationConfig ReadApplicationConfig (string envFile) | |||
ret.jni_add_native_method_registration_attribute_present = ConvertFieldToBool ("jni_add_native_method_registration_attribute_present", envFile, i, field [1]); | |||
break; | |||
|
|||
case 7: // bound_stream_io_exception_type: byte / .byte | |||
case 7: |
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:
- Elsewhere, there's a comment on the
case
line saying what field it's for. It's missing here. Should there be a comment? - Why insert as "field [Xamarin.Android.Build.Tasks] Added missing files from commit 59ec488b #7" instead of appending as "field [README] Expand the Build Requirements section. #12"?
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
Values are always strings
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Commit message: Context: https://github.com/dotnet/runtime/blob/d95bfea59ed7d19e9b1db096c9d332005989296b/docs/design/mono/mobile-runtimeconfig-json.md
.NET allows including a [`runtimeconfig.json`][0] file in an
application, which can be used to control runtime configuration
options, provide "backing data" to [`AppContext.GetData()`][1],
control configuration values, and more.
Update the Xamarin.Android-for-.NET 6 build process to call the new
[`<RuntimeConfigParser/>` task][2], which will process the
`runtimeconfig.json` files into an efficient binary blob, which will
be added to the `.apk` as `assemblies/rc.bin`.
During process startup, `assemblies/rc.bin` will be proved to
`monovm_runtimeconfig_initialize()`, which will parse `rc.bin`.
Certain `runtimeconfig.json` properties are *reserved*: if they're
specified within `runtimeconfig.json`, then the
`<RuntimeConfigParser/>` task will throw an `ArgumentException`, and
the build will fail. The reserved properties are controlled by the
`@(_RuntimeConfigReservedProperties)` item group, and are reserved
because the Xamarin.Android runtime needs to control the value of
these properties for proper app execution, e.g. `PINVOKE_OVERRIDE`
(cf84e1b9, 0cd890bd).
Co-authored-by: Marek Habersack <[email protected]>
[0]: https://docs.microsoft.com/en-us/dotnet/core/run-time-config/#runtimeconfigjson
[1]: https://docs.microsoft.com/en-us/dotnet/api/system.appcontext.getdata?view=net-5.0
[2]: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/src/tasks/RuntimeConfigParser/RuntimeConfigParser.cs |
Context: https://github.com/dotnet/runtime/blob/d95bfea59ed7d19e9b1db096c9d332005989296b/docs/design/mono/mobile-runtimeconfig-json.md .NET allows including a [`runtimeconfig.json`][0] file in an application, which can be used to control runtime configuration options, provide "backing data" to [`AppContext.GetData()`][1], control configuration values, and more. Update the Xamarin.Android-for-.NET 6 build process to call the new [`<RuntimeConfigParser/>` task][2], which will process the `runtimeconfig.json` files into an efficient binary blob, which will be added to the `.apk` as `assemblies/rc.bin`. During process startup, `assemblies/rc.bin` will be proved to `monovm_runtimeconfig_initialize()`, which will parse `rc.bin`. Certain `runtimeconfig.json` properties are *reserved*: if they're specified within `runtimeconfig.json`, then the `<RuntimeConfigParser/>` task will throw an `ArgumentException`, and the build will fail. The reserved properties are controlled by the `@(_RuntimeConfigReservedProperties)` item group, and are reserved because the Xamarin.Android runtime needs to control the value of these properties for proper app execution, e.g. `PINVOKE_OVERRIDE` (cf84e1b, 0cd890b). Co-authored-by: Marek Habersack <[email protected]> [0]: https://docs.microsoft.com/en-us/dotnet/core/run-time-config/#runtimeconfigjson [1]: https://docs.microsoft.com/en-us/dotnet/api/system.appcontext.getdata?view=net-5.0 [2]: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/src/tasks/RuntimeConfigParser/RuntimeConfigParser.cs
WIP, I implemented the MSBuild side partially.