build(deps): forward port to android gradle plugin 9#19423
Conversation
5284a4f to
cf5cc41
Compare
0aaf9b6 to
7f74098
Compare
51d2c22 to
9a164ee
Compare
ab7cb62 to
a13a4d3
Compare
13c2450 to
de08ab5
Compare
6d8f967 to
c2e0e7d
Compare
|
getting closer here, AGP9 is at rc02 now and likely to release soon --> https://mvnrepository.com/artifact/com.android.application/com.android.application.gradle.plugin kotlin 2.3.0 (a transitive dep for it) is already out I haven't looked to see which of my workarounds etc are still needed, but this is updated now |
a05c0e2 to
ae6a6a1
Compare
|
@david-allison this is a mix of "ready for review" in that I believe I have the commits all cleaned up and the fixes themselves are clean, and "blocked by dependency" because as far as I know we need kotlin 2.3.0 for AGP9, and we are blocking that pending the codeql fix since it appears to be scheduled to land in just a few weeks we could decide to let codeql fail for a while and merge kotlin 2.3.0, or we could continue to wait - it's a choice we make. I'm currently fine waiting for what it's worth, AGP9 and kotlin 2.3.0 don't add anything that we are really waiting for do they? And we're ready when codeql works. But if I'm wrong (maybe kotlin 2.3.0 adds something?) or if the codeql schedule slips, I'll change my mind to "land it now, accept the codeql break for a while" |
fd770c2 to
7d119ba
Compare
david-allison
left a comment
There was a problem hiding this comment.
Still LGTM. Leaving it to you, as there will be squashes
|
Assuming CI works (it's unsquashed for now until it's CI-clean):
Slightly re-ordered since dependency-updates went in first |
|
gah, now on android test working but not generating coverage, was afraid of that - hopefully easy |
|
The AGP9 migration is ready to go with the only remaining bit being that I have a hunch that it is because in the ...for example - and I believe we need to point jacoco report task to that 'built_in_kotlinc/play/compileKotlin/classes' directory but I was unsuccessful when I attempted it I saw some information online that indicated I may be able to get a handle on the Compile task and ask it for At this point I'm stumped. |
9bc9aac to
72d2e48
Compare
72d2e48 to
b8a4d23
Compare
|
What an epic. dependency-updates branch rebased-hard to main after merge of #20753 and pushed out so it's clean Pending CI |
This is a squash of a 13-commit series, full commits messages follow: ---- chore: AGP9 has kotlin built in, so applying it as plugin is redundant chore: AGP9 requires specific enable directive to use custom res values in defaultConfig the value defaulted to true previously, but with AGP9 the default changed to false with the change entry indicating that it should be enabled only for modules that definitely need it AnkiDroid module needs it to allow for parallel build app name changing with CLI flags https://developer.android.com/build/releases/agp-9-0-0-release-notes#android-gradle-plugin-behavior-changes lint: AGP9 flags up a few new warnings for nullability and types chore: AGP9 no longer allows -dontoptimize, forces use of optimize proguard also there was no consumer-rules.pro file for libanki, and that's an error now, remove the directive pointing to the non-existent file chore: AGP9 forward-port to newly non-parameterized CommonExtension gradle object style: delint build file spacing / some nullability differences all from IDE suggestion chore: AGP9 defers more configuration and debugPlayUnitTest is not available in all contexts instead of a more-or-less concrete reference to the task - which may not exist / be configured depending on the context, iterate over available tasks and do the configuration if the desired name exists build(deps): Android Gradle Plugin v9 pinned to v9.0.1 until upstream issue is resolved: https://issuetracker.google.com/issues/491718901 FAILURE: Build failed with an exception. * What went wrong: Circular dependency between the following tasks: :AnkiDroid:l8DexDesugarLibPlayRelease \--- :AnkiDroid:l8DexDesugarLibPlayReleaseAndroidTest \--- :AnkiDroid:minifyPlayReleaseAndroidTestWithR8 \--- :AnkiDroid:l8DexDesugarLibPlayRelease (*) (*) - details omitted (listed previously) build(deps): bump com.github.triplet.play from 3.13.0 to 4.0.0 Bumps com.github.triplet.play from 3.13.0 to 4.0.0. --- updated-dependencies: - dependency-name: com.github.triplet.play dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> build: disable android.newDsl until keeper plugin is AGP9-compatible build(deps): add version ref for kotlinx-coroutines-core dep chore: forward-port to new android library module build config style the configuration method lives on a different object now, otherwise is mostly same kotlin sub-blocks should be promoted outside though, so moved those chore: AGP9 w/built-in kotlin defaults JvmTarget to android.compileOptions.targetCompatibility we no longer need to specify kotlin compile options related to JvmTarget, as the built-in should handle that for us, chained to the android.compileOptions target, this is a bonus from a "don't repeaty yourself" perspective so we should take advantage https://developer.android.com/build/migrate-to-built-in-kotlin#migration-steps-migrate-kotlin-options > Note: With built-in Kotlin, you don't need to set kotlin.compilerOptions.jvmTarget because its value defaults to android.compileOptions.targetCompatibility. chore: AGP9 fix emulator test class file location
AGP9 changes all sorts of stuff, but it's mostly easy
The only thing truly difficult (IMNSHO) is that someone (could be us...) needs to provide a stable forever home for the "Keeper" plugin which allows us to test minified builds - it has an AGP9 forward-port PR but that will likely never be published in current repo - until we solve or workaround that (with a local maven repo and vendored build?) we cannot enable
newDsl, currently we have to disable it for compatibility reasons with that plugin