1
1
import com.android.tools.profgen.ArtProfileKt
2
2
import com.android.tools.profgen.ArtProfileSerializer
3
3
import com.android.tools.profgen.DexFile
4
+ import com.mikepenz.aboutlibraries.plugin.DuplicateMode
4
5
5
6
plugins {
6
- id " com.android.application"
7
- id " kotlin-android"
8
- id " kotlin-kapt"
9
- id " kotlin-parcelize"
10
- id " checkstyle"
11
- id " org.sonarqube" version " 4.0.0.2929"
7
+ alias libs. plugins. android. application
8
+ alias libs. plugins. kotlin. android
9
+ alias libs. plugins. kotlin. compose
10
+ alias libs. plugins. kotlin. kapt
11
+ alias libs. plugins. kotlin. parcelize
12
+ alias libs. plugins. checkstyle
13
+ alias libs. plugins. sonarqube
14
+ alias libs. plugins. hilt
15
+ alias libs. plugins. aboutlibraries
12
16
}
13
17
14
18
android {
@@ -104,6 +108,7 @@ android {
104
108
105
109
buildFeatures {
106
110
viewBinding true
111
+ compose true
107
112
buildConfig true
108
113
}
109
114
@@ -125,23 +130,6 @@ android {
125
130
}
126
131
}
127
132
128
- ext {
129
- checkstyleVersion = ' 10.12.1'
130
-
131
- androidxLifecycleVersion = ' 2.6.2'
132
- androidxRoomVersion = ' 2.6.1'
133
- androidxWorkVersion = ' 2.8.1'
134
-
135
- stateSaverVersion = ' 1.4.1'
136
- exoPlayerVersion = ' 2.18.7'
137
- googleAutoServiceVersion = ' 1.1.1'
138
- groupieVersion = ' 2.10.1'
139
- markwonVersion = ' 4.6.2'
140
-
141
- leakCanaryVersion = ' 2.12'
142
- stethoVersion = ' 1.6.0'
143
- }
144
-
145
133
configurations {
146
134
checkstyle
147
135
ktlint
@@ -151,7 +139,7 @@ checkstyle {
151
139
getConfigDirectory(). set(rootProject. file(" checkstyle" ))
152
140
ignoreFailures false
153
141
showViolations true
154
- toolVersion = checkstyleVersion
142
+ toolVersion = libs . versions . checkstyle . get()
155
143
}
156
144
157
145
tasks. register(' runCheckstyle' , Checkstyle ) {
@@ -193,11 +181,13 @@ tasks.register('formatKtlint', JavaExec) {
193
181
jvmArgs(" --add-opens" , " java.base/java.lang=ALL-UNNAMED" )
194
182
}
195
183
184
+ apply from : ' check-dependencies.gradle'
185
+
196
186
afterEvaluate {
197
187
if (! System . properties. containsKey(' skipFormatKtlint' )) {
198
188
preDebugBuild. dependsOn formatKtlint
199
189
}
200
- preDebugBuild. dependsOn runCheckstyle, runKtlint
190
+ preDebugBuild. dependsOn runCheckstyle, runKtlint, checkDependenciesOrder
201
191
}
202
192
203
193
sonar {
@@ -208,9 +198,20 @@ sonar {
208
198
}
209
199
}
210
200
201
+ kapt {
202
+ correctErrorTypes true
203
+ }
204
+
205
+ aboutLibraries {
206
+ // note: offline mode prevents the plugin from fetching licenses at build time, which would be
207
+ // harmful for reproducible builds
208
+ offlineMode = true
209
+ duplicationMode = DuplicateMode . MERGE
210
+ }
211
+
211
212
dependencies {
212
213
/* * Desugaring **/
213
- coreLibraryDesugaring ' com.android.tools:desugar_jdk_libs_nio:2.0.4 '
214
+ coreLibraryDesugaring libs . desugar . jdk . libs . nio
214
215
215
216
/* * NewPipe libraries **/
216
217
// You can use a local version by uncommenting a few lines in settings.gradle
@@ -222,109 +223,139 @@ dependencies {
222
223
// the corresponding commit hash, since JitPack is sometimes buggy
223
224
implementation ' com.github.MaintainTeam:LastPipeExtractor:6bf7594fbc59ba2c6372b71addbe31aa2e33118f'
224
225
implementation ' com.github.TeamNewPipe:NoNonsense-FilePicker:5.0.0'
226
+ // implementation libs.teamnewpipe.nanojson
227
+ // implementation libs.teamnewpipe.newpipe.extractor
228
+ // implementation libs.teamnewpipe.nononsense.filepicker
225
229
226
230
/* * Checkstyle **/
227
- checkstyle " com.puppycrawl. tools: checkstyle: ${ checkstyleVersion } "
228
- ktlint ' com.pinterest:ktlint:0.45.2 '
231
+ checkstyle libs . tools. checkstyle
232
+ ktlint libs . tools . ktlint
229
233
230
234
/* * Kotlin **/
231
- implementation " org.jetbrains. kotlin:kotlin- stdlib: ${ kotlin_version } "
235
+ implementation libs . kotlin. stdlib
232
236
233
237
/* * AndroidX **/
234
- implementation ' androidx.appcompat:appcompat:1.6.1'
235
- implementation ' androidx.cardview:cardview:1.0.0'
236
- implementation ' androidx.constraintlayout:constraintlayout:2.1.4'
237
- implementation ' androidx.core:core-ktx:1.12.0'
238
- implementation ' androidx.documentfile:documentfile:1.0.1'
239
- implementation ' androidx.fragment:fragment-ktx:1.6.2'
240
- implementation " androidx.lifecycle:lifecycle-livedata-ktx:${ androidxLifecycleVersion} "
241
- implementation " androidx.lifecycle:lifecycle-viewmodel-ktx:${ androidxLifecycleVersion} "
242
- implementation ' androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
243
- implementation ' androidx.media:media:1.7.0'
244
- implementation ' androidx.preference:preference:1.2.1'
245
- implementation ' androidx.recyclerview:recyclerview:1.3.2'
246
- implementation " androidx.room:room-runtime:${ androidxRoomVersion} "
247
- implementation " androidx.room:room-rxjava3:${ androidxRoomVersion} "
248
- kapt " androidx.room:room-compiler:${ androidxRoomVersion} "
249
- implementation ' androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
250
- // Newer version specified to prevent accessibility regressions with RecyclerView, see:
251
- // https://developer.android.com/jetpack/androidx/releases/viewpager2#1.1.0-alpha01
252
- implementation ' androidx.viewpager2:viewpager2:1.1.0-beta02'
253
- implementation " androidx.work:work-runtime-ktx:${ androidxWorkVersion} "
254
- implementation " androidx.work:work-rxjava3:${ androidxWorkVersion} "
255
- implementation ' com.google.android.material:material:1.11.0'
256
- implementation " androidx.webkit:webkit:1.9.0"
238
+ implementation libs. androidx. appcompat
239
+ implementation libs. androidx. cardview
240
+ implementation libs. androidx. constraintlayout
241
+ implementation libs. androidx. core. ktx
242
+ implementation libs. androidx. documentfile
243
+ implementation libs. androidx. fragment. compose
244
+ implementation libs. androidx. lifecycle. livedata
245
+ implementation libs. androidx. lifecycle. viewmodel
246
+ implementation libs. androidx. localbroadcastmanager
247
+ implementation libs. androidx. media
248
+ implementation libs. androidx. preference
249
+ implementation libs. androidx. recyclerview
250
+ implementation libs. androidx. room. runtime
251
+ implementation libs. androidx. room. rxjava3
252
+ kapt libs. androidx. room. compiler
253
+ implementation libs. androidx. swiperefreshlayout
254
+ implementation libs. androidx. work. runtime
255
+ implementation libs. androidx. work. rxjava3
256
+ implementation libs. androidx. material
257
+ implementation libs. androidx. webkit
257
258
258
259
/* * Third-party libraries **/
259
260
// Instance state boilerplate elimination
260
- implementation ' com.github. livefront:bridge:v2.0.2 '
261
- implementation " com.evernote: android- state: $s tateSaverVersion "
262
- kapt " com.evernote: android- state- processor: $s tateSaverVersion "
261
+ implementation libs . livefront. bridge
262
+ implementation libs . android. state
263
+ kapt libs . android. state. processor
263
264
264
265
// HTML parser
265
- implementation " org .jsoup:jsoup:1.17.2 "
266
+ implementation libs . jsoup
266
267
267
268
// HTTP client
268
- implementation " com.squareup.okhttp3: okhttp:4.12.0 "
269
+ implementation libs . okhttp
269
270
270
271
// Media player
271
- implementation " com.google.android. exoplayer:exoplayer- core: ${ exoPlayerVersion } "
272
- implementation " com.google.android. exoplayer:exoplayer- dash: ${ exoPlayerVersion } "
273
- implementation " com.google.android. exoplayer:exoplayer- database: ${ exoPlayerVersion } "
274
- implementation " com.google.android. exoplayer:exoplayer- datasource: ${ exoPlayerVersion } "
275
- implementation " com.google.android. exoplayer:exoplayer- hls: ${ exoPlayerVersion } "
276
- implementation " com.google.android. exoplayer:exoplayer- smoothstreaming: ${ exoPlayerVersion } "
277
- implementation " com.google.android. exoplayer:exoplayer-ui: ${ exoPlayerVersion } "
278
- implementation " com.google.android.exoplayer: extension- mediasession: ${ exoPlayerVersion } "
272
+ implementation libs . exoplayer. core
273
+ implementation libs . exoplayer. dash
274
+ implementation libs . exoplayer. database
275
+ implementation libs . exoplayer. datasource
276
+ implementation libs . exoplayer. hls
277
+ implementation libs . exoplayer. smoothstreaming
278
+ implementation libs . exoplayer. ui
279
+ implementation libs . extension. mediasession
279
280
280
281
// Metadata generator for service descriptors
281
- compileOnly " com.google. auto.service:auto-service-annotations: ${ googleAutoServiceVersion } "
282
- kapt " com.google. auto.service:auto-service: ${ googleAutoServiceVersion } "
282
+ compileOnly libs . auto. service
283
+ kapt libs . auto. service. kapt
283
284
284
285
// Manager for complex RecyclerView layouts
285
- implementation " com.github. lisawray.groupie:groupie: ${ groupieVersion } "
286
- implementation " com.github. lisawray.groupie:groupie- viewbinding: ${ groupieVersion } "
286
+ implementation libs . lisawray. groupie
287
+ implementation libs . lisawray. groupie. viewbinding
287
288
288
289
// Image loading
289
- // noinspection GradleDependency --> 2.8 is the last version, not 2.71828!
290
- implementation " com.squareup.picasso:picasso:2.8 "
290
+ implementation libs . coil . compose
291
+ implementation libs . coil . network . okhttp
291
292
292
293
// Markdown library for Android
293
- implementation " io.noties. markwon: core: ${ markwonVersion } "
294
- implementation " io.noties. markwon: linkify: ${ markwonVersion } "
294
+ implementation libs . markwon. core
295
+ implementation libs . markwon. linkify
295
296
296
297
// Crash reporting
297
- implementation " ch .acra:acra-core:5.11.3 "
298
+ implementation libs . acra. core
298
299
299
300
// Properly restarting
300
- implementation ' com.jakewharton: process-phoenix:2.1.2 '
301
+ implementation libs . process. phoenix
301
302
302
303
// Reactive extensions for Java VM
303
- implementation " io.reactivex. rxjava3:rxjava:3.1.8 "
304
- implementation " io.reactivex. rxjava3:rxandroid:3.0.2 "
304
+ implementation libs . rxjava3. rxjava
305
+ implementation libs . rxjava3. rxandroid
305
306
// RxJava binding APIs for Android UI widgets
306
- implementation " com.jakewharton. rxbinding4:rxbinding:4.0.0 "
307
+ implementation libs . rxbinding4. rxbinding
307
308
308
309
// Date and time formatting
309
- implementation " org.ocpsoft.prettytime:prettytime:5.0.8.Final"
310
+ implementation libs. prettytime
311
+
312
+ // Jetpack Compose
313
+ implementation(platform(libs. androidx. compose. bom))
314
+ implementation libs. androidx. compose. material3
315
+ implementation libs. androidx. compose. adaptive
316
+ implementation libs. androidx. activity. compose
317
+ implementation libs. androidx. compose. ui. tooling. preview
318
+ implementation libs. androidx. lifecycle. viewmodel. compose
319
+ implementation libs. androidx. compose. ui. text // Needed for parsing HTML to AnnotatedString
320
+ implementation libs. androidx. compose. material. icons. extended
321
+
322
+ // Jetpack Compose related dependencies
323
+ implementation libs. androidx. paging. compose
324
+ implementation libs. androidx. navigation. compose
325
+
326
+ // Coroutines interop
327
+ implementation libs. kotlinx. coroutines. rx3
328
+
329
+ // Library loading for About screen
330
+ implementation libs. aboutlibraries. compose. m3
331
+
332
+ // Hilt
333
+ implementation libs. hilt. android
334
+ kapt(libs. hilt. compiler)
335
+
336
+ // Scroll
337
+ implementation libs. lazycolumnscrollbar
310
338
311
339
/* * Debugging **/
312
340
// Memory leak detection
313
- debugImplementation " com.squareup. leakcanary:leakcanary- object- watcher-android: ${ leakCanaryVersion } "
314
- debugImplementation " com.squareup. leakcanary: plumber- android: ${ leakCanaryVersion } "
315
- debugImplementation " com.squareup. leakcanary:leakcanary- android- core: ${ leakCanaryVersion } "
341
+ debugImplementation libs . leakcanary. object. watcher
342
+ debugImplementation libs . leakcanary. plumber. android
343
+ debugImplementation libs . leakcanary. android. core
316
344
// Debug bridge for Android
317
- debugImplementation " com.facebook.stetho:stetho:${ stethoVersion} "
318
- debugImplementation " com.facebook.stetho:stetho-okhttp3:${ stethoVersion} "
345
+ debugImplementation libs. stetho
346
+ debugImplementation libs. stetho. okhttp3
347
+
348
+ // Jetpack Compose
349
+ debugImplementation libs. androidx. compose. ui. tooling
319
350
320
351
/* * Testing **/
321
- testImplementation ' junit:junit:4.13.2 '
322
- testImplementation ' org .mockito:mockito-core:5.6.0 '
352
+ testImplementation libs . junit
353
+ testImplementation libs . mockito. core
323
354
324
- androidTestImplementation " androidx.test.ext: junit:1.1.5 "
325
- androidTestImplementation " androidx.test: runner:1.5.2 "
326
- androidTestImplementation " androidx.room:room- testing: ${ androidxRoomVersion } "
327
- androidTestImplementation " org .assertj:assertj-core:3.24.2 "
355
+ androidTestImplementation libs . androidx. junit
356
+ androidTestImplementation libs . androidx. runner
357
+ androidTestImplementation libs . androidx. room. testing
358
+ androidTestImplementation libs . assertj. core
328
359
}
329
360
330
361
static String getGitWorkingBranch () {
0 commit comments