update-gradle-dependency
Version-catalog procedure for adding or upgrading Gradle dependencies and plugins, plus the webmap (pnpm) dependency path, in femto-car-launcher. This skill is the dependency-update procedure SSOT; th
SKILL.md.claude/skills/update-gradle-dependency/SKILL.md
GitHubUpdating a Gradle dependency
Rules: see .claude/rules/dependencies.md.
Procedure
Decide the shape of the change.
- New library — add to
[versions],[libraries], then reference vialibs.<alias>inapp/build.gradle.kts. - Version bump — edit the
[versions]entry only. - New plugin — add to
[versions],[plugins], then apply viaalias(libs.plugins.<alias>)in the relevantbuild.gradle.kts.
- New library — add to
Edit
gradle/libs.versions.tomlin this order:[versions]: alphabetical by key, lowercase camelCase.[libraries]: hyphenated keys (androidx-core-ktx).[plugins]: hyphenated keys, version refs.
Reference from
app/build.gradle.ktsusing the alias:implementation(libs.androidx.compose.material3)Hyphens in the catalog key become dots on the alias side.
Sanity-check what resolved:
./gradlew app:dependencies --configuration debugRuntimeClasspath \ | grep -iE 'kotlin-stdlib|<your-artifact>' | headVerify with the
verify-android-buildskill.Document in the commit body when:
- Bumping a major version of any library.
- Overriding a Compose BOM-managed artifact.
- Adding an annotation processor / KSP plugin.
- Bumping Kotlin (must include the matching Compose Compiler plugin bump).
Webmap (pnpm) dependencies
Renovate automerges routine (non-major) webmap bumps — this path is
for manual or major bumps (maplibre-gl, Vite, TypeScript).
- Edit
webmap/package.json— or, for the Vite+ toolchain pins (vite,vite-plus), the catalog inwebmap/pnpm-workspace.yaml— then runpnpm installunderwebmap/to refreshpnpm-lock.yaml. - For Vite or
maplibre-glmajors, confirm Vite'sbuild.targetstays at the WebView floor defined inAGENTS.md#tech-stack. - For TypeScript majors, run
pnpm run checkunderwebmap/and treat compiler deprecation warnings as failures in the same bump. Never adopt a pre-stable compiler preview package (e.g. a native-compiler preview) as a build dependency. A TypeScript bump cannot move Vite'sbuild.target(Vite ignores the tsconfig target), so the WebView-floor check in step 2 stays scoped to Vite /maplibre-glbumps. Readiness criteria:.claude/rules/webmap.md. - Verify with
./gradlew assembleStableDebug— the:app:buildWebMaptask runs the pnpm build as part of it.
Bulk-updating to latest versions
For routine version maintenance across the whole catalog, the
project ships nl.littlerobots.version-catalog-update:
./gradlew versionCatalogUpdaterewritesgradle/libs.versions.tomlin place, resolving each entry to its latest stable version (the plugin's defaultversionSelector, so no separate reporter plugin is needed).
Workflow:
./gradlew versionCatalogUpdate # apply the update to libs.versions.toml
./gradlew spotlessApply # tidy formatting
./gradlew assembleStableDebug # verify
Review every diff before committing. Major-version bumps still
need the per-bump justification rule from
.claude/rules/dependencies.md. Two project-specific gotchas:
- Toolchain coupling. Bumping AGP can raise the required Gradle
version — check the AGP release notes for the minimum required
Gradle version before bumping, and update
gradle-wrapper.propertiesin the same change:./gradlew wrapper --gradle-version <v> --gradle-distribution-sha256-sum <sha> --distribution-type bin. Kotlin and thekotlin-compose/kotlin-serializationplugin aliases move in lock-step automatically (sharedversion.ref = "kotlin"in the catalog). - A
maplibre-glbump can silently break tile rendering with no automated signal. There is no automated tile-rendering test —pnpm run check(type-check + thewebmap/unit tests) only covers pure logic (camera math, style JSON), not what actually paints. After anymaplibre-glmajor bump, manually verify the map still renders real tiles, ideally on a physical device — theverify-on-emulatorskill's own "Known limitation" section explains why the emulator's GLES translator makes the emulator an unreliable check for this specific case.
Skill-specific anti-patterns
implementation("io.coil-kt:coil-compose:2.6.0")directly inapp/build.gradle.kts— go through the catalog.- Hardcoding a version inside
[libraries]instead of usingversion.ref. - Mixing the Compose BOM with explicit version pins on Compose artifacts without a justification line in the commit body.
- Adding a transitive dependency to silence a warning — investigate the root cause first.