Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hack the klib manifest version to work around KT-62515 #1162

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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