Add support for Android projects with new DSL i.e. built-in Kotlin#1016
Conversation
7e5ec73 to
9fd1946
Compare
JLLeitschuh
left a comment
There was a problem hiding this comment.
This looks fine to me, but I really want feedback from @wakingrufus
|
Sorry this has taken us so long to look at. I've been rather unplugged the past few weeks with the holidays. We appreciate the contribution! |
|
Ah, first failure, this PR is going to need to have a CHANGELOG.md file addition in order to be accepted. |
|
No worries at all! I hope you had a relaxing time over the holidays. 😊 I added a changelog entry as requested. |
|
I had a suggestion in the linked issue about using plugin Id which I think we should do |
36d9419 to
b9ee86c
Compare
|
In b9ee86c, I updated the integration test to the stable release of AGP 9.0.0 and refactored the reflective access slightly. It seems that the |
|
@mannodermaus You can try with Kotlin 1.7.20, it should have the Althought I'm not sure why this plugin used this very low Kotlin version. |
The project uses 2.2.21. we target a lower API for backwards compatibility |
| minimumJava = 11, | ||
| maximumJava = 17 | ||
| ), | ||
| AGP_9_0( |
There was a problem hiding this comment.
I think this case should be for AGP 8.8.0, then TestVersions.maxAgpVersion should be changed to 9.0.0
with this change, I think this PR is ready to merge. thanks for doing this work!
we can increase the baseline kotlin version with the next major version update |
Made the corresponding changes in 36735e9! |
|
Hey guys ✌️ I just updated our code using AGP 9, checked out @mannodermaus branch, pushed to maven local and tested it against our code. With the current version, it reports But using From my side this is good to go. |
|
@wakingrufus can we also do a release ? 🫣 😁 |
Yeah I'll try to get to this tomorrow |
…LLeitschuh#1016) * Add support for Android projects with new DSL i.e. built-in Kotlin * Add tests for AGP 9.0 with built-in Kotlin * Add changelog entry * Update test to AGP 9.0.0 stable & tidy up lookup in the plugin * Add todo & change Android plugin tests around
|
Kindly ask you to publish a new release with this fix 🙏 |
|
Yes. Sorry for the delay, I am working on some other possible inclusions for this release. It will come soon |
|
What is the current status of the new release? |


Android Gradle Plugin 9.0 introduces support for Android projects using "built-in Kotlin" (reference), a new way of integration between the AGP and Kotlin. The current Ktlint Gradle plugin doesn't recognize projects with this setup, because these projects don't rely on the
org.jetbrains.kotlin.androidplugin. Instead, a common way to approach this is to hook into the pairing of thecom.android.baseandKotlinBaseApiplugins (here is an example).Resolves #1008.