diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 73f83958..9db88388 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,5 +48,5 @@ to Gradle (in Preferences -> Build, Execution, Deployment -> Build Tools -> Grad ### Updating the public API dump * Use the [Binary Compatibility Validator](https://github.com/Kotlin/binary-compatibility-validator/blob/master/README.md) for updates to public API: - * Run `./gradlew apiDump` to update API index files. + * Run `./gradlew updateLegacyAbi` to update API index files. * Commit the updated API indexes together with other changes. diff --git a/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-compatibility.gradle.kts b/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-compatibility.gradle.kts new file mode 100644 index 00000000..1eb44ce9 --- /dev/null +++ b/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-compatibility.gradle.kts @@ -0,0 +1,21 @@ +/* + * Copyright 2010-2025 JetBrains s.r.o. and respective authors and developers. + * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file. + */ + +import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation + +plugins { + kotlin("multiplatform") +} + +kotlin { + @OptIn(ExperimentalAbiValidation::class) + abiValidation { + enabled = true + } +} + +tasks.check { + dependsOn(tasks.checkLegacyAbi) +} diff --git a/build.gradle.kts b/build.gradle.kts index 2ce0547f..0f855cb7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,14 +4,11 @@ */ import kotlinx.kover.gradle.plugin.dsl.CoverageUnit -import kotlinx.validation.ExperimentalBCVApi plugins { id("kotlinx-io-publish") apply false id("kotlinx-io-dokka") - alias(libs.plugins.kover) - alias(libs.plugins.bcv) } allprojects { @@ -21,15 +18,6 @@ allprojects { } } -@OptIn(ExperimentalBCVApi::class) -apiValidation { - ignoredProjects.addAll(listOf( - "kotlinx-io-benchmarks", - "kotlinx-io-smoke-tests" - )) - klib.enabled = true -} - dependencies { kover(project(":kotlinx-io-core")) kover(project(":kotlinx-io-bytestring")) diff --git a/bytestring/build.gradle.kts b/bytestring/build.gradle.kts index 77af1c57..a72168da 100644 --- a/bytestring/build.gradle.kts +++ b/bytestring/build.gradle.kts @@ -3,6 +3,7 @@ plugins { id("kotlinx-io-publish") id("kotlinx-io-dokka") id("kotlinx-io-android-compat") + id("kotlinx-io-compatibility") alias(libs.plugins.kover) } diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 27d07702..2799ec44 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -11,6 +11,7 @@ plugins { id("kotlinx-io-publish") id("kotlinx-io-dokka") id("kotlinx-io-android-compat") + id("kotlinx-io-compatibility") alias(libs.plugins.kover) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4602156c..fadc31e6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -24,5 +24,4 @@ okio = { group = "com.squareup.okio", name = "okio", version.ref = "okio" } dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } -bcv = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "bcv" } kotlinx-benchmark-plugin = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "benchmark"} diff --git a/integration/kotlinx-io-okio/build.gradle.kts b/integration/kotlinx-io-okio/build.gradle.kts index c756418d..b02046cd 100644 --- a/integration/kotlinx-io-okio/build.gradle.kts +++ b/integration/kotlinx-io-okio/build.gradle.kts @@ -1,7 +1,3 @@ -import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.dokka.gradle.DokkaTaskPartial -import java.net.URL - /* * Copyright 2010-2024 JetBrains s.r.o. and respective authors and developers. * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file. @@ -11,6 +7,7 @@ plugins { id("kotlinx-io-multiplatform") id("kotlinx-io-publish") id("kotlinx-io-dokka") + id("kotlinx-io-compatibility") alias(libs.plugins.kover) } @@ -49,4 +46,3 @@ dokka { } } } -