Skip to content

Commit ecb0dcb

Browse files
authored
Migrate from BCV to abiValidation (#4487)
* Remove obsolete asm dependency that BCV relied on
1 parent 6f0fb66 commit ecb0dcb

File tree

6 files changed

+27
-16
lines changed

6 files changed

+27
-16
lines changed

build.gradle.kts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ buildscript {
2323
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${version("kotlin")}")
2424
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${version("dokka")}")
2525
classpath("org.jetbrains.kotlinx:kotlinx-knit:${version("knit")}")
26-
classpath("org.jetbrains.kotlinx:binary-compatibility-validator:${version("binary_compatibility_validator")}")
2726
classpath("ru.vyarus:gradle-animalsniffer-plugin:${version("animalsniffer")}") // Android API check
2827
classpath("org.jetbrains.kotlin:atomicfu:${version("kotlin")}")
2928
classpath("org.jetbrains.kotlinx:kover-gradle-plugin:${version("kover")}")
@@ -62,21 +61,9 @@ allprojects {
6261
}
6362
}
6463

65-
plugins {
66-
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.16.2"
67-
}
68-
6964
apply(plugin = "base")
7065
apply(plugin = "kover-conventions")
7166

72-
apiValidation {
73-
ignoredProjects += unpublished + listOf("kotlinx-coroutines-bom")
74-
@OptIn(kotlinx.validation.ExperimentalBCVApi::class)
75-
klib {
76-
enabled = true
77-
}
78-
}
79-
8067
// Configure repositories
8168
allprojects {
8269
repositories {

buildSrc/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ dependencies {
6161
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk7")
6262
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
6363
}
64-
// Force ASM version, otherwise the one from animalsniffer wins (which is too low for BCV)
65-
implementation("org.ow2.asm:asm:9.6")
64+
6665
implementation("ru.vyarus:gradle-animalsniffer-plugin:${version("animalsniffer")}") // Android API check
6766
implementation("org.jetbrains.kotlinx:kover-gradle-plugin:${version("kover")}") {
6867
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")

buildSrc/src/main/kotlin/Projects.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ val unpublished = setOf("kotlinx.coroutines", "benchmarks", "android-unit-tests"
3737
val Project.isMultiplatform: Boolean get() = name in setOf(coreModule, "kotlinx-coroutines-test", testUtilsModule)
3838
val Project.isBom: Boolean get() = name == "kotlinx-coroutines-bom"
3939

40+
val Project.abiCheckEnabled get() = name !in unpublished + "kotlinx-coroutines-bom"
41+
4042
// Projects that we do not check for Android API level 14 check due to various limitations
4143
val androidNonCompatibleProjects = setOf(
4244
"kotlinx-coroutines-debug",

buildSrc/src/main/kotlin/kotlin-jvm-conventions.gradle.kts

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

33
import org.gradle.api.*
44
import org.jetbrains.kotlin.gradle.dsl.*
5+
import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation
56

67
plugins {
78
kotlin("jvm")
@@ -13,6 +14,11 @@ java {
1314
}
1415

1516
kotlin {
17+
@OptIn(ExperimentalAbiValidation::class)
18+
abiValidation {
19+
enabled = abiCheckEnabled
20+
}
21+
1622
compilerOptions {
1723
jvmTarget = JvmTarget.JVM_1_8
1824
configureGlobalKotlinArgumentsAndOptIns()
@@ -37,3 +43,7 @@ tasks.withType<Test> {
3743
val stressTest = project.properties["stressTest"]
3844
if (stressTest != null) systemProperties["stressTest"] = stressTest
3945
}
46+
47+
tasks.check {
48+
dependsOn(tasks.checkLegacyAbi)
49+
}

buildSrc/src/main/kotlin/kotlin-multiplatform-conventions.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import org.gradle.api.tasks.testing.logging.*
22
import org.jetbrains.kotlin.gradle.dsl.*
3+
import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation
34

45
plugins {
56
kotlin("multiplatform")
@@ -11,6 +12,15 @@ java {
1112
}
1213

1314
kotlin {
15+
@OptIn(ExperimentalAbiValidation::class)
16+
abiValidation {
17+
enabled = abiCheckEnabled
18+
19+
klib {
20+
enabled = true
21+
}
22+
}
23+
1424
jvm {
1525
compilations.all {
1626
compileTaskProvider.configure {
@@ -150,3 +160,7 @@ tasks.named("jvmTest", Test::class) {
150160
}
151161
project.properties["stressTest"]?.let { systemProperty("stressTest", it) }
152162
}
163+
164+
tasks.check {
165+
dependsOn(tasks.checkLegacyAbi)
166+
}

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ rxjava2_version=2.2.8
2626
rxjava3_version=3.0.2
2727
javafx_version=17.0.2
2828
javafx_plugin_version=0.0.8
29-
binary_compatibility_validator_version=0.16.2
3029
kover_version=0.8.0-Beta2
3130
blockhound_version=1.0.8.RELEASE
3231
jna_version=5.9.0

0 commit comments

Comments
 (0)