Skip to content

Conversation

jtschuster
Copy link
Member

Run System.Globalization.Tests, System.Security.Cryptography.Tests.csproj, and System.Runtime.InteropServices.Tests on Android with NativeAOT.

Add shared msbuild logic for running NativeAOT on Android.

- Don't use BundleDir for android bundle dir: This is PublishDir when TestSingleFile=true (which it is). Android deletes this dir before packaging, deleting the files that were just published.

- Don't add the singleFileTestRunner.cs when the test sets IsFunctionalTest=true

- Don't run regular nativeaot smoke tests on android yet.

- Enable android tests to publish as libs when TestSingleFile=true (default when TestNativeAOT=true)
Copy link
Contributor

@Copilot Copilot AI left a 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 adds NativeAOT support for running System.Globalization.Tests, System.Security.Cryptography.Tests, and System.Runtime.InteropServices.Tests on Android, along with shared MSBuild logic for NativeAOT Android builds.

Key changes include:

  • Enhanced monodroid-nativeaot.cs template to support command-line arguments and selective test execution
  • Modified build infrastructure to properly handle NativeAOT Android test scenarios
  • Added platform-specific test exclusions for unsupported algorithms on Android

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/tasks/AndroidAppBuilder/Templates/monodroid-nativeaot.cs Enhanced to support command-line arguments, JNI array operations, and conditional test execution
src/tests/FunctionalTests/Android/Device_Emulator/NativeAOT/Program.cs Updated Main method signature to accept command-line arguments
src/tests/FunctionalTests/Android/Device_Emulator/JIT/Program.cs Updated Main method signature to accept command-line arguments
src/libraries/tests.proj Added three new test projects to NativeAOT Android smoke tests
eng/testing/tests.android.targets Added NativeAOT-specific build configuration and compile includes
src/libraries/System.Security.Cryptography/tests/X509Certificates/TestFiles.cs Modified test data path resolution to support Android asset directory
Multiple cryptography test files Added Android platform exclusions for unsupported algorithms
Build configuration files Updated MSBuild properties and dependencies for NativeAOT Android builds

@jtschuster
Copy link
Member Author

/azp run runtime-android

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infra changes lgtm!

@jtschuster
Copy link
Member Author

/azp run runtime-android

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jtschuster
Copy link
Member Author

/azp run runtime-android

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jtschuster
Copy link
Member Author

/azp run runtime-android

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jtschuster
Copy link
Member Author

/azp run runtime-android

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jtschuster jtschuster merged commit d3f0cca into dotnet:main Sep 5, 2025
162 of 166 checks passed
@github-project-automation github-project-automation bot moved this to Done in AppModel Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants