Skip to content

Android koin example - #6833

Merged
lihaoyi merged 9 commits into
com-lihaoyi:mainfrom
ABeesettiPaleBlue:android-koin-example
Feb 19, 2026
Merged

lihaoyi merged 9 commits into
com-lihaoyi:mainfrom
ABeesettiPaleBlue:android-koin-example

Conversation

@ABeesettiPaleBlue

@ABeesettiPaleBlue ABeesettiPaleBlue commented Feb 16, 2026 •

Copy link
Copy Markdown
Contributor

Added koin/examples/androidx-samples to thirdparty examples (Closes #6652)

image

@vaslabs

vaslabs commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Thanks @ABeesettiPaleBlue . Keep in mind that once it works, the example should go to third party, you can find examples here and here

@ABeesettiPaleBlue
ABeesettiPaleBlue marked this pull request as ready for review February 17, 2026 05:55
@vaslabs

vaslabs commented Feb 17, 2026 •

Copy link
Copy Markdown
Contributor

Yes the roboelectric thing is an open issue, hopefully we should resolve it soon.

@souvlakias can you test/review this? Also there's a formatting issue

@ABeesettiPaleBlue to check the formatting and auto fix locally you can use

./mill __.fix + mill.javalib.palantirformat.PalantirFormatModule/ + mill.scalalib.scalafmt.ScalafmtModule/ + mill.kotlinlib.ktlint.KtlintModule/

Co-authored-by: Vasilis Nicolaou <vasilis.nicolaou@vaslabs.io>
@vaslabs

vaslabs commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

@souvlakias just fixed the robolectric stuff, so let's wait a bit and we can update this PR before merging

@souvlakias

Copy link
Copy Markdown
Contributor

Regarding the roboelectric tests, after #6841 gets merged, the androidIncludeAndroidResources property in the test object needs to be set to true and they should work

lihaoyi pushed a commit that referenced this pull request Feb 18, 2026
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)](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/UnitTestOptions#getIsIncludeAndroidResources()).

This also makes roboelectric unit tests work (Ref:
[jetcaster.wear](https://github.com/vaslabs-ltd/compose-samples-with-mill/blob/main/Jetcaster/package.mill#L442)
and the [koin example](#6833))
@ABeesettiPaleBlue

Copy link
Copy Markdown
Contributor Author

@souvlakias, I've set the property androidIncludeAndroidResources to true and still the roboelectric tests are failing with the same error message as before

@vaslabs

vaslabs commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@souvlakias, I've set the property androidIncludeAndroidResources to true and still the roboelectric tests are failing with the same error message as before

Can you push the change in the build.mill so we can reproduce

@vaslabs

vaslabs commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

works for me

image

maybe check if you have rebuilt , I do ./mill dist.installLocal and I have an alias

alias mill='~/mill/mill-proguard.jar'

to test changes

@vaslabs

vaslabs commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

let's merge it and we can follow up with another PR for the pipeline setup

cc: @souvlakias @lihaoyi

@ABeesettiPaleBlue

Copy link
Copy Markdown
Contributor Author

alias mill='~/mill/mill-proguard.jar'

I forgot to rebuild, It's working now after the rebuild

@vaslabs

vaslabs commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@ABeesettiPaleBlue feel free to give feedback and ideas in the discussions here , we are interested to see your point of view

@vaslabs

vaslabs commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

To test the example you can run

./mill example.thirdparty.koin-androidx-samples

@vaslabs vaslabs left a comment

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.

Some minor changes to get it ready after robolectric fix

@ABeesettiPaleBlue

Copy link
Copy Markdown
Contributor Author

To test the example you can run

./mill example.thirdparty.koin-androidx-samples

I thought the comments are to let the users know how to run the example app, but they double as a test too. Pretty cool.

@lihaoyi
lihaoyi merged commit 5472f5a into com-lihaoyi:main Feb 19, 2026
35 checks passed
@lefou lefou added this to the 1.1.3 milestone Feb 19, 2026
lihaoyi pushed a commit that referenced this pull request Feb 25, 2026
### Motivation
- Document the support of Robolectric tests
- Have them in CI

### Adds
- The Koin example (#6833) (only it's Robolectric unit tests) to the CI
- A relevant doc page
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: Koin example for dependency injection

5 participants