From 50b7f15a035d3c1b2210c3df8ae0550cffd677d5 Mon Sep 17 00:00:00 2001 From: 5ec1cff Date: Sun, 5 Nov 2023 18:39:47 +0800 Subject: [PATCH] use version catalog --- build.gradle.kts | 2 +- gradle/lspatch.versions.toml | 61 +++++++++++++++++++++++++++++++++++ manager/build.gradle.kts | 62 +++++++++++++++++------------------- patch/build.gradle.kts | 6 ++-- settings.gradle.kts | 7 ++-- 5 files changed, 97 insertions(+), 41 deletions(-) create mode 100644 gradle/lspatch.versions.toml diff --git a/build.gradle.kts b/build.gradle.kts index 4f5ebc31..b838a4c1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,6 +8,7 @@ import org.eclipse.jgit.storage.file.FileRepositoryBuilder plugins { alias(libs.plugins.agp.lib) apply false alias(libs.plugins.agp.app) apply false + alias(lspatch.plugins.kotlin.android) apply false } buildscript { @@ -17,7 +18,6 @@ buildscript { } dependencies { classpath("org.eclipse.jgit:org.eclipse.jgit:6.3.0.202209071007-r") - classpath(kotlin("gradle-plugin", version = "1.8.21")) } } diff --git a/gradle/lspatch.versions.toml b/gradle/lspatch.versions.toml new file mode 100644 index 00000000..d80798ee --- /dev/null +++ b/gradle/lspatch.versions.toml @@ -0,0 +1,61 @@ +[versions] +room = "2.5.2" +accompanist = "0.27.0" +compose-destinations = "1.9.42-beta" +shizuku = "13.1.2" +hiddenapi-refine = "4.3.0" +hiddenapi-stub = "4.2.0" +compose-bom = "2023.06.01" +kotlin = "1.8.21" +ksp = "1.8.21-1.0.11" +commons-io = "2.13.0" +beust-jcommander = "1.82" +google-gson = "2.10.1" + +[plugins] +google-devtools-ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } +rikka-tools-refine = { id = "dev.rikka.tools.refine", version.ref = "hiddenapi-refine" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } + +[libraries] +androidx-customview = "androidx.customview:customview:1.2.0-alpha02" +androidx-customview-poolingcontainer = "androidx.customview:customview-poolingcontainer:1.0.0" + +androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" } +androidx-compose-ui = { module = "androidx.compose.ui:ui" } +androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } +androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } +androidx-compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" } +androidx-compose-material3 = { module = "androidx.compose.material3:material3" } + +androidx-navigation-compose = "androidx.navigation:navigation-compose:2.6.0" + +androidx-lifecycle-viewmodel-compose = "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1" + +androidx-activity-compose = "androidx.activity:activity-compose:1.7.2" + +androidx-core-ktx = "androidx.core:core-ktx:1.10.1" + +androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" } +androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" } +androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" } + +google-accompanist-navigation-animation = { module = "com.google.accompanist:accompanist-navigation-animation", version.ref = "accompanist" } +google-accompanist-pager = { module = "com.google.accompanist:accompanist-pager", version.ref = "accompanist" } +google-accompanist-swiperefresh = { module = "com.google.accompanist:accompanist-swiperefresh", version.ref = "accompanist" } + +rikka-shizuku-api = { module = "dev.rikka.shizuku:api", version.ref = "shizuku" } +rikka-shizuku-provider = { module = "dev.rikka.shizuku:provider", version.ref = "shizuku" } + +rikka-refine = { module = "dev.rikka.tools.refine:runtime", version.ref = "hiddenapi-refine" } + +rikka-hidden-stub = { module = "dev.rikka.hidden:stub", version.ref = "hiddenapi-stub" } + +raamcosta-compose-destinations = { module = "io.github.raamcosta.compose-destinations:core", version.ref = "compose-destinations" } +raamcosta-compose-destinations-ksp = { module = "io.github.raamcosta.compose-destinations:ksp", version.ref = "compose-destinations" } + +commons-io = { module = "commons-io:commons-io", version.ref = "commons-io" } + +beust-jcommander = { module = "com.beust:jcommander", version.ref = "beust-jcommander" } + +google-gson = { module = "com.google.code.gson:gson", version.ref = "google-gson" } diff --git a/manager/build.gradle.kts b/manager/build.gradle.kts index 72fa77e9..33611f53 100644 --- a/manager/build.gradle.kts +++ b/manager/build.gradle.kts @@ -9,10 +9,10 @@ val coreVerName: String by rootProject.extra plugins { alias(libs.plugins.agp.app) - id("com.google.devtools.ksp") - id("dev.rikka.tools.refine") + alias(lspatch.plugins.google.devtools.ksp) + alias(lspatch.plugins.rikka.tools.refine) + alias(lspatch.plugins.kotlin.android) id("kotlin-parcelize") - kotlin("android") } android { @@ -97,39 +97,35 @@ dependencies { implementation(projects.services.daemonService) implementation(projects.share.android) implementation(projects.share.java) - - val roomVersion = "2.5.2" - val accompanistVersion = "0.27.0" - val composeDestinationsVersion = "1.9.42-beta" - implementation(platform("androidx.compose:compose-bom:2023.06.01")) - - annotationProcessor("androidx.room:room-compiler:$roomVersion") - compileOnly("dev.rikka.hidden:stub:4.2.0") - debugImplementation("androidx.compose.ui:ui-tooling") - debugImplementation("androidx.customview:customview:1.2.0-alpha02") - debugImplementation("androidx.customview:customview-poolingcontainer:1.0.0") - implementation("androidx.activity:activity-compose:1.7.2") - implementation("androidx.compose.material:material-icons-extended") - implementation("androidx.compose.material3:material3") - implementation("androidx.compose.ui:ui") - implementation("androidx.compose.ui:ui-tooling-preview") - implementation("androidx.core:core-ktx:1.10.1") - implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1") - implementation("androidx.navigation:navigation-compose:2.6.0") + implementation(platform(lspatch.androidx.compose.bom)) + + annotationProcessor(lspatch.androidx.room.compiler) + compileOnly(lspatch.rikka.hidden.stub) + debugImplementation(lspatch.androidx.compose.ui.tooling) + debugImplementation(lspatch.androidx.customview) + debugImplementation(lspatch.androidx.customview.poolingcontainer) + implementation(lspatch.androidx.activity.compose) + implementation(lspatch.androidx.compose.material.icons.extended) + implementation(lspatch.androidx.compose.material3) + implementation(lspatch.androidx.compose.ui) + implementation(lspatch.androidx.compose.ui.tooling.preview) + implementation(lspatch.androidx.core.ktx) + implementation(lspatch.androidx.lifecycle.viewmodel.compose) + implementation(lspatch.androidx.navigation.compose) implementation(libs.androidx.preference) - implementation("androidx.room:room-ktx:$roomVersion") - implementation("androidx.room:room-runtime:$roomVersion") - implementation("com.google.accompanist:accompanist-navigation-animation:$accompanistVersion") - implementation("com.google.accompanist:accompanist-pager:$accompanistVersion") - implementation("com.google.accompanist:accompanist-swiperefresh:$accompanistVersion") + implementation(lspatch.androidx.room.ktx) + implementation(lspatch.androidx.room.runtime) + implementation(lspatch.google.accompanist.navigation.animation) + implementation(lspatch.google.accompanist.pager) + implementation(lspatch.google.accompanist.swiperefresh) implementation(libs.material) implementation(libs.gson) - implementation("dev.rikka.shizuku:api:13.1.2") - implementation("dev.rikka.shizuku:provider:13.1.2") - implementation("dev.rikka.tools.refine:runtime:4.3.0") - implementation("io.github.raamcosta.compose-destinations:core:$composeDestinationsVersion") + implementation(lspatch.rikka.shizuku.api) + implementation(lspatch.rikka.shizuku.provider) + implementation(lspatch.rikka.refine) + implementation(lspatch.raamcosta.compose.destinations) implementation(libs.appiconloader) implementation(libs.hiddenapibypass) - ksp("androidx.room:room-compiler:$roomVersion") - ksp("io.github.raamcosta.compose-destinations:ksp:$composeDestinationsVersion") + ksp(lspatch.androidx.room.compiler) + ksp(lspatch.raamcosta.compose.destinations.ksp) } diff --git a/patch/build.gradle.kts b/patch/build.gradle.kts index fdb10f25..5a73ed89 100644 --- a/patch/build.gradle.kts +++ b/patch/build.gradle.kts @@ -20,7 +20,7 @@ dependencies { implementation(projects.apkzlib) implementation(projects.share.java) - implementation("commons-io:commons-io:2.13.0") - implementation("com.beust:jcommander:1.82") - implementation("com.google.code.gson:gson:2.10.1") + implementation(lspatch.commons.io) + implementation(lspatch.beust.jcommander) + implementation(lspatch.google.gson) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 796e182e..a619ac2d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,10 +6,6 @@ pluginManagement { google() mavenCentral() } - plugins { - id("com.google.devtools.ksp") version "1.8.21-1.0.11" - id("dev.rikka.tools.refine") version "4.3.0" - } } dependencyResolutionManagement { @@ -27,6 +23,9 @@ dependencyResolutionManagement { create("libs") { from(files("core/gradle/libs.versions.toml")) } + create("lspatch") { + from(files("gradle/lspatch.versions.toml")) + } } }