Skip to content

Migrate to Gradle Version Catalog (libs.versions.toml) - #214

Open
dipenpradhan wants to merge 16 commits into
Gurupreet:masterfrom
dipenpradhan:issue-189-version-catalog
Open

Migrate to Gradle Version Catalog (libs.versions.toml)#214
dipenpradhan wants to merge 16 commits into
Gurupreet:masterfrom
dipenpradhan:issue-189-version-catalog

Conversation

@dipenpradhan

@dipenpradhan dipenpradhan commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

📚 Stacked PR — 13 of 18

Depends on #213 · Blocks #219

This PR's own diff (1 commit)

The diff shown below by GitHub also includes the ancestor commits, because
every PR in this stack targets master (base branches can only point at
branches that exist in this repository). Use the compare link above to review
just this PR's real change. Merge order is documented in the stack.

Summary

Migrates dependency management from the custom buildSrc constants to a Gradle Version Catalog (gradle/libs.versions.toml), as proposed in #189.

  • gradle/libs.versions.toml is now the single source of truth: every version, library and plugin previously declared in Versions.kt / Dependencies.kt (and the inline Wear OS deps in the cryptoapp demo) lives in [versions] / [libraries] / [plugins]
  • [bundles] mirror the old grouped helpersaddComposeOfficialDependencies()implementation(libs.bundles.compose.official), etc., so module build files keep the same level of abstraction with full IDE auto-complete
  • All ~33 module build.gradle.kts files migrated to libs.* accessors
  • Root build.gradle.kts switched from buildscript { classpath(...) } to the plugins {} DSL with alias(libs.plugins.*) apply false
  • buildSrc gets a settings.gradle.kts that imports the same catalog, so its plugin dependencies (AGP, Kotlin, KSP, serialization, Compose compiler) reference identical versions
  • Deleted: Versions.kt, Dependencies.kt, GroupedDependencies.kt, DependencyHandlerExtensions.kt
  • Kept: the two convention plugins and ProjectConfigs.kt (SDK levels/app id), per the issue

This also unlocks Dependabot/Renovate support, which the upcoming security-automation issue can build on.

Closes #189

Verification

  • ./gradlew ktfmtCheck assembleDebug testDebugUnitTest passes locally (JDK 17, SDK 35) — dependency resolution is byte-identical (same coordinates, same versions)
  • CI ./gradlew build on this PR

cc @Gurupreet for review

- Replace compose/material3 version constants with composeBom
- Strip explicit versions from BOM-managed artifacts
- Import the BOM platform on every configuration that receives
  Compose artifacts (implementation, debugImplementation,
  androidTestImplementation, :data)
- Migrate API removals that come with Compose 1.7 / Material3 1.3:
  SmallTopAppBar -> TopAppBar, rememberRipple -> material3 ripple
- Update the outdated README Compose badge to the BOM version

Fixes Gurupreet#186
All lifecycle artifacts (viewmodel-compose, viewmodel-ktx,
livedata-ktx, runtime-ktx, viewmodel-savedstate) move together
via the shared androidLifecycleGrouped version.

Fixes Gurupreet#192
- navCompose 2.7.7 -> 2.8.9; add kotlinx-serialization-json 1.8.0
- Apply the Kotlin serialization plugin in gmail and tiktok demos
- Gmail: string routes -> @serializable route objects
- TikTok: TikTokScreen becomes a serializable sealed interface;
  the profile route carries a typed userId argument read via
  toRoute(), bottom bar selection uses NavDestination.hasRoute

Fixes Gurupreet#193
- Replace com.google.android.exoplayer:exoplayer with
  androidx.media3:media3-exoplayer and media3-ui
- Rewrite TikTokPlayer against the Media3 API (SimpleExoPlayer was
  removed; default media source factory handles asset URIs)
- Removes the last Jetifier warning produced by ExoPlayer 2.x

Fixes Gurupreet#183
- Move to the io.coil-kt.coil3 artifact group
- Add coil-network-okhttp (network fetching is a separate artifact
  in Coil 3, self-registered via ServiceLoader)
- Migrate call sites: rememberImagePainter(data=) ->
  rememberAsyncImagePainter(model=), coil.* -> coil3.* imports

Fixes Gurupreet#191
PullRefreshList was a fully commented-out stub (TODO revisit pull
refresh). It now demonstrates the first-party PullToRefreshBox with
a simulated 1.5s reload that prepends an item to the list.

Fixes Gurupreet#187
Covers the new composables added here so the feature ships with its own
verification rather than relying on a later change in the stack.
@dipenpradhan
dipenpradhan force-pushed the issue-189-version-catalog branch from c803c79 to 2da38d2 Compare September 8, 2026 08:47
The Swipeable Lists tab rendered SwipeToDismissBox items but swipes
never removed anything. Now:
- swipe left deletes (red background), swipe right archives
- items are actually removed from the keyed LazyColumn
- an Undo snackbar restores the item at its original position
- positionalThreshold set to half the item width

Fixes Gurupreet#188
Adds UI tests for the composables introduced here so the feature ships with
its own verification.

The undo test surfaced a real defect: tapping Undo re-added the album to the
backing list, but LazyColumn keeps the first visible item anchored, so a row
re-inserted above it silently landed off-screen and the user saw nothing
happen. The list now holds a LazyListState and scrolls the restored row back
into view.
- NavigationSuiteScaffold switches bottom bar / rail / drawer by
  window size class
- ListDetailPaneScaffold gives single-pane on phones, two-pane on
  tablets and foldables, with predictive-back-aware pane navigation
- Favorites/Profile destinations display the live window size classes
- All adaptive artifacts are version-managed by the Compose BOM

Fixes Gurupreet#190
Covers the new composables added here so the feature ships with its own
verification rather than relying on a later change in the stack.
InfiniteCarousel builds on foundation's HorizontalPager with a large
virtual page count starting in the middle, so it loops endlessly in
both directions. Auto-advances every 3s and pauses while dragging.
Showcased at the top of the Carousel demo screen.

Fixes Gurupreet#13
Adds InfiniteCarouselTest so the carousel ships with its own verification
instead of relying on a later change in the stack. The convention plugin now
sets testInstrumentationRunner so library modules can host androidTests.

Swipe gestures target the root rather than the Text node inside a page: a
gesture is dispatched over the bounds of the node it is performed on, and a
Text node is far too narrow to cross the pager's paging threshold.
- InterestTagTest: text, click action, onClick callback
- LoginScreenTest: fields, button, text input

The carousel's test ships alongside the carousel itself, so this change covers
the components that already existed without any test coverage.

Refs Gurupreet#68
- gradle/libs.versions.toml is the single source of truth for all
  versions, libraries and plugins; bundles mirror the old grouped
  dependency helpers
- All module build files use libs.* accessors
- Root build script uses the plugins DSL (ktfmt via alias); AGP,
  Kotlin, KSP and serialization reach the classpath via buildSrc,
  whose own dependencies are catalog-driven through a new
  buildSrc/settings.gradle.kts
- Delete Versions.kt, Dependencies.kt, GroupedDependencies.kt and
  DependencyHandlerExtensions.kt; keep convention plugins and
  ProjectConfigs.kt

Fixes Gurupreet#189
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.

Enhancement: Migrate to Gradle Version Catalog (libs.versions.toml)

2 participants