Skip to content

Commit 1886800

Browse files
committed
[build] Migrate build to version catalogs
1 parent 98bd09a commit 1886800

File tree

3 files changed

+165
-72
lines changed

3 files changed

+165
-72
lines changed

app/build.gradle.kts

Lines changed: 70 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import com.android.build.api.variant.FilterConfiguration
22
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33

44
plugins {
5-
id("com.android.application")
6-
id("org.jetbrains.kotlin.android")
7-
id("org.jetbrains.kotlin.plugin.compose")
8-
id("kotlinx-serialization")
9-
id("kotlin-parcelize")
10-
id("com.google.devtools.ksp")
11-
id("com.google.dagger.hilt.android")
5+
alias(libs.plugins.android.application)
6+
alias(libs.plugins.kotlin.android)
7+
alias(libs.plugins.kotlin.parcelize)
8+
alias(libs.plugins.kotlin.plugin.compose)
9+
alias(libs.plugins.kotlin.plugin.serialization)
10+
alias(libs.plugins.hilt)
11+
alias(libs.plugins.ksp)
1212
}
1313

1414
apply(from = "../secret.gradle.kts")
@@ -159,69 +159,73 @@ tasks.withType(KotlinCompile::class.java).configureEach {
159159

160160
dependencies {
161161

162-
implementation("androidx.core:core-ktx:1.13.1")
163-
implementation("androidx.appcompat:appcompat:1.7.0")
164-
implementation("androidx.activity:activity-ktx:1.9.2")
165-
implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-beta01")
166-
implementation("androidx.navigation:navigation-compose:2.8.0")
167-
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.5")
168-
implementation("androidx.compose.ui:ui:1.7.0")
169-
implementation("androidx.compose.material:material:1.7.0")
170-
implementation("androidx.compose.material3:material3:1.3.0")
171-
implementation("androidx.compose.material3:material3-window-size-class:1.3.0")
172-
implementation("androidx.compose.material3.adaptive:adaptive:1.0.0")
173-
implementation("androidx.compose.material3.adaptive:adaptive-layout:1.0.0")
174-
implementation("androidx.compose.material3.adaptive:adaptive-navigation:1.0.0")
175-
implementation("androidx.compose.material:material-icons-extended:1.7.0")
176-
implementation("com.materialkolor:material-kolor:1.7.0")
177-
implementation("androidx.room:room-runtime:2.6.1")
178-
implementation("androidx.room:room-ktx:2.6.1")
179-
implementation("androidx.room:room-paging:2.6.1")
180-
ksp("androidx.room:room-compiler:2.6.1")
181-
implementation("androidx.work:work-runtime-ktx:2.9.1")
182-
implementation("androidx.datastore:datastore-preferences:1.1.1")
183-
implementation("androidx.core:core-splashscreen:1.0.1")
184-
implementation("androidx.paging:paging-compose:3.3.2")
185-
186-
implementation("com.google.android.material:material:1.12.0")
187-
implementation("com.google.accompanist:accompanist-permissions:0.36.0")
188-
189-
implementation("com.google.dagger:hilt-android:2.52")
190-
ksp("com.google.dagger:hilt-android-compiler:2.52")
191-
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
192-
implementation("androidx.profileinstaller:profileinstaller:1.3.1")
193-
194-
implementation("com.squareup.okhttp3:okhttp:4.12.0")
195-
implementation("com.squareup.okhttp3:okhttp-coroutines-jvm:5.0.0-alpha.12")
196-
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
197-
implementation("com.squareup.retrofit2:retrofit:2.11.0")
198-
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0")
199-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2")
200-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.8.1")
201-
202-
implementation("com.github.aniyomiorg:aniyomi-mpv-lib:1.15.n")
203-
implementation("com.github.jmir1:ffmpeg-kit:1.15")
204-
205-
implementation("io.coil-kt:coil-compose:2.7.0")
206-
implementation("io.coil-kt:coil-gif:2.7.0")
207-
implementation("io.coil-kt:coil-svg:2.7.0")
208-
implementation("io.coil-kt:coil-video:2.7.0")
209-
implementation("com.airbnb.android:lottie-compose:6.5.2")
210-
implementation("com.rometools:rome:2.1.0")
211-
implementation("com.rometools:rome-modules:2.1.0")
162+
implementation(libs.androidx.core.ktx)
163+
implementation(libs.androidx.appcompat)
164+
implementation(libs.androidx.activity.ktx)
165+
implementation(libs.androidx.constraintlayout.compose)
166+
implementation(libs.androidx.navigation.compose)
167+
implementation(libs.androidx.lifecycle.runtime.compose)
168+
implementation(libs.androidx.compose.ui)
169+
implementation(libs.androidx.compose.material)
170+
implementation(libs.androidx.compose.icons)
171+
implementation(libs.androidx.compose.material3)
172+
implementation(libs.androidx.compose.window.size)
173+
implementation(libs.androidx.compose.adaptive)
174+
implementation(libs.androidx.compose.adaptive.layout)
175+
implementation(libs.androidx.compose.adaptive.navigation)
176+
implementation(libs.androidx.room.runtime)
177+
implementation(libs.androidx.room.ktx)
178+
implementation(libs.androidx.room.paging)
179+
ksp(libs.androidx.room.compiler)
180+
implementation(libs.androidx.work.runtime.ktx)
181+
implementation(libs.androidx.datastore.preferences)
182+
implementation(libs.androidx.core.splashscreen)
183+
implementation(libs.androidx.paging.compose)
184+
implementation(libs.androidx.hilt.navigation.compose)
185+
implementation(libs.androidx.profileinstaller)
186+
187+
implementation(libs.material)
188+
implementation(libs.material.kolor)
189+
implementation(libs.accompanist.permissions)
190+
191+
implementation(libs.hilt.android)
192+
ksp(libs.hilt.android.compiler)
193+
194+
implementation(libs.okhttp3)
195+
implementation(libs.okhttp3.coroutines.jvm)
196+
implementation(libs.okhttp3.logging)
197+
implementation(libs.retrofit2)
198+
implementation(libs.retrofit2.kotlinx.serialization.converter)
199+
implementation(libs.kotlinx.serialization.json)
200+
implementation(libs.kotlinx.coroutines.guava)
201+
202+
implementation(libs.aniyomi.mpv.lib)
203+
implementation(libs.ffmpeg.kit)
204+
205+
implementation(libs.coil.compose)
206+
implementation(libs.coil.gif)
207+
implementation(libs.coil.svg)
208+
implementation(libs.coil.video)
209+
210+
implementation(libs.lottie.compose)
211+
212+
implementation(libs.rome)
213+
implementation(libs.rome.modules)
212214
implementation("be.ceau:opml-parser:3.1.0") {
213215
exclude(group = "net.sf.kxml", module = "kxml2")
214216
}
215-
implementation("net.dankito.readability4j:readability4j:1.0.8")
216-
implementation("sh.calvin.reorderable:reorderable:2.3.2")
217217

218-
implementation("org.libtorrent4j:libtorrent4j-android-arm64:2.1.0-31")
219-
implementation("org.libtorrent4j:libtorrent4j-android-arm:2.1.0-31")
220-
implementation("org.libtorrent4j:libtorrent4j-android-x86:2.1.0-31")
221-
implementation("org.libtorrent4j:libtorrent4j-android-x86_64:2.1.0-31")
218+
implementation(libs.readability4j)
219+
220+
implementation(libs.reorderable)
221+
222+
implementation(libs.libtorrent4j.arm64)
223+
implementation(libs.libtorrent4j.arm)
224+
implementation(libs.libtorrent4j.x86)
225+
implementation(libs.libtorrent4j.x8664)
222226

223227
// debugImplementation("com.squareup.leakcanary:leakcanary-android:2.13")
224-
testImplementation("junit:junit:4.13.2")
225-
androidTestImplementation("androidx.test.ext:junit:1.2.1")
226-
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
228+
testImplementation(libs.junit)
229+
androidTestImplementation(libs.androidx.junit)
230+
androidTestImplementation(libs.androidx.espresso.core)
227231
}

build.gradle.kts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id("com.android.application") version "8.5.2" apply false
4-
id("org.jetbrains.kotlin.android") version "2.0.20" apply false
5-
id("org.jetbrains.kotlin.plugin.compose") version "2.0.20"
6-
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.20"
7-
id("com.google.dagger.hilt.android") version "2.51.1" apply false
8-
id("com.google.devtools.ksp") version "2.0.20-1.0.24" apply false
3+
alias(libs.plugins.android.application) apply false
4+
alias(libs.plugins.kotlin.android) apply false
5+
alias(libs.plugins.kotlin.parcelize) apply false
6+
alias(libs.plugins.kotlin.plugin.compose)
7+
alias(libs.plugins.kotlin.plugin.serialization)
8+
alias(libs.plugins.hilt) apply false
9+
alias(libs.plugins.ksp) apply false
910
}

