Skip to content

Migrate dependency management to Gradle Version Catalog (libs.versions.toml)#194

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/enhancement-migrate-to-gradle-version-catalog
Draft

Migrate dependency management to Gradle Version Catalog (libs.versions.toml)#194
Copilot wants to merge 2 commits into
masterfrom
copilot/enhancement-migrate-to-gradle-version-catalog

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 10, 2026

Replaces the bespoke buildSrc dependency constants (Versions.kt, Dependencies.kt, GroupedDependencies.kt, DependencyHandlerExtensions.kt) with a standard Gradle Version Catalog, enabling IDE auto-complete, Renovate/Dependabot version bump support, and a single canonical source for all dependency coordinates.

What changed

  • New: gradle/libs.versions.toml — all versions, library GAVs, bundles (grouped deps), and plugin IDs in one TOML file
  • Deleted: Versions.kt, Dependencies.kt, GroupedDependencies.kt, DependencyHandlerExtensions.kt from buildSrc
  • Updated: buildSrc/.../ProjectConfigs.kt — removed Versions import; SDK/compiler versions now inlined as constants (they are build config, not dependency versions)
  • Updated: app/build.gradle.kts + all 31 module build.gradle.kts files — replaced helper function calls with libs.* / libs.bundles.* accessors
  • Updated: settings.gradle.kts — added enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

Before / After

// Before
import com.guru.composecookbook.build.dependencies.addComposeOfficialDependencies
import com.guru.composecookbook.build.dependencies.addNetworkingDependencies

dependencies {
    addComposeOfficialDependencies()
    addNetworkingDependencies()
}

// After
dependencies {
    implementation(libs.bundles.compose.official)
    implementation(libs.bundles.networking)
}

Bundles in the catalog mirror the old grouped dependency lists (e.g. compose-official, core-android, networking, third-party-ui), so call-site diffs are minimal. Convention plugins (common-compose-module-configs-script-plugin, common-kotlin-module-configs-script-plugin) are unchanged.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx4096M -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.5 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI changed the title [WIP] Enhance project by migrating to Gradle version catalog Migrate dependency management to Gradle Version Catalog (libs.versions.toml) May 10, 2026
Copilot AI requested a review from Gurupreet May 10, 2026 13:57
@Gurupreet Gurupreet requested a review from Copilot May 11, 2026 11:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated 6 comments.

Comment thread settings.gradle.kts
Comment on lines +1 to +2
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

Comment thread gradle/libs.versions.toml
Comment on lines +98 to +114
compose-official = [
"compose-ui",
"compose-ui-tooling",
"compose-material",
"compose-material3",
"compose-material-icons-extended",
"compose-runtime-livedata",
"compose-constraint-layout",
"compose-paging",
"compose-viewmodel",
"compose-activity",
"compose-navigation",
"compose-runtime",
]
compose-third-party = ["font-awesome-compose", "compose-lottie", "flinger"]
compose-debug = ["kotlin-reflect", "compose-ui-tooling", "compose-ui-test-manifest"]
kotlin-main = ["kotlin-stdlib-jdk8", "kotlinx-coroutines-core", "kotlinx-coroutines-android"]
Comment thread gradle/libs.versions.toml
agp = "8.2.2"
kotlin = "1.9.22"
compose = "1.6.1"
compose-compiler = "1.5.8"
Comment thread app/build.gradle.kts
testImplementation(libs.truth)

// Instrumentation tests
androidTestImplementation(libs.bundles.android.instrumentation.test)
Comment on lines 18 to 31
implementation(project(":theme"))
implementation(project(":data"))
implementation("androidx.wear:wear:1.2.0")

addComposeOfficialDependencies()
addComposeThirdPartyDependencies()
implementation(libs.bundles.compose.official)
implementation(libs.bundles.compose.third.party)

addCoreAndroidUiDependencies()
addThirdPartyUiDependencies()
implementation(libs.bundles.core.android.ui)
implementation(libs.bundles.third.party.ui)

addCoreAndroidDependencies()
implementation(libs.bundles.core.android)

val wear_compose_version = "1.0.0-alpha07"
implementation("androidx.wear.compose:compose-material:$wear_compose_version")
implementation(libs.bundles.core.android.ui)

// Test dependencies
testImplementation("junit:junit:4.13.2")
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)

3 participants