File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed
libraries/tools/abi-validation/src/main/kotlin Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -38,17 +38,6 @@ public class BinaryCompatibilityValidatorPlugin : Plugin<Project> {
3838 for (project in ignored) {
3939 require(project in all) { " Cannot find excluded project $project in all projects: $all " }
4040 }
41- if (extension.klib.enabled) {
42- try {
43- LibraryAbiReader .javaClass
44- } catch (e: NoClassDefFoundError ) {
45- throw IllegalStateException (
46- " KLib validation is not available. " +
47- " Make sure the project uses at least Kotlin 1.9.20 or disable KLib validation " +
48- " by setting apiValidation.klib.enabled to false" , e
49- )
50- }
51- }
5241 }
5342 }
5443
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import org.gradle.api.file.RegularFileProperty
1111import org.gradle.api.provider.Property
1212import org.gradle.api.tasks.*
1313import org.gradle.workers.WorkAction
14+ import org.jetbrains.kotlin.library.abi.ExperimentalLibraryAbiReader
15+ import org.jetbrains.kotlin.library.abi.LibraryAbiReader
1416
1517/* *
1618 * Generates a text file with a KLib ABI dump for a single klib.
@@ -76,8 +78,18 @@ internal interface KlibAbiBuildParameters : BuildParametersBase {
7678}
7779
7880internal abstract class KlibAbiBuildWorker : WorkAction <KlibAbiBuildParameters > {
79- @OptIn(ExperimentalBCVApi ::class )
81+ @OptIn(ExperimentalBCVApi ::class , ExperimentalLibraryAbiReader :: class )
8082 override fun execute () {
83+ try {
84+ LibraryAbiReader .javaClass
85+ } catch (e: NoClassDefFoundError ) {
86+ error(
87+ " KLib validation is not available. " +
88+ " Make sure the project uses at least Kotlin 1.9.20 or disable KLib validation " +
89+ " by setting apiValidation.klib.enabled to false"
90+ )
91+ }
92+
8193 val outputFile = parameters.outputAbiFile.asFile.get()
8294 outputFile.delete()
8395 outputFile.parentFile.mkdirs()
You can’t perform that action at this time.
0 commit comments