Skip to content

Commit 15b5cef

Browse files
authored
Merge pull request #13136 from TeamNewPipe/agp9
Upgrade Android Gradle Plugin to 9.0.0
2 parents 739b6ae + a7aad63 commit 15b5cef

4 files changed

Lines changed: 25 additions & 15 deletions

File tree

app/build.gradle.kts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
* SPDX-License-Identifier: GPL-3.0-or-later
44
*/
55

6+
import com.android.build.api.dsl.ApplicationExtension
7+
68
plugins {
79
alias(libs.plugins.android.application)
8-
alias(libs.plugins.jetbrains.kotlin.android)
9-
alias(libs.plugins.jetbrains.kotlin.kapt)
10+
alias(libs.plugins.android.legacy.kapt)
1011
alias(libs.plugins.google.ksp)
1112
alias(libs.plugins.jetbrains.kotlin.parcelize)
1213
alias(libs.plugins.sonarqube)
@@ -32,7 +33,7 @@ kotlin {
3233
}
3334
}
3435

35-
android {
36+
configure<ApplicationExtension> {
3637
compileSdk = 36
3738
namespace = "org.schabi.newpipe"
3839

@@ -78,7 +79,10 @@ android {
7879
}
7980
isMinifyEnabled = true
8081
isShrinkResources = false // disabled to fix F-Droid"s reproducible build
81-
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
82+
proguardFiles(
83+
getDefaultProguardFile("proguard-android-optimize.txt"),
84+
"proguard-rules.pro"
85+
)
8286
}
8387
}
8488

@@ -100,7 +104,7 @@ android {
100104

101105
sourceSets {
102106
getByName("androidTest") {
103-
assets.srcDir("$projectDir/schemas")
107+
assets.directories += "$projectDir/schemas"
104108
}
105109
}
106110

@@ -111,6 +115,7 @@ android {
111115
buildFeatures {
112116
viewBinding = true
113117
buildConfig = true
118+
resValues = true
114119
}
115120

116121
packaging {

build.gradle.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
* SPDX-License-Identifier: GPL-3.0-or-later
44
*/
55

6+
buildscript {
7+
dependencies {
8+
// https://developer.android.com/build/releases/agp-9-0-0-release-notes#runtime-dependency-on-kotlin-gradle-plugin-upgrade
9+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}")
10+
}
11+
}
12+
613
plugins {
714
alias(libs.plugins.android.application) apply false
8-
alias(libs.plugins.jetbrains.kotlin.android) apply false
9-
alias(libs.plugins.jetbrains.kotlin.kapt) apply false
15+
alias(libs.plugins.android.legacy.kapt) apply false
1016
alias(libs.plugins.google.ksp) apply false
1117
alias(libs.plugins.jetbrains.kotlin.parcelize) apply false
1218
alias(libs.plugins.sonarqube) apply false

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
android.enableJetifier=false
21
android.nonFinalResIds=false
3-
android.nonTransitiveRClass=true
4-
android.useAndroidX=true
52
org.gradle.jvmargs=-Xmx2048M --add-opens jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
63
systemProp.file.encoding=utf-8
74

85
# https://docs.gradle.org/current/userguide/configuration_cache.html
96
org.gradle.configuration-cache=true
7+
android.enableAppCompileTimeRClass=false
8+
android.r8.strictFullModeForKeepRules=false
9+
android.r8.optimizedResourceShrinking=false

gradle/libs.versions.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[versions]
77
acra = "5.13.1"
8-
agp = "8.13.2"
8+
agp = "9.0.0"
99
appcompat = "1.7.1"
1010
assertj = "3.27.6"
1111
autoservice-google = "1.1.1"
@@ -23,8 +23,8 @@ groupie = "2.10.1"
2323
jsoup = "1.22.1"
2424
junit = "4.13.2"
2525
junit-ext = "1.3.0"
26-
kotlin = "2.2.21"
27-
ksp = "2.3.4"
26+
kotlin = "2.3.0"
27+
ksp = "2.3.5"
2828
ktlint = "1.8.0"
2929
leakcanary = "2.14"
3030
lifecycle = "2.9.4" # Newer versions require minSdk >= 23
@@ -132,8 +132,7 @@ zacsweers-autoservice-compiler = { module = "dev.zacsweers.autoservice:auto-serv
132132

133133
[plugins]
134134
android-application = { id = "com.android.application", version.ref = "agp" }
135+
android-legacy-kapt = { id = "com.android.legacy-kapt", version.ref = "agp" } # Needed for statesaver
135136
google-ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
136-
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
137-
jetbrains-kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } # Needed for statesaver
138137
jetbrains-kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
139138
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }

0 commit comments

Comments
 (0)