From 540d022a13fbcdf534ebf9a2276c09d665880065 Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Wed, 17 Dec 2025 09:27:11 +0800 Subject: [PATCH] Simplify version catalog (#6197) * Inline versions * Simplify libraries * Simplify plugins * Cleanups * Group protobuf * New composeRules * Remove androidx-compose * Remove androidx-composeMaterial3 * Use modules * Fix typo for errorprone * Fix compose-material * Remove unused androidx.compose.material:material --- build.gradle | 5 +- gradle/libs.versions.toml | 179 +++++++++++++++----------------------- systemUI/log/build.gradle | 2 +- 3 files changed, 71 insertions(+), 115 deletions(-) diff --git a/build.gradle b/build.gradle index 07693881ce..59550abcfe 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ allprojects { protobuf { // Configure the protoc executable protoc { - artifact = "com.google.protobuf:protoc:${libs.versions.protocVersion.get()}" + artifact = libs.protobuf.protoc.get().toString() } generateProtoTasks { all().configureEach { task -> @@ -411,7 +411,6 @@ dependencies { implementation libs.compose.ui.google.fonts implementation libs.compose.foundation implementation libs.compose.material.icons - implementation libs.compose.material implementation libs.compose.runtime.livedata implementation libs.compose.material3 implementation libs.compose.material3.windowSizeClass @@ -470,7 +469,7 @@ spotless { kotlin { target("lawnchair/src/**/*.kt") ktlint("1.8.0").customRuleSets([ - "io.nlopez.compose.rules:ktlint:0.5.2", + libs.composeRules.get().toString() ]).editorConfigOverride([ "ktlint_compose_compositionlocal-allowlist": "disabled", "ktlint_compose_lambda-param-event-trailing": "disabled", diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7ab147634e..dfbfb03a0a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,118 +1,71 @@ [versions] jdkRelease = "17" -accompanist = "0.37.3" -benchmarkMacroJunit4 = "1.4.1" -concurrentFutures = "1.3.0" -coreAnimation = "1.0.0" -coreKtx = "1.17.0" -error_prone_annotations = "2.45.0" -espressoCore = "3.7.0" -junit = "1.3.0" -opto = "1.0.18" -protocVersion = "4.33.2" -retrofit = "3.0.0" -room = "2.8.4" - -activityCompose = "1.12.1" -airbnbLottie = "6.7.1" -androidDesugar = "2.1.5" -coil = "2.7.0" -composeBom = "2025.12.00" -compose = "1.10.0" -composeMaterial = "1.10.0" -composeMaterial3 = "1.4.0" -composeMaterialIcons = "1.7.8" -constraintlayout = "2.2.1" -dagger = "2.57.2" -datastore = "1.2.0" -dynamicanimation = "1.1.0" -fuzzywuzzy = "1.4.0" -googleMaterial = "1.13.0" -hokoBlur = "1.5.5" -kdrag0nColorkt = "1.0.5" -kotlinxCoroutines = "1.10.2" -kotlinxSerialization = "1.9.0" -libsu = "6.0.0" -lifecycle = "2.10.0" -materialMotionCompose = "1.2.1" -navigationCompose = "2.9.6" -okhttp = "5.3.2" -palette = "1.0.0" -persianDate = "1.7.1" -preference = "1.2.1" -profileinstaller = "1.4.1" -recyclerview = "1.4.0" -reorderable = "2.5.1" -restrictionBypass = "2.2" -slice = "1.1.0-alpha02" -smartspacer = "1.1.2" -uiautomator = "2.3.0" -window = "1.5.1" - agp = "8.13.2" -baselineprofile = "1.4.1" -kotlin = "2.3.0" -protobuf = "0.9.5" -licensee = "1.14.1" +kotlin = "2.2.21" +androidx-room = "2.8.4" +androidx-lifecycle = "2.10.0" +accompanist = "0.37.3" +opto = "1.0.18" +protobuf = "4.33.2" +retrofit = "3.0.0" +dagger = "2.57.2" +libsu = "6.0.0" refine = "4.4.0" -spotless = "8.1.0" [plugins] android-application = { id = "com.android.application", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" } android-test = { id = "com.android.test", version.ref = "agp" } -androidx-baselineprofile = { id = "androidx.baselineprofile", version.ref = "baselineprofile" } +androidx-baselineprofile = "androidx.baselineprofile:1.4.1" kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } -google-ksp = "com.google.devtools.ksp:2.3.4" -google-protobuf = { id = "com.google.protobuf", version.ref = "protobuf" } -cash-licensee = { id = "app.cash.licensee", version.ref = "licensee" } +google-ksp = "com.google.devtools.ksp:2.3.3" +google-protobuf = "com.google.protobuf:0.9.5" +cash-licensee = "app.cash.licensee:1.14.1" rikka-refine = { id = "dev.rikka.tools.refine", version.ref = "refine" } -diffplug-spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } +diffplug-spotless = "com.diffplug.spotless:8.1.0" [libraries] # AndroidX -androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } -androidx-benchmark-macro-junit4 = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "benchmarkMacroJunit4" } -androidx-concurrent-futures = { module = "androidx.concurrent:concurrent-futures", version.ref = "concurrentFutures" } -androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } -androidx-core-animation = { module = "androidx.core:core-animation", version.ref = "coreAnimation" } -androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" } -androidx-datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "datastore" } -androidx-dynamicanimation = { module = "androidx.dynamicanimation:dynamicanimation", version.ref = "dynamicanimation" } -androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" } -androidx-junit = { module = "androidx.test.ext:junit", version.ref = "junit" } -androidx-lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref = "lifecycle" } -androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" } -androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationCompose" } -androidx-palette-ktx = { group = "androidx.palette", name = "palette-ktx", version.ref = "palette" } -androidx-preference-ktx = { group = "androidx.preference", name = "preference-ktx", version.ref = "preference" } -androidx-profileinstaller = { group = "androidx.profileinstaller", name = "profileinstaller", version.ref = "profileinstaller" } -androidx-recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" } -androidx-slice-core = { group = "androidx.slice", name = "slice-core", version.ref = "slice" } -androidx-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "uiautomator" } -androidx-window = { group = "androidx.window", name = "window", version.ref = "window" } +androidx-activity-compose = "androidx.activity:activity-compose:1.12.1" +androidx-benchmark-macro-junit4 = "androidx.benchmark:benchmark-macro-junit4:1.4.1" +androidx-concurrent-futures = "androidx.concurrent:concurrent-futures:1.3.0" +androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:2.2.1" +androidx-core-animation = "androidx.core:core-animation:1.0.0" +androidx-core-ktx = "androidx.core:core-ktx:1.17.0" +androidx-datastore-preferences = "androidx.datastore:datastore-preferences:1.2.0" +androidx-dynamicanimation = "androidx.dynamicanimation:dynamicanimation:1.1.0" +androidx-espresso-core = "androidx.test.espresso:espresso-core:3.7.0" +androidx-junit = "androidx.test.ext:junit:1.3.0" +androidx-lifecycle-common = { module = "androidx.lifecycle:lifecycle-common", version.ref = "androidx-lifecycle" } +androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" } +androidx-navigation-compose = "androidx.navigation:navigation-compose:2.9.6" +androidx-palette-ktx = "androidx.palette:palette-ktx:1.0.0" +androidx-preference-ktx = "androidx.preference:preference-ktx:1.2.1" +androidx-profileinstaller = "androidx.profileinstaller:profileinstaller:1.4.1" +androidx-recyclerview = "androidx.recyclerview:recyclerview:1.4.0" +androidx-slice-core = "androidx.slice:slice-core:1.1.0-alpha02" +androidx-uiautomator = "androidx.test.uiautomator:uiautomator:2.3.0" +androidx-window = "androidx.window:window:1.5.1" # Compose -compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" } -compose-foundation = { group = "androidx.compose.foundation", name = "foundation", version.ref = "compose" } -compose-material = { group = "androidx.compose.material", name = "material", version.ref = "composeMaterial" } -compose-material-icons = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "composeMaterialIcons" } -compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "composeMaterial3" } -compose-material3-windowSizeClass = { group = "androidx.compose.material3", name = "material3-window-size-class", version.ref = "composeMaterial3" } -compose-runtime-livedata = { group = "androidx.compose.runtime", name = "runtime-livedata", version.ref = "compose" } -compose-ui = { group = "androidx.compose.ui", name = "ui", version.ref = "compose" } -compose-ui-google-fonts = { group = "androidx.compose.ui", name = "ui-text-google-fonts", version.ref = "compose" } -compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "compose" } -compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview", version.ref = "compose" } -compose-ui-util = { group = "androidx.compose.ui", name = "ui-util", version.ref = "compose" } +compose-bom = "androidx.compose:compose-bom:2025.12.00" +compose-foundation = { module = "androidx.compose.foundation:foundation" } +compose-material-icons = "androidx.compose.material:material-icons-extended:1.7.8" +compose-material3 = { module = "androidx.compose.material3:material3" } +compose-material3-windowSizeClass = { module = "androidx.compose.material3:material3-window-size-class" } +compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata" } +compose-ui = { module = "androidx.compose.ui:ui" } +compose-ui-google-fonts = { module = "androidx.compose.ui:ui-text-google-fonts" } +compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } +compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } +compose-ui-util = { module = "androidx.compose.ui:ui-util" } # Dagger & Hilt -error_prone_annotations = { module = "com.google.errorprone:error_prone_annotations", version.ref = "error_prone_annotations" } hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "dagger" } hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "dagger" } @@ -127,41 +80,45 @@ opto-compose = { group = "com.patrykmichalik.opto", name = "compose", version.re opto-domain = { group = "com.patrykmichalik.opto", name = "domain", version.ref = "opto" } # Retrofit & OkHttp -protobuf-javalite = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protocVersion" } retrofit-core = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" } retrofit-converter-kotlinx = { group = "com.squareup.retrofit2", name = "converter-kotlinx-serialization", version.ref = "retrofit" } -okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" } +okhttp = "com.squareup.okhttp3:okhttp:5.3.2" # Room -room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" } -room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" } -room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" } +room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "androidx-room" } +room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "androidx-room" } +room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "androidx-room" } # Kotlin kotlin-androidExtensionRuntime = { module = "org.jetbrains.kotlin:kotlin-android-extensions-runtime", version.ref = "kotlin" } kotlin-parcelizeRuntime = { module = "org.jetbrains.kotlin:kotlin-parcelize-runtime", version.ref = "kotlin" } # KotlinX -kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinxCoroutines" } -kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" } +kotlinx-coroutines-android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2" +kotlinx-serialization-json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0" + +protobuf-protoc = { module = "com.google.protobuf:protoc", version.ref = "protobuf" } +protobuf-javalite = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protobuf" } # Other -android-desugarJdkLibs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref = "androidDesugar" } -airbnb-lottie = { group = "com.airbnb.android", name = "lottie", version.ref = "airbnbLottie" } -chickenhook-restrictionbypass = { group = "com.github.ChickenHook", name = "RestrictionBypass", version.ref = "restrictionBypass" } -coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" } -google-material = { group = "com.google.android.material", name = "material", version.ref = "googleMaterial" } -hoko-blur = { group = "io.github.hokofly", name = "hoko-blur", version.ref = "hokoBlur" } -kdrag0n-colorkt = { group = "dev.kdrag0n", name = "colorkt", version.ref = "kdrag0nColorkt" } +android-desugarJdkLibs = "com.android.tools:desugar_jdk_libs:2.1.5" +airbnb-lottie = "com.airbnb.android:lottie:6.7.1" +chickenhook-restrictionbypass = "com.github.ChickenHook:RestrictionBypass:2.2" +coil-compose = "io.coil-kt:coil-compose:2.7.0" +google-material = "com.google.android.material:material:1.13.0" +hoko-blur = "io.github.hokofly:hoko-blur:1.5.5" +kdrag0n-colorkt = "dev.kdrag0n:colorkt:1.0.5" libsu-core = { group = "com.github.topjohnwu.libsu", name = "core", version.ref = "libsu" } libsu-service = { group = "com.github.topjohnwu.libsu", name = "service", version.ref = "libsu" } -material-motion-compose = { group = "io.github.fornewid", name = "material-motion-compose-core", version.ref = "materialMotionCompose" } -persian-date = { group = "com.github.samanzamani", name = "PersianDate", version.ref = "persianDate" } -reorderable = { group = "sh.calvin.reorderable", name = "reorderable", version.ref = "reorderable" } +material-motion-compose = "io.github.fornewid:material-motion-compose-core:1.2.1" +persian-date = "com.github.samanzamani:PersianDate:1.7.1" +reorderable = "sh.calvin.reorderable:reorderable:2.5.1" rikka-annotation = { module = "dev.rikka.tools.refine:annotation", version.ref = "refine" } rikka-annotation-processor = { module = "dev.rikka.tools.refine:annotation-processor", version.ref = "refine" } rikka-refine-runtime = { group = "dev.rikka.tools.refine", name = "runtime", version.ref = "refine" } -smartspacer-sdk = { group = "com.kieronquinn.smartspacer", name = "sdk-client", version.ref = "smartspacer" } -xdrop-fuzzywuzzy = { group = "me.xdrop", name = "fuzzywuzzy", version.ref = "fuzzywuzzy" } +smartspacer-sdk = "com.kieronquinn.smartspacer:sdk-client:1.1.2" +xdrop-fuzzywuzzy = "me.xdrop:fuzzywuzzy:1.4.0" +errorprone-annotations = "com.google.errorprone:error_prone_annotations:2.45.0" +composeRules = "io.nlopez.compose.rules:ktlint:0.5.2" [bundles] accompanist = ["accompanist-adaptive", "accompanist-drawablepainter", "accompanist-permissions"] diff --git a/systemUI/log/build.gradle b/systemUI/log/build.gradle index 4c39e8eab1..019cab7767 100644 --- a/systemUI/log/build.gradle +++ b/systemUI/log/build.gradle @@ -23,5 +23,5 @@ compileOnlyCommonJars() dependencies { compileOnly projects.plugincore compileOnly projects.common - implementation libs.error.prone.annotations + implementation libs.errorprone.annotations }