Skip to content

Commit d75b142

Browse files
authored
Update to AGP 9 (#9264)
* Update to AGP 9 First milestone with compat workarounds in place.
1 parent 01655fa commit d75b142

File tree

6 files changed

+16
-25
lines changed

6 files changed

+16
-25
lines changed

android-test-app/build.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
plugins {
44
id("com.android.application")
5-
id("kotlin-android")
65
}
76

87
android {
@@ -23,16 +22,13 @@ android {
2322
sourceCompatibility(JavaVersion.VERSION_11)
2423
}
2524

26-
kotlinOptions {
27-
jvmTarget = JavaVersion.VERSION_11.toString()
28-
}
2925

3026
buildTypes {
3127
release {
3228
isShrinkResources = true
3329
isMinifyEnabled = true
3430
signingConfig = signingConfigs.getByName("debug")
35-
setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"))
31+
setProguardFiles(listOf(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"))
3632
testProguardFiles("test-proguard-rules.pro")
3733
}
3834
}

android-test/build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
plugins {
44
id("com.android.library")
5-
kotlin("android")
65
id("de.mannodermaus.android-junit5")
76
}
87

@@ -44,9 +43,6 @@ android {
4443
unitTests.isIncludeAndroidResources = true
4544
}
4645

47-
kotlinOptions {
48-
jvmTarget = JavaVersion.VERSION_11.toString()
49-
}
5046

5147
// issue merging due to conflict with httpclient and something else
5248
packagingOptions.resources.excludes += setOf(

build.gradle.kts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,6 @@ subprojects {
111111
}
112112
}
113113

114-
// Skip samples parent
115-
if (project.buildFile.exists() && project.name != "okhttp") {
116-
apply(plugin = "com.android.lint")
117-
118-
dependencies {
119-
"lintChecks"(rootProject.libs.androidx.lint.gradle)
120-
}
121-
}
122-
123114
tasks.withType<JavaCompile> {
124115
options.encoding = Charsets.UTF_8.toString()
125116
}
@@ -309,7 +300,7 @@ subprojects {
309300

310301
/** Configure publishing and signing for published Java and JavaPlatform subprojects. */
311302
subprojects {
312-
plugins.withId("com.vanniktech.maven.publish.base") {
303+
if (plugins.hasPlugin("com.vanniktech.maven.publish.base")) {
313304
if (dokkaBuild) {
314305
apply(plugin = "org.jetbrains.dokka")
315306

@@ -329,7 +320,7 @@ subprojects {
329320
url.set(URI.create("https://square.github.io/okio/3.x/okio/"))
330321
packageListUrl.set(URI.create("https://square.github.io/okio/3.x/okio/okio/package-list"))
331322
}
332-
323+
333324
externalDocumentationLinks.named("jdk") {
334325
url.set(URI.create("https://docs.oracle.com/en/java/javase/21/docs/api/"))
335326
packageListUrl.set(URI.create("https://docs.oracle.com/en/java/javase/21/docs/api/element-list"))
@@ -342,6 +333,15 @@ subprojects {
342333
}
343334
}
344335

336+
// Only enable lint checks for published modules
337+
if (project.name != "okhttp") {
338+
apply(plugin = "com.android.lint")
339+
340+
dependencies {
341+
"lintChecks"(rootProject.libs.androidx.lint.gradle)
342+
}
343+
}
344+
345345
configure<MavenPublishBaseExtension> {
346346
publishToMavenCentral(automaticRelease = true)
347347
signAllPublications()

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ okhttpDokka=false
1313

1414
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
1515

16+
# AGP 9.0 Workarounds
17+
android.builtInKotlin=false
18+
android.newDsl=false

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
agp = "8.13.1"
2+
agp = "9.0.0"
33
biz-aQute-bnd = "7.1.0"
44
checkStyle = "12.3.1"
55
com-squareup-moshi = "1.15.2"

regression-test/build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
plugins {
22
id("com.android.library")
3-
kotlin("android")
43
}
54

65
android {
@@ -24,9 +23,6 @@ android {
2423
sourceCompatibility(JavaVersion.VERSION_11)
2524
}
2625

27-
kotlinOptions {
28-
jvmTarget = JavaVersion.VERSION_11.toString()
29-
}
3026

3127
// issue merging due to conflict with httpclient and something else
3228
packagingOptions.resources.excludes += setOf(

0 commit comments

Comments
 (0)