|
4 | 4 | */ |
5 | 5 |
|
6 | 6 | plugins { |
7 | | - id("com.android.application") |
8 | | - id("kotlin-android") |
9 | | - id("kotlin-kapt") |
10 | | - id("kotlin-parcelize") |
11 | | - id("org.sonarqube") |
| 7 | + alias(libs.plugins.android.application) |
| 8 | + alias(libs.plugins.jetbrains.kotlin.android) |
| 9 | + alias(libs.plugins.jetbrains.kotlin.kapt) |
| 10 | + alias(libs.plugins.jetbrains.kotlin.parcelize) |
| 11 | + alias(libs.plugins.sonarqube) |
12 | 12 | checkstyle |
13 | 13 | } |
14 | 14 |
|
@@ -126,28 +126,14 @@ android { |
126 | 126 | } |
127 | 127 | } |
128 | 128 |
|
129 | | -val checkstyleVersion = "10.12.1" |
130 | | - |
131 | | -val androidxLifecycleVersion = "2.6.2" |
132 | | -val androidxRoomVersion = "2.6.1" |
133 | | -val androidxWorkVersion = "2.8.1" |
134 | | - |
135 | | -val stateSaverVersion = "1.4.1" |
136 | | -val exoPlayerVersion = "2.18.7" |
137 | | -val googleAutoServiceVersion = "1.1.1" |
138 | | -val groupieVersion = "2.10.1" |
139 | | -val markwonVersion = "4.6.2" |
140 | | - |
141 | | -val leakCanaryVersion = "2.12" |
142 | | -val stethoVersion = "1.6.0" |
143 | | - |
| 129 | +// Custom dependency configuration for ktlint |
144 | 130 | val ktlint by configurations.creating |
145 | 131 |
|
146 | 132 | checkstyle { |
147 | 133 | configDirectory = rootProject.file("checkstyle") |
148 | 134 | isIgnoreFailures = false |
149 | 135 | isShowViolations = true |
150 | | - toolVersion = checkstyleVersion |
| 136 | + toolVersion = libs.versions.checkstyle.get() |
151 | 137 | } |
152 | 138 |
|
153 | 139 | tasks.register<Checkstyle>("runCheckstyle") { |
@@ -208,113 +194,106 @@ sonar { |
208 | 194 |
|
209 | 195 | dependencies { |
210 | 196 | /** Desugaring **/ |
211 | | - coreLibraryDesugaring("com.android.tools:desugar_jdk_libs_nio:2.0.4") |
| 197 | + coreLibraryDesugaring(libs.android.desugar) |
212 | 198 |
|
213 | 199 | /** NewPipe libraries **/ |
214 | | - implementation("com.github.TeamNewPipe:nanojson:e9d656ddb49a412a5a0a5d5ef20ca7ef09549996") |
215 | | - // WORKAROUND: if you get errors with the NewPipeExtractor dependency, replace `v0.24.3` with |
216 | | - // the corresponding commit hash, since JitPack sometimes deletes artifacts. |
217 | | - // If there’s already a git hash, just add more of it to the end (or remove a letter) |
218 | | - // to cause jitpack to regenerate the artifact. |
219 | | - implementation("com.github.TeamNewPipe:NewPipeExtractor:0023b22095a2d62a60cdfc87f4b5cd85c8b266c3") |
220 | | - implementation("com.github.TeamNewPipe:NoNonsense-FilePicker:5.0.0") |
| 200 | + implementation(libs.newpipe.nanojson) |
| 201 | + implementation(libs.newpipe.extractor) |
| 202 | + implementation(libs.newpipe.filepicker) |
221 | 203 |
|
222 | 204 | /** Checkstyle **/ |
223 | | - checkstyle("com.puppycrawl.tools:checkstyle:$checkstyleVersion") |
224 | | - ktlint("com.pinterest:ktlint:0.45.2") |
| 205 | + checkstyle(libs.puppycrawl.checkstyle) |
| 206 | + ktlint(libs.pinterest.ktlint) |
225 | 207 |
|
226 | 208 | /** AndroidX **/ |
227 | | - implementation("androidx.appcompat:appcompat:1.7.1") |
228 | | - implementation("androidx.cardview:cardview:1.0.0") |
229 | | - implementation("androidx.constraintlayout:constraintlayout:2.1.4") |
230 | | - implementation("androidx.core:core-ktx:1.12.0") |
231 | | - implementation("androidx.documentfile:documentfile:1.0.1") |
232 | | - implementation("androidx.fragment:fragment-ktx:1.6.2") |
233 | | - implementation("androidx.lifecycle:lifecycle-livedata-ktx:$androidxLifecycleVersion") |
234 | | - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$androidxLifecycleVersion") |
235 | | - implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0") |
236 | | - implementation("androidx.media:media:1.7.0") |
237 | | - implementation("androidx.preference:preference:1.2.1") |
238 | | - implementation("androidx.recyclerview:recyclerview:1.3.2") |
239 | | - implementation("androidx.room:room-runtime:$androidxRoomVersion") |
240 | | - implementation("androidx.room:room-rxjava3:$androidxRoomVersion") |
241 | | - kapt("androidx.room:room-compiler:$androidxRoomVersion") |
242 | | - implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") |
243 | | - // Newer version specified to prevent accessibility regressions with RecyclerView, see: |
244 | | - // https://developer.android.com/jetpack/androidx/releases/viewpager2#1.1.0-alpha01 |
245 | | - implementation("androidx.viewpager2:viewpager2:1.1.0-beta02") |
246 | | - implementation("androidx.work:work-runtime-ktx:$androidxWorkVersion") |
247 | | - implementation("androidx.work:work-rxjava3:$androidxWorkVersion") |
248 | | - implementation("com.google.android.material:material:1.11.0") |
249 | | - implementation("androidx.webkit:webkit:1.9.0") |
| 209 | + implementation(libs.androidx.appcompat) |
| 210 | + implementation(libs.androidx.cardview) |
| 211 | + implementation(libs.androidx.constraintlayout) |
| 212 | + implementation(libs.androidx.core) |
| 213 | + implementation(libs.androidx.documentfile) |
| 214 | + implementation(libs.androidx.fragment) |
| 215 | + implementation(libs.androidx.lifecycle.livedata) |
| 216 | + implementation(libs.androidx.lifecycle.viewmodel) |
| 217 | + implementation(libs.androidx.localbroadcastmanager) |
| 218 | + implementation(libs.androidx.media) |
| 219 | + implementation(libs.androidx.preference) |
| 220 | + implementation(libs.androidx.recyclerview) |
| 221 | + implementation(libs.androidx.room.runtime) |
| 222 | + implementation(libs.androidx.room.rxjava3) |
| 223 | + kapt(libs.androidx.room.compiler) |
| 224 | + implementation(libs.androidx.swiperefreshlayout) |
| 225 | + implementation(libs.androidx.viewpager2) |
| 226 | + implementation(libs.androidx.work.runtime) |
| 227 | + implementation(libs.androidx.work.rxjava3) |
| 228 | + implementation(libs.google.android.material) |
| 229 | + implementation(libs.androidx.webkit) |
250 | 230 |
|
251 | 231 | /** Third-party libraries **/ |
252 | | - implementation("com.github.livefront:bridge:v2.0.2") |
253 | | - implementation("com.evernote:android-state:$stateSaverVersion") |
254 | | - kapt("com.evernote:android-state-processor:$stateSaverVersion") |
| 232 | + implementation(libs.livefront.bridge) |
| 233 | + implementation(libs.evernote.statesaver.core) |
| 234 | + kapt(libs.evernote.statesaver.compiler) |
255 | 235 |
|
256 | 236 | // HTML parser |
257 | | - implementation("org.jsoup:jsoup:1.17.2") |
| 237 | + implementation(libs.jsoup) |
258 | 238 |
|
259 | 239 | // HTTP client |
260 | | - implementation("com.squareup.okhttp3:okhttp:4.12.0") |
| 240 | + implementation(libs.squareup.okhttp) |
261 | 241 |
|
262 | 242 | // Media player |
263 | | - implementation("com.google.android.exoplayer:exoplayer-core:$exoPlayerVersion") |
264 | | - implementation("com.google.android.exoplayer:exoplayer-dash:$exoPlayerVersion") |
265 | | - implementation("com.google.android.exoplayer:exoplayer-database:$exoPlayerVersion") |
266 | | - implementation("com.google.android.exoplayer:exoplayer-datasource:$exoPlayerVersion") |
267 | | - implementation("com.google.android.exoplayer:exoplayer-hls:$exoPlayerVersion") |
268 | | - implementation("com.google.android.exoplayer:exoplayer-smoothstreaming:$exoPlayerVersion") |
269 | | - implementation("com.google.android.exoplayer:exoplayer-ui:$exoPlayerVersion") |
270 | | - implementation("com.google.android.exoplayer:extension-mediasession:$exoPlayerVersion") |
| 243 | + implementation(libs.google.exoplayer.core) |
| 244 | + implementation(libs.google.exoplayer.dash) |
| 245 | + implementation(libs.google.exoplayer.database) |
| 246 | + implementation(libs.google.exoplayer.datasource) |
| 247 | + implementation(libs.google.exoplayer.hls) |
| 248 | + implementation(libs.google.exoplayer.mediasession) |
| 249 | + implementation(libs.google.exoplayer.smoothstreaming) |
| 250 | + implementation(libs.google.exoplayer.ui) |
271 | 251 |
|
272 | 252 | // Metadata generator for service descriptors |
273 | | - compileOnly("com.google.auto.service:auto-service-annotations:$googleAutoServiceVersion") |
274 | | - kapt("com.google.auto.service:auto-service:$googleAutoServiceVersion") |
| 253 | + compileOnly(libs.google.autoservice.annotations) |
| 254 | + kapt(libs.google.autoservice.compiler) |
275 | 255 |
|
276 | 256 | // Manager for complex RecyclerView layouts |
277 | | - implementation("com.github.lisawray.groupie:groupie:$groupieVersion") |
278 | | - implementation("com.github.lisawray.groupie:groupie-viewbinding:$groupieVersion") |
| 257 | + implementation(libs.lisawray.groupie.core) |
| 258 | + implementation(libs.lisawray.groupie.viewbinding) |
279 | 259 |
|
280 | 260 | // Image loading |
281 | | - //noinspection NewerVersionAvailable,GradleDependency --> 2.8 is the last version, not 2.71828! |
282 | | - implementation("com.squareup.picasso:picasso:2.8") |
| 261 | + implementation(libs.squareup.picasso) |
283 | 262 |
|
284 | 263 | // Markdown library for Android |
285 | | - implementation("io.noties.markwon:core:$markwonVersion") |
286 | | - implementation("io.noties.markwon:linkify:$markwonVersion") |
| 264 | + implementation(libs.noties.markwon.core) |
| 265 | + implementation(libs.noties.markwon.linkify) |
287 | 266 |
|
288 | 267 | // Crash reporting |
289 | | - implementation("ch.acra:acra-core:5.11.3") |
| 268 | + implementation(libs.acra.core) |
290 | 269 |
|
291 | 270 | // Properly restarting |
292 | | - implementation("com.jakewharton:process-phoenix:2.1.2") |
| 271 | + implementation(libs.jakewharton.phoenix) |
293 | 272 |
|
294 | 273 | // Reactive extensions for Java VM |
295 | | - implementation("io.reactivex.rxjava3:rxjava:3.1.8") |
296 | | - implementation("io.reactivex.rxjava3:rxandroid:3.0.2") |
| 274 | + implementation(libs.reactivex.rxjava) |
| 275 | + implementation(libs.reactivex.rxandroid) |
297 | 276 | // RxJava binding APIs for Android UI widgets |
298 | | - implementation("com.jakewharton.rxbinding4:rxbinding:4.0.0") |
| 277 | + implementation(libs.jakewharton.rxbinding) |
299 | 278 |
|
300 | 279 | // Date and time formatting |
301 | | - implementation("org.ocpsoft.prettytime:prettytime:5.0.8.Final") |
| 280 | + implementation(libs.ocpsoft.prettytime) |
302 | 281 |
|
303 | 282 | /** Debugging **/ |
304 | 283 | // Memory leak detection |
305 | | - debugImplementation("com.squareup.leakcanary:leakcanary-object-watcher-android:$leakCanaryVersion") |
306 | | - debugImplementation("com.squareup.leakcanary:plumber-android:$leakCanaryVersion") |
307 | | - debugImplementation("com.squareup.leakcanary:leakcanary-android-core:$leakCanaryVersion") |
| 284 | + debugImplementation(libs.squareup.leakcanary.watcher) |
| 285 | + debugImplementation(libs.squareup.leakcanary.plumber) |
| 286 | + debugImplementation(libs.squareup.leakcanary.core) |
308 | 287 | // Debug bridge for Android |
309 | | - debugImplementation("com.facebook.stetho:stetho:$stethoVersion") |
310 | | - debugImplementation("com.facebook.stetho:stetho-okhttp3:$stethoVersion") |
| 288 | + debugImplementation(libs.facebook.stetho.core) |
| 289 | + debugImplementation(libs.facebook.stetho.okhttp3) |
311 | 290 |
|
312 | 291 | /** Testing **/ |
313 | | - testImplementation("junit:junit:4.13.2") |
314 | | - testImplementation("org.mockito:mockito-core:5.6.0") |
| 292 | + testImplementation(libs.junit) |
| 293 | + testImplementation(libs.mockito.core) |
315 | 294 |
|
316 | | - androidTestImplementation("androidx.test.ext:junit:1.1.5") |
317 | | - androidTestImplementation("androidx.test:runner:1.5.2") |
318 | | - androidTestImplementation("androidx.room:room-testing:$androidxRoomVersion") |
319 | | - androidTestImplementation("org.assertj:assertj-core:3.24.2") |
| 295 | + androidTestImplementation(libs.androidx.junit) |
| 296 | + androidTestImplementation(libs.androidx.runner) |
| 297 | + androidTestImplementation(libs.androidx.room.testing) |
| 298 | + androidTestImplementation(libs.assertj.core) |
320 | 299 | } |
0 commit comments