gradle/libs.versions.toml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
[versions]
2+
adaptive = "1.0.0"
3+
coil = "2.7.0"
4+
hilt = "2.52"
5+
libtorrent4j = "2.1.0-31"
6+
composeMaterial = "1.7.1"
7+
composeMaterial3 = "1.3.0"
8+
okhttp3 = "4.12.0"
9+
rome = "2.1.0"
10+
room = "2.6.1"
11+
12+
kotlin = "2.0.20"
13+
14+
[libraries]
15+
androidx-core-ktx = { module = "androidx.core:core-ktx", version = "1.13.1" }
16+
androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" }
17+
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version = "1.9.2" }
18+
androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version = "1.1.0-beta01" }
19+
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version = "2.8.0" }
20+
androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version = "2.8.5" }
21+
androidx-compose-ui = { module = "androidx.compose.ui:ui", version = "1.7.1" }
22+
androidx-compose-material = { module = "androidx.compose.material:material", version.ref = "composeMaterial" }
23+
androidx-compose-icons = { module = "androidx.compose.material:material-icons-extended", version.ref = "composeMaterial" }
24+
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "composeMaterial3" }
25+
androidx-compose-window-size = { module = "androidx.compose.material3:material3-window-size-class", version.ref = "composeMaterial3" }
26+
androidx-compose-adaptive = { module = "androidx.compose.material3.adaptive:adaptive", version.ref = "adaptive" }
27+
androidx-compose-adaptive-layout = { module = "androidx.compose.material3.adaptive:adaptive-layout", version.ref = "adaptive" }
28+
androidx-compose-adaptive-navigation = { module = "androidx.compose.material3.adaptive:adaptive-navigation", version.ref = "adaptive" }
29+
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
30+
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
31+
androidx-room-paging = { module = "androidx.room:room-paging", version.ref = "room" }
32+
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
33+
androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version = "2.9.1" }
34+
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version = "1.1.1" }
35+
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version = "1.0.1" }
36+
androidx-paging-compose = { module = "androidx.paging:paging-compose", version = "3.3.2" }
37+
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version = "1.2.0" }
38+
androidx-profileinstaller = { module = "androidx.profileinstaller:profileinstaller", version = "1.3.1" }
39+
40+
material = { module = "com.google.android.material:material", version = "1.12.0" }
41+
material-kolor = { module = "com.materialkolor:material-kolor", version = "1.7.0" }
42+
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version = "0.36.0" }
43+
44+
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
45+
hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" }
46+
47+
okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp3" }
48+
okhttp3-coroutines-jvm = { module = "com.squareup.okhttp3:okhttp-coroutines-jvm", version = "5.0.0-alpha.12" }
49+
okhttp3-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp3" }
50+
retrofit2 = { module = "com.squareup.retrofit2:retrofit", version = "2.11.0" }
51+
retrofit2-kotlinx-serialization-converter = { module = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter", version = "1.0.0" }
52+
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.7.2" }
53+
kotlinx-coroutines-guava = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-guava", version = "1.8.1" }
54+
55+
aniyomi-mpv-lib = { module = "com.github.aniyomiorg:aniyomi-mpv-lib", version = "1.15.n" }
56+
ffmpeg-kit = { module = "com.github.jmir1:ffmpeg-kit", version = "1.15" }
57+
58+
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
59+
coil-gif = { module = "io.coil-kt:coil-gif", version.ref = "coil" }
60+
coil-svg = { module = "io.coil-kt:coil-svg", version.ref = "coil" }
61+
coil-video = { module = "io.coil-kt:coil-video", version.ref = "coil" }
62+
63+
lottie-compose = { module = "com.airbnb.android:lottie-compose", version = "6.5.2" }
64+
65+
rome = { module = "com.rometools:rome", version.ref = "rome" }
66+
rome-modules = { module = "com.rometools:rome-modules", version.ref = "rome" }
67+
68+
readability4j = { module = "net.dankito.readability4j:readability4j", version = "1.0.8" }
69+
70+
reorderable = { module = "sh.calvin.reorderable:reorderable", version = "2.3.2" }
71+
72+
libtorrent4j-arm64 = { module = "org.libtorrent4j:libtorrent4j-android-arm64", version.ref = "libtorrent4j" }
73+
libtorrent4j-arm = { module = "org.libtorrent4j:libtorrent4j-android-arm", version.ref = "libtorrent4j" }
74+
libtorrent4j-x86 = { module = "org.libtorrent4j:libtorrent4j-android-x86", version.ref = "libtorrent4j" }
75+
libtorrent4j-x8664 = { module = "org.libtorrent4j:libtorrent4j-android-x86_64", version.ref = "libtorrent4j" }
76+
77+
junit = { module = "junit:junit", version = "4.13.2" }
78+
androidx-junit = { module = "androidx.test.ext:junit", version = "1.2.1" }
79+
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version = "3.6.1" }
80+
81+
[plugins]
82+
android-application = { id = "com.android.application", version = "8.5.2" }
83+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
84+
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
85+
kotlin-plugin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
86+
kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
87+
hilt = { id = "com.google.dagger.hilt.android", version = "2.51.1" }
88+
ksp = { id = "com.google.devtools.ksp", version = "2.0.20-1.0.24" }

0 commit comments

Comments
 (0)