Skip to content

Commit

Permalink
Hack the klib manifest version to work around KT-62515 (#1162)
Browse files Browse the repository at this point in the history
This is a big regression in Kotlin 1.9.20.
  • Loading branch information
squarejesse authored Nov 14, 2023
1 parent 7f81d12 commit d0ef724
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
import org.jetbrains.kotlin.gradle.tasks.CInteropProcess

buildscript {
repositories {
Expand Down Expand Up @@ -238,6 +239,17 @@ allprojects {
}
}

// Kotlin 1.9.20 started putting the library version in the klib manifest, but that broke resolution
// in downstream projects! Hack the klib library version to be 'unspecified', which is what the
// CInteropProcess task did in prior releases. https://youtrack.jetbrains.com/issue/KT-62515/
allprojects {
tasks.withType<CInteropProcess>().configureEach {
val libraryVersionField = CInteropProcess::class.java.getDeclaredField("libraryVersion")
libraryVersionField.isAccessible = true
libraryVersionField.set(this, "unspecified")
}
}

subprojects {
plugins.withId("binary-compatibility-validator") {
configure<ApiValidationExtension> {
Expand Down

0 comments on commit d0ef724

Please sign in to comment.