Skip to content

Android: Generate test_config.properties - #6841

Merged
lihaoyi merged 3 commits into
com-lihaoyi:mainfrom
vaslabs-ltd:android-roboelectric-tests
Feb 18, 2026
Merged

lihaoyi merged 3 commits into
com-lihaoyi:mainfrom
vaslabs-ltd:android-roboelectric-tests

Conversation

@souvlakias

@souvlakias souvlakias commented Feb 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #6620

This adds to the support for the isIncludeAndroidResources that was introduced in #6638, by generating the com/android/tools/test_config.properties file as described here (agp docs).

This also makes roboelectric unit tests work (Ref: jetcaster.wear and the koin example)

* [[https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/UnitTestOptions#getIsIncludeAndroidResources()]]
*/
def androidGeneratedTestConfigSources: T[Seq[PathRef]] = Task {
val properties: Map[String, String] = Map(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we can make this into a separate task so we have more flexibility debugging/fixing issues in the future and allow for easier workarounds

@vaslabs

vaslabs commented Feb 17, 2026 •

Copy link
Copy Markdown
Contributor

does it also fix the tests in #6833 ? (maybe need to add include android resources as true there too)

ah yeah it does, you mentioned it, sorry

I thought it might have issues with mocked default values but maybe it's not hitting it

@vaslabs

vaslabs commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

amazing work, nice one @souvlakias

@souvlakias souvlakias mentioned this pull request Feb 17, 2026
@souvlakias
souvlakias marked this pull request as ready for review February 17, 2026 14:09
@lihaoyi
lihaoyi merged commit c0c22ba into com-lihaoyi:main Feb 18, 2026
45 checks passed
@lefou lefou added this to the 1.1.3 milestone Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: Support Robolectric unit tests

4 participants