@@ -30,10 +30,10 @@ public abstract class KotlinKlibExtractAbiTask : DefaultTask() {
30
30
public abstract val inputAbiFile: RegularFileProperty
31
31
32
32
/* *
33
- * List of the targets that the resulting dump should contain .
33
+ * List of the targets that need to be filtered out from [inputAbiFile] .
34
34
*/
35
35
@get:Input
36
- public abstract val requiredTargets : SetProperty <KlibTarget >
36
+ public abstract val targetsToRemove : SetProperty <KlibTarget >
37
37
38
38
/* *
39
39
* Refer to [KlibValidationSettings.strictValidation] for details.
@@ -56,17 +56,16 @@ public abstract class KotlinKlibExtractAbiTask : DefaultTask() {
56
56
error(" Project ABI file $inputAbiFile is empty." )
57
57
}
58
58
val dump = KlibDump .from(inputFile)
59
- val enabledTargets = requiredTargets .get().map(KlibTarget ::targetName).toSet()
59
+ val unsupportedTargets = targetsToRemove .get().map(KlibTarget ::targetName).toSet()
60
60
// Filter out only unsupported files.
61
61
// That ensures that target renaming will be caught and reported as a change.
62
- val targetsToRemove = dump.targets.filter { it.targetName !in enabledTargets }
63
- if (targetsToRemove.isNotEmpty() && strictValidation.get()) {
62
+ if (unsupportedTargets.isNotEmpty() && strictValidation.get()) {
64
63
throw IllegalStateException (
65
64
" Validation could not be performed as some targets (namely, $targetsToRemove ) are not available " +
66
65
" and the strictValidation mode was enabled."
67
66
)
68
67
}
69
- dump.remove(targetsToRemove )
68
+ dump.remove(unsupportedTargets.map( KlibTarget ::parse) )
70
69
dump.saveTo(outputAbiFile.asFile.get())
71
70
}
72
71
}
0 commit comments