Skip to content

Commit 40d1b11

Browse files
feat: upgrade to AGP 9.0.0, Gradle 9.1.0, Kotlin 2.3.0
- Update AGP 8.13.0 -> 9.0.0 - Update Gradle 8.14.3 -> 9.1.0 - Update Kotlin 2.2.20 -> 2.3.0 - Update ASM 9.9 -> 9.9.1 - Update maven-publish 0.34.0 -> 0.36.0 - Update lsplugin-publish 1.1 -> 1.3 - Fix deprecated capitalize() usage - Fix circular dependency in library projects with AGP 9 Signed-off-by: androidacy-user <opensource@androidacy.com>
1 parent 40cb6f3 commit 40d1b11

File tree

12 files changed

+47
-45
lines changed

12 files changed

+47
-45
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin
44

55
plugins {
66
alias(libs.plugins.kotlin) apply false
7-
id("com.vanniktech.maven.publish") version "0.34.0" apply false
7+
id("com.vanniktech.maven.publish") version "0.36.0" apply false
88
}
99

1010

1111
allprojects {
1212
group = "com.androidacy.lsparanoid"
13-
version = "0.10.3"
13+
version = "0.11.0"
1414

1515
plugins.withType(JavaPlugin::class.java) {
1616
extensions.configure(JavaPluginExtension::class.java) {

gradle-plugin/src/main/java/com/androidacy/lsparanoid/plugin/LSParanoidPlugin.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,21 @@ class LSParanoidPlugin : Plugin<Project> {
6464
task.configure { taskObj ->
6565
// Use Android's task providers instead of filtering by name
6666
val javaCompileTask = variant.sources.java?.let {
67-
project.tasks.named("compile${variant.name.capitalize()}JavaWithJavac")
67+
project.tasks.named("compile${variant.name.replaceFirstChar { c -> c.uppercase() }}JavaWithJavac")
6868
}
6969
if (javaCompileTask != null) {
7070
taskObj.dependsOn(javaCompileTask)
7171
}
7272

73-
// For Kotlin, we can use a similar approach if available
74-
project.tasks.matching { it is KotlinCompilationTask<*> &&
75-
it.name.contains(variant.name, ignoreCase = true)
76-
}.forEach {
77-
taskObj.dependsOn(it)
78-
taskObj.mustRunAfter(it)
79-
}
73+
// For Kotlin, depend only on the main source compilation task (not test tasks)
74+
// The task name follows pattern: compile<VariantName>Kotlin
75+
val variantCapitalized = variant.name.replaceFirstChar { c -> c.uppercase() }
76+
val kotlinTaskName = "compile${variantCapitalized}Kotlin"
77+
project.tasks.matching { it is KotlinCompilationTask<*> && it.name == kotlinTaskName }
78+
.forEach {
79+
taskObj.dependsOn(it)
80+
taskObj.mustRunAfter(it)
81+
}
8082
}
8183
}
8284
}

gradle/libs.versions.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[versions]
2-
agp = "8.13.0"
3-
kotlin = "2.2.20"
2+
agp = "9.0.0"
3+
kotlin = "2.3.0"
44

55
[plugins]
66
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
7-
lsplugin-publish = { id = "org.lsposed.lsplugin.publish", version = "1.1" }
7+
lsplugin-publish = { id = "org.lsposed.lsplugin.publish", version = "1.3" }
88

99
[libraries]
1010
agp-api = { group = "com.android.tools.build", name = "gradle-api", version.ref = "agp" }
1111
grip = { group = "com.joom.grip", name = "grip", version = "0.9.1" }
12-
asm-common = { group = "org.ow2.asm", name = "asm-commons", version = "9.9" }
12+
asm-common = { group = "org.ow2.asm", name = "asm-commons", version = "9.9.1" }
1313
kotlin-api = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin-api", version.ref = "kotlin" }

gradle/wrapper/gradle-wrapper.jar

2.65 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id("com.android.application") version "8.13.0" apply false
3-
id("com.android.library") version "8.13.0" apply false
2+
id("com.android.application") version "9.0.0" apply false
3+
id("com.android.library") version "9.0.0" apply false
44
id("com.androidacy.lsparanoid") version "0.10.3" apply false
55
}

samples/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

testApp/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id("com.android.application") version "8.13.0"
2+
id("com.android.application") version "9.0.0"
33
id("com.androidacy.lsparanoid") version "0.10.3"
44
}
55

@@ -58,7 +58,7 @@ dependencies {
5858
implementation("com.androidacy.lsparanoid:core:0.10.3")
5959

6060
// Kotlin stdlib needed for annotations used by lsparanoid
61-
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:2.2.20")
61+
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:2.3.0")
6262

6363
// Testing dependencies
6464
androidTestImplementation("androidx.test.ext:junit:1.1.5")

0 commit comments

Comments
 (0)