build: AGP 8.13.2 + R8 9.1.43, and drop Gradle syntax deprecated for 9.0/10.0 - #2050
Conversation
- Assign DSL properties with `prop = value` instead of the Groovy space-assignment form (namespace, ndkVersion, cmake version/path, signingConfig, description, standardOutput/errorOutput, ignoreExitValue). - Replace the gradle.useLogger() failure logger with a BuildService listening for task completion events; it prints the same styled failure summary at the end of the build and still skips failures of BuildToolTask tasks, which log their own errors. - Run the SBG AST test builds with `-p` instead of `-b`: the static-binding-generator settings.gradle now selects runtests.gradle as its build file, and runtests.gradle uses mainClass instead of main.
The Kotlin version moved to 2.4.10 while AGP stayed on 8.12.1, whose bundled R8 (8.12.14) predates Kotlin 2.4 metadata. Every dex step then logs "An error occurred when parsing kotlin metadata" once per Kotlin stdlib class, about a thousand lines per build. Kotlin 2.4 needs R8 9.1.29 or newer, which no 8.x AGP bundles, so R8 is pinned on the buildscript classpath the way the AGP/Kotlin compatibility docs describe, and AGP moves to the last 8.x release. Both are overridable per project like the existing versions.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (10)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThis PR updates Gradle build configuration for compatibility with newer tooling. It adds explicit R8 setup, makes the static-binding-generator tests run as a standalone Gradle project, replaces custom task failure logging with a build service, fixes one task output assignment, and normalizes several Gradle property assignments. ChangesGradle compatibility and tooling
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The tooling updates have no established remaining compatibility or build-failure-reporting issue, so no actionable merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (9 skipped: 9 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Rabbit boots the build at dawn, Comment |
Kotlin-metadata warnings from D8
Every CI build logs ~1000 lines of
during
mergeExtDexDebug. f36b01c moved Kotlin to 2.4.10 while AGP stayed on 8.12.1, whose bundled R8 (8.12.14) predates Kotlin 2.4 metadata. Per Google's AGP/D8/R8 requirements for Kotlin, Kotlin 2.4 needs R8 9.1.29+, and no 8.x AGP bundles that (8.13.2 ships 8.13.19, which only knows 2.3). AGP 9.x would, but it requires Gradle 9.6, built-in Kotlin and the removal of the legacy variant API, which the shippedapp/build.gradleand NativeScript plugins rely on; that is a separate migration.So this PR:
com.android.tools:r8:9.1.43on the buildscript classpath, the override mechanism the same doc describes.Both are
NS_DEFAULT_*properties ingradle.propertiesand overridable per project (-Pr8Version=..., like-PandroidBuildToolsVersion). Sincegradle.propertiesandbuild.gradleship in the npm package, every app build picks this up.Measured locally on
:app:mergeExtDexDebug --rerun-tasks:Gradle deprecation notices
CI on Gradle 8.14.3 reports three kinds of deprecation; all are fixed so
--warning-mode allis clean:namespace "x"→namespace = "x", removed in Gradle 10): the reported sites inruntime/build.gradle,app/build.gradle,BuildToolTask.gradle, plus the same pattern atignoreExitValue, the rootbuild.gradletask description, andmain→mainClasson the SBGJavaExec.Gradle.useLogger(removed in 9.0):CustomExecutionLogger.gradleis now aBuildServiceimplementingOperationCompletionListener. It recordsTaskFailureResults and prints the same styled failure summary fromclose(), still skippingBuildToolTaskfailures (those log their own errors).StyledTextOutputFactorycannot be injected into a build service, so the script hands the output over intaskGraph.whenReady; that makes it not configuration-cache compatible, which it wasn't before either.-b <file>custom build file (removed in 9.0): the jsparser spec now runsgradlew -p static-binding-generator, whosesettings.gradlesetsrootProject.buildFileName = 'runtests.gradle'. That settings file is only read for standalone runs; as a test-app subproject nothing changes.Verified:
./gradlew :app:help :runtime:help --warning-mode allgoes from 10 deprecation lines to 0 (the one remaining warning is KGP saying Gradle 8.14.3 itself is deprecated),runSbgTestspasses 8/8, and a forced task failure prints the styled summary exactly once.Not in this PR
Deprecations that only fire on code paths CI's
help-style runs don't exercise, left for a follow-up since they needExecOperations/design choices:Task.projectat execution time incleanupAllJars(app/build.gradle:641, error in Gradle 10).project.exec {}insidedoFirst/doLast(runtime/build.gradle:322,328, rootbuild.gradle:75; removed in Gradle 9).build.gradle'srunTestsstill invokes-b runtests.gradleintest-app/, which has its own settings, so thebuildFileNametrick doesn't apply there.Summary by CodeRabbit
Chores
Bug Fixes