Skip to content

Commit e156df4

Browse files
Align ASM and Kotlin stdlib versions across modules (#7474)
The classpath partition cache (~/.rewrite/classpath/.partitions) keys by exact GAV, so each distinct resolved version of an artifact produces its own partition file. Two sources of accidental version drift across the multi-module build were each producing duplicate partitions: - ASM: gizmo (in rewrite-core) pins asm-util/-tree/-analysis to 9.3 transitively. rewrite-java requests asm/asm-util at latest.release as `implementation`, but that does not propagate to project consumers, so modules consuming :rewrite-java (rewrite-java-21/-25, rewrite-yaml/json/ etc.) keep the 9.3 transitive while still bumping `asm` itself to 9.9.1. Declaring all four asm artifacts at latest.release in rewrite-core (where gizmo lives) lets conflict resolution bump them in lockstep everywhere. - Kotlin stdlib: rewrite-kotlin's clikt 3.5.0, rewrite-gradle's mockwebserver 4.x, and rewrite-maven's maven-resolver each drag the deprecated kotlin-stdlib-jdk7/-jdk8/-common artifacts in at older versions (1.6.20 / 1.9.10 / 1.8.21) that the main kotlin-stdlib does not align. Applying kotlin-bom as a test platform constrains the whole family to a single Kotlin version per module.
1 parent 4687514 commit e156df4

4 files changed

Lines changed: 22 additions & 0 deletions

File tree

rewrite-core/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ dependencies {
66
api("org.openrewrite.tools:jgit:latest.release")
77
implementation("org.openrewrite.tools:java-object-diff:latest.release")
88
implementation("io.quarkus.gizmo:gizmo:1.0.+")
9+
// Align the four org.ow2.asm artifacts to one version everywhere; gizmo
10+
// would otherwise pin -util/-tree/-analysis to 9.3 in modules that don't
11+
// request them directly.
12+
implementation("org.ow2.asm:asm:latest.release")
13+
implementation("org.ow2.asm:asm-util:latest.release")
14+
implementation("org.ow2.asm:asm-tree:latest.release")
15+
implementation("org.ow2.asm:asm-analysis:latest.release")
916
api("com.fasterxml.jackson.core:jackson-core")
1017
api("com.fasterxml.jackson.core:jackson-databind")
1118
api("com.fasterxml.jackson.dataformat:jackson-dataformat-smile")

rewrite-gradle/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ dependencies {
6060
// No particular reason to hold back upgrading this beyond 3.x, but it takes some effort: https://github.com/openrewrite/rewrite/issues/5270
6161
compileOnly("com.gradle:develocity-gradle-plugin:3.+")
6262

63+
// Align kotlin-stdlib-jdk7/-jdk8/-common with kotlin-stdlib
64+
// (mockwebserver 4.x would otherwise pin them to 1.9.10 transitively).
65+
testImplementation(platform("org.jetbrains.kotlin:kotlin-bom:2.3.20"))
66+
6367
testImplementation(project(":rewrite-test")) {
6468
// because gradle-api fatjars this implementation already
6569
exclude("ch.qos.logback", "logback-classic")

rewrite-kotlin/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ plugins {
55
kotlin("jvm") version "2.2.21"
66
}
77

8+
// When bumping this version, also update the kotlin-bom platform version
9+
// in rewrite-gradle/build.gradle.kts and rewrite-maven/build.gradle.kts so
10+
// the kotlin-stdlib alignment stays in lockstep across modules.
811
val kotlinVersion = "2.3.20"
912

1013
dependencies {
@@ -13,6 +16,10 @@ dependencies {
1316

1417
implementation(project(":rewrite-java"))
1518

19+
// Align kotlin-stdlib-jdk7/-jdk8/-common with kotlin-stdlib (clikt 3.5.0
20+
// would otherwise drag the jdk7/jdk8/common artifacts back to 1.6.20).
21+
testImplementation(platform("org.jetbrains.kotlin:kotlin-bom:$kotlinVersion"))
22+
1623
implementation(kotlin("compiler-embeddable", kotlinVersion))
1724
implementation(kotlin("reflect", kotlinVersion))
1825
implementation(kotlin("stdlib", kotlinVersion))

rewrite-maven/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ dependencies {
3535

3636
implementation("org.apache.commons:commons-text:latest.release")
3737

38+
// Align kotlin-stdlib-jdk7/-jdk8/-common with kotlin-stdlib
39+
// (maven-resolver and friends would otherwise pull mixed 1.8.21/1.9.x stdlibs).
40+
testImplementation(platform("org.jetbrains.kotlin:kotlin-bom:2.3.20"))
41+
3842
testImplementation(project(":rewrite-test"))
3943

4044
testImplementation("com.squareup.okhttp3:okhttp:4.+")

0 commit comments

Comments
 (0)