Skip to content

Commit fd04485

Browse files
committed
Upgrade gradle wrapper
* Upgrade `gradle wrapper --gradle-version 9.1.0` * Move plugins from legacy buildscript block to plugins * Centralize repository management in settings.gradle.kts (default for new A.S. projects) * Use alias() to import plugins info from version catalog libs.versions.toml
1 parent 28f044a commit fd04485

File tree

10 files changed

+301
-197
lines changed

10 files changed

+301
-197
lines changed

app/build.gradle.kts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
55
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
66

77
plugins {
8-
id("com.android.application")
9-
id("kotlin-android")
10-
id("org.jetbrains.dokka")
11-
8+
alias(libs.plugins.android.application)
9+
alias(libs.plugins.dokka.gradle.plugin)
10+
alias(libs.plugins.kotlin.android)
1211
}
1312

1413
val javaTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get())

build.gradle.kts

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
1-
buildscript {
2-
repositories {
3-
google()
4-
mavenCentral()
5-
}
6-
7-
dependencies {
8-
classpath(libs.gradle)
9-
classpath(libs.jetbrains.kotlin.gradle.plugin)
10-
classpath(libs.dokka.gradle.plugin)
11-
// Universal build config
12-
classpath(libs.buildkonfig.gradle.plugin)
13-
}
1+
plugins {
2+
alias(libs.plugins.android.application) apply false
3+
alias(libs.plugins.android.library) apply false
4+
alias(libs.plugins.buildkonfig.gradle.plugin) apply false // Universal build config
5+
alias(libs.plugins.dokka.gradle.plugin) apply false
6+
alias(libs.plugins.kotlin.android) apply false
7+
alias(libs.plugins.kotlin.jvm) apply false
8+
alias(libs.plugins.kotlin.multiplatform) apply false
149
}
1510

16-
allprojects {
17-
repositories {
18-
google()
19-
mavenCentral()
20-
mavenLocal()
21-
maven("https://jitpack.io")
22-
}
23-
24-
// https://docs.gradle.org/current/userguide/upgrading_major_version_9.html#test_task_fails_when_no_tests_are_discovered
25-
tasks.withType<AbstractTestTask>().configureEach {
26-
failOnNoDiscoveredTests = false
27-
}
28-
}
11+
// https://docs.gradle.org/current/userguide/upgrading_major_version_9.html#test_task_fails_when_no_tests_are_discovered
12+
tasks.withType<AbstractTestTask>().configureEach {
13+
failOnNoDiscoveredTests = false
14+
}

docs/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
kotlin("jvm")
3-
id("org.jetbrains.dokka")
2+
alias(libs.plugins.kotlin.jvm)
3+
alias(libs.plugins.dokka.gradle.plugin)
44
}
55

