Skip to content

Commit

Permalink
Use gradle version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Aug 18, 2024
1 parent c76cc4c commit 5f27a62
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ runs:
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/caches/build-cache-*
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/**') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Cache build cache
Expand Down
27 changes: 13 additions & 14 deletions app/apk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,21 @@ android {
dependencies {
implementation(project(":app:core"))

implementation("com.github.topjohnwu:indeterminate-checkbox:1.0.7")
implementation("dev.rikka.rikkax.layoutinflater:layoutinflater:1.3.0")
implementation("dev.rikka.rikkax.insets:insets:1.3.0")
implementation("dev.rikka.rikkax.recyclerview:recyclerview-ktx:1.3.2")
implementation(libs.indeterminate.checkbox)
implementation(libs.rikka.layoutinflater)
implementation(libs.rikka.insets)
implementation(libs.rikka.recyclerview)

val vNav = "2.7.7"
implementation("androidx.navigation:navigation-fragment-ktx:${vNav}")
implementation("androidx.navigation:navigation-ui-ktx:${vNav}")
implementation(libs.navigation.fragment.ktx)
implementation(libs.navigation.ui.ktx)

implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.transition:transition:1.5.1")
implementation("androidx.fragment:fragment-ktx:1.8.2")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
implementation(libs.constraintlayout)
implementation(libs.swiperefreshlayout)
implementation(libs.recyclerview)
implementation(libs.transition)
implementation(libs.fragment.ktx)
implementation(libs.appcompat)
implementation(libs.material)

// Make sure kapt runs with a proper kotlin-stdlib
kapt(kotlin("stdlib"))
Expand Down
65 changes: 30 additions & 35 deletions app/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,34 @@ android {
dependencies {
api(project(":app:shared"))

api("com.jakewharton.timber:timber:5.0.1")
api("io.noties.markwon:core:4.6.2")
implementation("org.bouncycastle:bcpkix-jdk18on:1.78.1")
implementation("org.apache.commons:commons-compress:1.26.2")

val vLibsu = "6.0.0"
api("com.github.topjohnwu.libsu:core:${vLibsu}")
api("com.github.topjohnwu.libsu:service:${vLibsu}")
api("com.github.topjohnwu.libsu:nio:${vLibsu}")

val vRetrofit = "2.11.0"
implementation("com.squareup.retrofit2:retrofit:${vRetrofit}")
implementation("com.squareup.retrofit2:converter-moshi:${vRetrofit}")
implementation("com.squareup.retrofit2:converter-scalars:${vRetrofit}")

val vOkHttp = "4.12.0"
implementation("com.squareup.okhttp3:okhttp:${vOkHttp}")
implementation("com.squareup.okhttp3:logging-interceptor:${vOkHttp}")
implementation("com.squareup.okhttp3:okhttp-dnsoverhttps:${vOkHttp}")

val vMoshi = "1.15.1"
implementation("com.squareup.moshi:moshi:${vMoshi}")
ksp("com.squareup.moshi:moshi-kotlin-codegen:${vMoshi}")

val vRoom = "2.6.1"
implementation("androidx.room:room-runtime:${vRoom}")
implementation("androidx.room:room-ktx:${vRoom}")
ksp("androidx.room:room-compiler:${vRoom}")

implementation("androidx.core:core-splashscreen:1.0.1")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.activity:activity:1.9.1")
implementation("androidx.collection:collection-ktx:1.4.2")
implementation("androidx.profileinstaller:profileinstaller:1.3.1")
implementation("androidx.lifecycle:lifecycle-process:2.8.4")
api(libs.timber)
api(libs.markwon.core)
implementation(libs.bcpkix)
implementation(libs.commons.compress)

api(libs.libsu.core)
api(libs.libsu.service)
api(libs.libsu.nio)

implementation(libs.retrofit)
implementation(libs.retrofit.moshi)
implementation(libs.retrofit.scalars)

implementation(libs.okhttp)
implementation(libs.okhttp.logging)
implementation(libs.okhttp.dnsoverhttps)

implementation(libs.moshi)
ksp(libs.moshi.codegen)

implementation(libs.room.runtime)
implementation(libs.room.ktx)
ksp(libs.room.compiler)

implementation(libs.core.splashscreen)
implementation(libs.core.ktx)
implementation(libs.activity)
implementation(libs.collection.ktx)
implementation(libs.profileinstaller)
implementation(libs.lifecycle.process)
}
12 changes: 6 additions & 6 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ tasks.withType<KotlinCompile>().configureEach {
}

dependencies {
implementation(kotlin("gradle-plugin", "2.0.0"))
implementation("com.android.tools.build:gradle:8.5.2")
implementation("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:2.0.0-1.0.23")
implementation("androidx.navigation:navigation-safe-args-gradle-plugin:2.7.7")
implementation("org.lsposed.lsparanoid:gradle-plugin:0.6.0")
implementation("org.eclipse.jgit:org.eclipse.jgit:6.10.0.202406032230-r")
implementation(kotlin("gradle-plugin", libs.versions.kotlin.get()))
implementation(libs.android.gradle.plugin)
implementation(libs.ksp.plugin)
implementation(libs.navigation.safe.args.plugin)
implementation(libs.lsparanoid.plugin)
implementation(libs.jgit)
}
7 changes: 7 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
65 changes: 65 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[versions]
kotlin = "2.0.0"
android = "8.5.2"
ksp = "2.0.0-1.0.23"
rikka = "1.3.0"
navigation = "2.7.7"
libsu = "6.0.0"
moshi = "1.15.1"
okhttp = "4.12.0"
retrofit = "2.11.0"
room = "2.6.1"

[libraries]
bcpkix = { module = "org.bouncycastle:bcpkix-jdk18on", version = "1.78.1" }
commons-compress = { module = "org.apache.commons:commons-compress", version = "1.26.2" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
retrofit-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofit" }
retrofit-scalars = { module = "com.squareup.retrofit2:converter-scalars", version.ref = "retrofit" }
markwon-core = { module = "io.noties.markwon:core", version = "4.6.2" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
okhttp-dnsoverhttps = { module = "com.squareup.okhttp3:okhttp-dnsoverhttps", version.ref = "okhttp" }
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }
moshi-codegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "moshi" }
timber = { module = "com.jakewharton.timber:timber", version = "5.0.1" }
jgit = { module = "org.eclipse.jgit:org.eclipse.jgit", version = "6.10.0.202406032230-r" }

# AndroidX
activity = { module = "androidx.activity:activity", version = "1.9.1" }
appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" }
core-ktx = { module = "androidx.core:core-ktx", version = "1.13.1" }
core-splashscreen = { module = "androidx.core:core-splashscreen", version = "1.0.1" }
constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version = "2.1.4" }
fragment-ktx = { module = "androidx.fragment:fragment-ktx", version = "1.8.2" }
navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigation" }
navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigation" }
profileinstaller = { module = "androidx.profileinstaller:profileinstaller", version = "1.3.1" }
recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.3.2" }
room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version = "1.1.0" }
transition = { module = "androidx.transition:transition", version = "1.5.1" }
collection-ktx = { module = "androidx.collection:collection-ktx", version = "1.4.3" }
lifecycle-process = { module = "androidx.lifecycle:lifecycle-process", version = "2.8.4" }
material = { module = "com.google.android.material:material", version = "1.12.0" }

# topjohnwu
indeterminate-checkbox = { module = "com.github.topjohnwu:indeterminate-checkbox", version = "1.0.7" }
libsu-core = { module = "com.github.topjohnwu.libsu:core", version.ref = "libsu" }
libsu-service = { module = "com.github.topjohnwu.libsu:service", version.ref = "libsu" }
libsu-nio = { module = "com.github.topjohnwu.libsu:nio", version.ref = "libsu" }

# Rikka
rikka-recyclerview = { module = "dev.rikka.rikkax.recyclerview:recyclerview-ktx", version = "1.3.2" }
rikka-layoutinflater = { module = "dev.rikka.rikkax.layoutinflater:layoutinflater", version.ref = "rikka" }
rikka-insets = { module = "dev.rikka.rikkax.insets:insets", version.ref = "rikka" }

# Build plugins
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "android" }
ksp-plugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" }
navigation-safe-args-plugin = { module = "androidx.navigation:navigation-safe-args-gradle-plugin", version.ref = "navigation" }
lsparanoid-plugin = { module = "org.lsposed.lsparanoid:gradle-plugin", version = "0.6.0" }

[plugins]

0 comments on commit 5f27a62

Please sign in to comment.