From f8d9922652d1fe2386a45706f8b50ebb53fbc282 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Thu, 4 Apr 2024 12:51:01 +0530 Subject: [PATCH] Migrate to build version catalog Signed-off-by: Aayush Gupta --- app/build.gradle.kts | 110 ++++++++++++++++---------------------- build.gradle.kts | 16 +++--- gradle/libs.versions.toml | 83 ++++++++++++++++++++++++++++ 3 files changed, 137 insertions(+), 72 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5448941b3..442128384 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -22,14 +22,14 @@ import java.util.Properties plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.plugin.parcelize") - id("com.google.devtools.ksp") - id("androidx.navigation.safeargs.kotlin") - id("org.jlleitschuh.gradle.ktlint") - id("dev.rikka.tools.refine") - id("com.google.dagger.hilt.android") + alias(libs.plugins.android.application) + alias(libs.plugins.jetbrains.kotlin.android) + alias(libs.plugins.jetbrains.kotlin.parcelize) + alias(libs.plugins.google.ksp) + alias(libs.plugins.androidx.navigation) + alias(libs.plugins.ktlint) + alias(libs.plugins.rikka.tools.refine.plugin) + alias(libs.plugins.hilt.android.plugin) } kotlin { @@ -124,87 +124,69 @@ android { dependencies { - //Protobuf - implementation("com.google.protobuf:protobuf-javalite:3.25.3") - //Google's Goodies - implementation("com.google.android.material:material:1.11.0") - implementation("com.google.code.gson:gson:2.10.1") + implementation(libs.google.android.material) + implementation(libs.google.gson) + implementation(libs.google.protobuf.javalite) //AndroidX - implementation("androidx.core:core-ktx:1.12.0") - implementation("androidx.viewpager2:viewpager2:1.0.0") - implementation("androidx.preference:preference-ktx:1.2.1") - implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") - - //Arch LifeCycle - val lifeVersion = "2.7.0" - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifeVersion") - implementation("androidx.lifecycle:lifecycle-process:$lifeVersion") - - //Arch Navigation - val navVersion = "2.7.7" - implementation("androidx.navigation:navigation-fragment-ktx:$navVersion") - implementation("androidx.navigation:navigation-ui-ktx:$navVersion") + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.browser) + implementation(libs.androidx.lifecycle.viewmodel.ktx) + implementation(libs.androidx.lifecycle.process) + implementation(libs.androidx.navigation.fragment.ktx) + implementation(libs.androidx.navigation.ui.ktx) + implementation(libs.androidx.preference.ktx) + implementation(libs.androidx.swiperefreshlayout) + implementation(libs.androidx.viewpager2) + implementation(libs.androidx.work.runtime.ktx) //Coil - implementation("io.coil-kt:coil:2.6.0") + implementation(libs.coil.kt) //Shimmer - implementation("com.facebook.shimmer:shimmer:0.5.0") + implementation(libs.facebook.shimmer) //Epoxy - val epoxyVersion = "5.1.4" - implementation("com.airbnb.android:epoxy:$epoxyVersion") - ksp("com.airbnb.android:epoxy-processor:$epoxyVersion") + implementation(libs.airbnb.epoxy.android) + ksp(libs.airbnb.epoxy.processor) //HTTP Clients - implementation("com.squareup.okhttp3:okhttp:4.12.0") + implementation(libs.squareup.okhttp) //EventBus - implementation("org.greenrobot:eventbus:3.3.1") + implementation(libs.greenrobot.eventbus) //Lib-SU - implementation("com.github.topjohnwu.libsu:core:5.0.5") + implementation(libs.github.topjohnwu.libsu) - //Love <3 - implementation("com.gitlab.AuroraOSS:gplayapi:3.2.10") - - //Browser - implementation("androidx.browser:browser:1.8.0") + //GPlayApi + implementation(libs.gitlab.auroraoss.gplayapi) //Shizuku - val shizukuVersion = "13.1.5" - compileOnly("dev.rikka.hidden:stub:4.3.2") - implementation("dev.rikka.tools.refine:runtime:4.4.0") - implementation("dev.rikka.shizuku:api:${shizukuVersion}") - implementation("dev.rikka.shizuku:provider:${shizukuVersion}") + compileOnly(libs.rikka.hidden.stub) + implementation(libs.rikka.tools.refine.runtime) + implementation(libs.rikka.shizuku.api) + implementation(libs.rikka.shizuku.provider) - implementation("org.lsposed.hiddenapibypass:hiddenapibypass:4.3") + implementation(libs.lsposed.hiddenapibypass) //Test - testImplementation("junit:junit:4.13.2") - androidTestImplementation("androidx.test.ext:junit:1.1.5") - androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") - - //WorkManager - implementation("androidx.work:work-runtime-ktx:2.9.0") + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) //Hilt - val hiltVersion = "2.51.1" - ksp("com.google.dagger:hilt-android-compiler:$hiltVersion") - implementation("com.google.dagger:hilt-android:$hiltVersion") - - val hiltWorkVersion = "1.2.0" - ksp("androidx.hilt:hilt-compiler:$hiltWorkVersion") - implementation("androidx.hilt:hilt-work:$hiltWorkVersion") + ksp(libs.hilt.android.compiler) + ksp(libs.hilt.androidx.compiler) + implementation(libs.hilt.android.core) + implementation(libs.hilt.androidx.work) //Room - val roomVersion = "2.6.1" - ksp("androidx.room:room-compiler:$roomVersion") - implementation("androidx.room:room-ktx:$roomVersion") - implementation("androidx.room:room-runtime:$roomVersion") + ksp(libs.androidx.room.compiler) + implementation(libs.androidx.room.ktx) + implementation(libs.androidx.room.runtime) // LeakCanary - debugImplementation("com.squareup.leakcanary:leakcanary-android:2.13") + debugImplementation(libs.squareup.leakcanary.android) } diff --git a/build.gradle.kts b/build.gradle.kts index b6498ea91..c6223d531 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,12 +20,12 @@ */ plugins { - id("com.android.application") version "8.3.1" apply false - id("org.jetbrains.kotlin.android") version "1.9.22" apply false - id("org.jetbrains.kotlin.plugin.parcelize") version "1.9.22" apply false - id("com.google.devtools.ksp") version "1.9.22-1.0.17" apply false - id("androidx.navigation.safeargs.kotlin") version "2.7.7" apply false - id("org.jlleitschuh.gradle.ktlint") version "11.6.1" apply false - id("dev.rikka.tools.refine") version "4.4.0" apply false - id("com.google.dagger.hilt.android") version "2.51.1" apply false + alias(libs.plugins.android.application) apply false + alias(libs.plugins.jetbrains.kotlin.android) apply false + alias(libs.plugins.jetbrains.kotlin.parcelize) apply false + alias(libs.plugins.google.ksp) apply false + alias(libs.plugins.androidx.navigation) apply false + alias(libs.plugins.ktlint) apply false + alias(libs.plugins.rikka.tools.refine.plugin) apply false + alias(libs.plugins.hilt.android.plugin) apply false } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..2e6c454e4 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,83 @@ +[versions] +androidGradlePlugin = "8.3.1" +browserVersion = "1.8.0" +coilVersion = "2.6.0" +core = "5.0.5" +coreVersion = "1.12.0" +epoxyVersion = "5.1.4" +espressoVersion = "3.5.1" +eventbusVersion = "3.3.1" +gplayapiVersion = "3.2.10" +gsonVersion = "2.10.1" +hiddenapibypassVersion = "4.3" +hiltVersion = "2.51.1" +hiltWorkVersion = "1.2.0" +junit = "4.13.2" +junitVersion = "1.1.5" +kotlinVersion = "1.9.22" +kspVersion = "1.9.22-1.0.17" +ktlintVersion = "12.1.0" +leakcanaryAndroidVersion = "2.13" +lifeVersion = "2.7.0" +materialVersion = "1.11.0" +navVersion = "2.7.7" +okhttpVersion = "4.12.0" +preferenceVersion = "1.2.1" +protobufJavaliteVersion = "3.25.3" +rikkaHiddenVersion = "4.3.2" +rikkaToolsVersion = "4.4.0" +roomVersion = "2.6.1" +shimmerVersion = "0.5.0" +shizukuVersion = "13.1.5" +swiperefreshlayoutVersion = "1.1.0" +viewpager2Version = "1.0.0" +workVersion = "2.9.0" + +[libraries] +airbnb-epoxy-android = { module = "com.airbnb.android:epoxy", version.ref = "epoxyVersion" } +airbnb-epoxy-processor = { module = "com.airbnb.android:epoxy-processor", version.ref = "epoxyVersion" } +androidx-browser = { module = "androidx.browser:browser", version.ref = "browserVersion" } +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreVersion" } +androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoVersion" } +androidx-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" } +androidx-lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version.ref = "lifeVersion" } +androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifeVersion" } +androidx-navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navVersion" } +androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navVersion" } +androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preferenceVersion" } +androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "roomVersion" } +androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "roomVersion" } +androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "roomVersion" } +androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefreshlayoutVersion" } +androidx-viewpager2 = { module = "androidx.viewpager2:viewpager2", version.ref = "viewpager2Version" } +androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "workVersion" } +coil-kt = { module = "io.coil-kt:coil", version.ref = "coilVersion" } +facebook-shimmer = { module = "com.facebook.shimmer:shimmer", version.ref = "shimmerVersion" } +gitlab-auroraoss-gplayapi = { module = "com.gitlab.AuroraOSS:gplayapi", version.ref = "gplayapiVersion" } +github-topjohnwu-libsu = { module = "com.github.topjohnwu.libsu:core", version.ref = "core" } +google-android-material = { module = "com.google.android.material:material", version.ref = "materialVersion" } +google-gson = { module = "com.google.code.gson:gson", version.ref = "gsonVersion" } +google-protobuf-javalite = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protobufJavaliteVersion" } +greenrobot-eventbus = { module = "org.greenrobot:eventbus", version.ref = "eventbusVersion" } +hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hiltVersion" } +hilt-android-core = { module = "com.google.dagger:hilt-android", version.ref = "hiltVersion" } +hilt-androidx-compiler = { module = "androidx.hilt:hilt-compiler", version.ref = "hiltWorkVersion" } +hilt-androidx-work = { module = "androidx.hilt:hilt-work", version.ref = "hiltWorkVersion" } +junit = { module = "junit:junit", version.ref = "junit" } +lsposed-hiddenapibypass = { module = "org.lsposed.hiddenapibypass:hiddenapibypass", version.ref = "hiddenapibypassVersion" } +rikka-hidden-stub = { module = "dev.rikka.hidden:stub", version.ref = "rikkaHiddenVersion" } +rikka-shizuku-api = { module = "dev.rikka.shizuku:api", version.ref = "shizukuVersion" } +rikka-shizuku-provider = { module = "dev.rikka.shizuku:provider", version.ref = "shizukuVersion" } +rikka-tools-refine-runtime = { module = "dev.rikka.tools.refine:runtime", version.ref = "rikkaToolsVersion" } +squareup-leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanaryAndroidVersion" } +squareup-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttpVersion" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } +androidx-navigation = { id = "androidx.navigation.safeargs.kotlin", version.ref = "navVersion" } +google-ksp = { id = "com.google.devtools.ksp", version.ref = "kspVersion" } +hilt-android-plugin = { id = "com.google.dagger.hilt.android", version.ref = "hiltVersion" } +ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlintVersion" } +jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinVersion" } +jetbrains-kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlinVersion" } +rikka-tools-refine-plugin = { id = "dev.rikka.tools.refine", version.ref = "rikkaToolsVersion" }