66
dependencies {

gradle/libs.versions.toml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1+
# https://docs.gradle.org/current/userguide/plugins.html#sec:version_catalog_plugin_application
2+
# https://docs.gradle.org/current/userguide/dependency_versions.html#sec:strict-version
13
[versions]
24
acraCore = "5.13.1"
5+
androidGradlePlugin = "8.13.0"
36
appcompat = "1.7.1"
47
biometric = "1.4.0-alpha04"
58
buildkonfigGradlePlugin = "0.17.1"
69
coil = "3.3.0"
710
colorpicker = "6b46b49bd5"
8-
conscryptAndroid = "2.5.2"
11+
conscryptAndroid = "2.5.3"
912
constraintlayout = "2.2.1"
1013
coreKtx = "1.17.0"
1114
desugar_jdk_libs_nio = "2.1.5"
12-
dokkaGradlePlugin = "2.0.0"
15+
dokkaGradlePlugin = "2.1.0"
1316
espressoCore = "3.7.0"
1417
fuzzywuzzy = "1.4.0"
15-
gradle = "8.13.0"
16-
jacksonModuleKotlin = "2.13.1"
18+
jacksonModuleKotlin = { strictly = "2.13.1" } # do not upgrade above 2.13.1, Crashes on Android TV's and FireSticks that have Min API Level 25 or Less.
1719
json = "20250517"
1820
junit = "4.13.2"
1921
junitKtx = "1.3.0"
2022
junitVersion = "1.3.0"
2123
juniversalchardet = "2.5.0"
22-
kotlinGradlePluginVersion = "2.2.20"
24+
kotlinGradlePlugin = "2.2.20"
2325
kotlinxCoroutinesCore = "1.10.2"
2426
lifecycleLivedataKtx = "2.9.4"
2527
lifecycleViewmodelKtx = "2.9.4"
@@ -55,22 +57,19 @@ acra-core = { module = "ch.acra:acra-core", version.ref = "acraCore" }
5557
acra-toast = { module = "ch.acra:acra-toast", version.ref = "acraCore" }
5658
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
5759
biometric = { module = "androidx.biometric:biometric", version.ref = "biometric" }
58-
buildkonfig-gradle-plugin = { module = "com.codingfeline.buildkonfig:buildkonfig-gradle-plugin", version.ref = "buildkonfigGradlePlugin" }
5960
coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }
6061
coil-network-okhttp = { module = "io.coil-kt.coil3:coil-network-okhttp", version.ref = "coil" }
6162
colorpicker = { module = "com.github.recloudstream:color-picker-android", version.ref = "colorpicker" }
6263
conscrypt-android = { module = "org.conscrypt:conscrypt-android", version.ref = "conscryptAndroid" }
6364
constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
6465
core = { module = "androidx.test:core" }
6566
core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
67+
databinding = { module = "androidx.databinding:viewbinding", version.ref = "androidGradlePlugin" }
6668
desugar_jdk_libs_nio = { module = "com.android.tools:desugar_jdk_libs_nio", version.ref = "desugar_jdk_libs_nio" }
67-
dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokkaGradlePlugin" }
6869
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
6970
ext-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" }
7071
fuzzywuzzy = { module = "me.xdrop:fuzzywuzzy", version.ref = "fuzzywuzzy" }
71-
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
7272
jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jacksonModuleKotlin" }
73-
jetbrains-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePluginVersion" }
7473
json = { module = "org.json:json", version.ref = "json" }
7574
junit = { module = "junit:junit", version.ref = "junit" }
7675
junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "junitKtx" }
@@ -81,6 +80,7 @@ lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx
8180
material = { module = "com.google.android.material:material", version.ref = "material" }
8281
media3-cast = { module = "androidx.media3:media3-cast", version.ref = "media3" }
8382
media3-common = { module = "androidx.media3:media3-common", version.ref = "media3" }
83+
media3-container = { module = "androidx.media3:media3-container ", version.ref = "media3" }
8484
media3-datasource-okhttp = { module = "androidx.media3:media3-datasource-okhttp", version.ref = "media3" }
8585
media3-exoplayer = { module = "androidx.media3:media3-exoplayer", version.ref = "media3" }
8686
media3-exoplayer-dash = { module = "androidx.media3:media3-exoplayer-dash", version.ref = "media3" }
@@ -98,8 +98,8 @@ palette-ktx = { module = "androidx.palette:palette-ktx", version.ref = "paletteK
9898
preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preferenceKtx" }
9999
previewseekbar-media3 = { module = "com.github.rubensousa:previewseekbar-media3", version.ref = "previewseekbarMedia3" }
100100
qrcode-kotlin = { module = "io.github.g0dkar:qrcode-kotlin", version.ref = "qrcodeKotlin" }
101-
rhino = { module = "org.mozilla:rhino", version.ref = "rhino" }
102101
quickjs = { module = "app.cash.quickjs:quickjs-android", version = "0.9.2" }
102+
rhino = { module = "org.mozilla:rhino", version.ref = "rhino" }
103103
safefile = { module = "com.github.LagradOst:SafeFile", version.ref = "safefile" }
104104
shimmer = { module = "com.facebook.shimmer:shimmer", version.ref = "shimmer" }
105105
swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefreshlayout" }
@@ -111,6 +111,15 @@ work-runtime = { module = "androidx.work:work-runtime", version.ref = "workRunti
111111
work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "workRuntimeKtx" }
112112

113113
[plugins]
114+
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
115+
android-gradle-plugin = { id = "com.android.tools.build", version.ref = "androidGradlePlugin" }
116+
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
117+
buildkonfig-gradle-plugin = { id = "com.codingfeline.buildkonfig", version.ref = "buildkonfigGradlePlugin" }
118+
dokka-gradle-plugin = { id = "org.jetbrains.dokka", version.ref = "dokkaGradlePlugin" }
119+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinGradlePlugin" }
120+
kotlin-gradle-plugin = { id = "org.jetbrains.kotlin", version.ref = "kotlinGradlePlugin" }
121+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm" , version.ref = "kotlinGradlePlugin" }
122+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlinGradlePlugin" }
114123

115124
[bundles]
116125
media3 = ["media3-cast", "media3-common", "media3-datasource-okhttp", "media3-exoplayer", "media3-exoplayer-dash", "media3-exoplayer-hls", "media3-session", "media3-ui"]

gradle/wrapper/gradle-wrapper.jar

-8.66 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
47
zipStorePath=wrapper/dists
5-
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)