-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Android] InvariantGlobalization support for CoreCLR Android builds #117542
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
base: main
Are you sure you want to change the base?
Conversation
…ng env variables is sufficient
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.
Pull Request Overview
This PR enables passing the InvariantGlobalization
MSBuild property through the Android build pipeline so that Android apps can opt into invariant globalization mode at runtime.
- Forwards the
InvariantGlobalization
property in test builds, Android build targets, and app tasks - Exposes a new
InvariantGlobalization
property onAndroidAppBuilderTask
and propagates it intoApkBuilder
- Removes the exclusion of the invariant globalization tests so they run against Android CoreCLR
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/tests/build.proj | Adds InvariantGlobalization to the test project invocation parameters |
src/tasks/AndroidAppBuilder/ApkBuilder.cs | Injects DOTNET_SYSTEM_GLOBALIZATION_INVARIANT when InvariantGlobalization is true |
src/tasks/AndroidAppBuilder/AndroidAppBuilder.cs | Declares InvariantGlobalization on the task and forwards it to ApkBuilder |
src/mono/msbuild/android/build/AndroidBuild.targets | Passes the MSBuild InvariantGlobalization property to the Android build targets |
src/libraries/tests.proj | Removes the exclusion for the invariant globalization tests |
Comments suppressed due to low confidence (2)
src/tasks/AndroidAppBuilder/AndroidAppBuilder.cs:149
- There are no tests verifying that
InvariantGlobalization
flows through the task to the APK and sets the correct environment variable. Consider adding a unit or integration test to validate this behavior.
apkBuilder.InvariantGlobalization = InvariantGlobalization;
src/tasks/AndroidAppBuilder/ApkBuilder.cs:427
- The
InvariantGlobalization
property is referenced here but theApkBuilder
class does not define it. Add apublic bool InvariantGlobalization { get; set; }
property toApkBuilder
to ensure this compiles.
if (InvariantGlobalization)
@dotnet-policy-service agree company="Microsoft" |
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger |
/// <summary> | ||
/// Indicates whether we want to use invariant globalization mode. | ||
/// </summary> | ||
public bool InvariantGlobalization { get; set; } |
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.
Just curious - why not pass this through EnvironmentVariables
?
Personally, I probably like this solution a little better, but I don't have many arguments either way.
Description
Forward the
InvariantGlobalization
MSBuild property to the CoreCLR runtime for Android applications by connecting the existing infrastructure.Related issues
Issue #117270