File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed 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> {
38
38
for (project in ignored) {
39
39
require(project in all) { " Cannot find excluded project $project in all projects: $all " }
40
40
}
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
- }
52
41
}
53
42
}
54
43
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import org.gradle.api.file.RegularFileProperty
11
11
import org.gradle.api.provider.Property
12
12
import org.gradle.api.tasks.*
13
13
import org.gradle.workers.WorkAction
14
+ import org.jetbrains.kotlin.library.abi.ExperimentalLibraryAbiReader
15
+ import org.jetbrains.kotlin.library.abi.LibraryAbiReader
14
16
15
17
/* *
16
18
* Generates a text file with a KLib ABI dump for a single klib.
@@ -76,8 +78,18 @@ internal interface KlibAbiBuildParameters : BuildParametersBase {
76
78
}
77
79
78
80
internal abstract class KlibAbiBuildWorker : WorkAction <KlibAbiBuildParameters > {
79
- @OptIn(ExperimentalBCVApi ::class )
81
+ @OptIn(ExperimentalBCVApi ::class , ExperimentalLibraryAbiReader :: class )
80
82
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
+
81
93
val outputFile = parameters.outputAbiFile.asFile.get()
82
94
outputFile.delete()
83
95
outputFile.parentFile.mkdirs()
You can’t perform that action at this time.
0 commit comments