Skip to content

Commit cac5669

Browse files
committed
Described a klib validation pipeline, fixed task names, improved error messages
1 parent 0a2d44f commit cac5669

File tree

8 files changed

+87
-49
lines changed

8 files changed

+87
-49
lines changed

src/functionalTest/kotlin/kotlinx/validation/test/KLibVerificationTests.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ internal class KLibVerificationTests : BaseKotlinGradleTest() {
474474
}
475475

476476
runner.buildAndFail().apply {
477-
assertTaskFailure(":klibApiPrepareAbiForValidation")
477+
assertTaskFailure(":klibApiExtractForValidation")
478478
}
479479
}
480480

@@ -527,7 +527,7 @@ internal class KLibVerificationTests : BaseKotlinGradleTest() {
527527
}
528528

529529
runner.buildAndFail().apply {
530-
assertTaskFailure(":linuxArm64ApiInferAbiDump")
530+
assertTaskFailure(":linuxArm64ApiInfer")
531531
Assertions.assertThat(output).contains(
532532
"The target linuxArm64 is not supported by the host compiler " +
533533
"and there are no targets similar to linuxArm64 to infer a dump from it."
@@ -590,7 +590,7 @@ internal class KLibVerificationTests : BaseKotlinGradleTest() {
590590

591591
runner.buildAndFail().apply {
592592
Assertions.assertThat(output).contains(
593-
"KLib ABI dump/validation requires at least enabled klib target, but none were found."
593+
"KLib ABI dump/validation requires at least one enabled klib target, but none were found."
594594
)
595595
}
596596
}

src/main/kotlin/BinaryCompatibilityValidatorPlugin.kt

Lines changed: 72 additions & 34 deletions
Large diffs are not rendered by default.

src/main/kotlin/KotlinApiBuildTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2020 JetBrains s.r.o.
2+
* Copyright 2016-2024 JetBrains s.r.o.
33
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
44
*/
55

src/main/kotlin/KotlinApiCompareTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2020 JetBrains s.r.o.
2+
* Copyright 2016-2024 JetBrains s.r.o.
33
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
44
*/
55

src/main/kotlin/KotlinKlibAbiBuildTask.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 JetBrains s.r.o.
2+
* Copyright 2016-2024 JetBrains s.r.o.
33
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
44
*/
55

@@ -68,7 +68,7 @@ public abstract class KotlinKlibAbiBuildTask : BuildTaskBase() {
6868
val parsedAbi = try {
6969
LibraryAbiReader.readAbiInfo(klibFile.singleFile, filters)
7070
} catch (e: Exception) {
71-
throw IllegalStateException("Can't read a KLib: ${klibFile.singleFile}", e)
71+
throw IllegalStateException("Can't read a klib: ${klibFile.singleFile}", e)
7272
}
7373

7474
val supportedVersions = parsedAbi.signatureVersions.asSequence()
@@ -83,7 +83,7 @@ public abstract class KotlinKlibAbiBuildTask : BuildTaskBase() {
8383
AbiSignatureVersion.resolveByVersionNumber(signatureVersion!!)
8484
} else {
8585
supportedVersions.maxByOrNull(AbiSignatureVersion::versionNumber)
86-
?: throw IllegalStateException("Can't choose abiSignatureVersion")
86+
?: throw IllegalStateException("Can't choose signatureVersion")
8787
}
8888

8989
outputApiFile.bufferedWriter().use {

src/main/kotlin/KotlinKlibExtractSupportedTargetsAbiTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public abstract class KotlinKlibExtractSupportedTargetsAbiTask : DefaultTask() {
6161
if (targetsToRemove.isNotEmpty() && strictValidation) {
6262
throw IllegalStateException(
6363
"Validation could not be performed as some targets are not available " +
64-
"and the strictValidation mode was enabled"
64+
"and the strictValidation mode was enabled."
6565
)
6666
}
6767
for (target in targetsToRemove) {

src/main/kotlin/KotlinKlibInferAbiForUnsupportedTargetTask.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 JetBrains s.r.o.
2+
* Copyright 2016-2024 JetBrains s.r.o.
33
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
44
*/
55

@@ -105,10 +105,10 @@ public abstract class KotlinKlibInferAbiForUnsupportedTargetTask : DefaultTask()
105105
}
106106

107107
logger.warn(
108-
"An ABI dump for target $unsupportedTarget was inferred from the ABI generated for target " +
109-
"[${matchingTargets.joinToString(",")}] " +
110-
"as the former target is not supported by the host compiler. " +
111-
"Inferred dump may not reflect actual ABI for the target $unsupportedTarget. " +
108+
"An ABI dump for target $unsupportedTarget was inferred from the ABI generated for the following targets " +
109+
"as the former target is not supported by the host compiler: " +
110+
"[${matchingTargets.joinToString(",")}]. " +
111+
"Inferred dump may not reflect an actual ABI for the target $unsupportedTarget. " +
112112
"It is recommended to regenerate the dump on the host supporting all required compilation target."
113113
)
114114
}

src/main/kotlin/KotlinKlibMergeAbiTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 JetBrains s.r.o.
2+
* Copyright 2016-2024 JetBrains s.r.o.
33
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
44
*/
55

0 commit comments

Comments
 (0)