Compare module metadata in JVM ABI consistency tests

This commit is contained in:
vladislav.grechko
2024-02-06 12:13:49 +01:00
committed by Space Team
parent ba217ad688
commit b74501ee93
9 changed files with 200 additions and 18 deletions
@@ -25,6 +25,14 @@ fun ClassFileFactory.getClassFiles(): Iterable<OutputFile> {
return asList().filterClassFiles()
}
fun ClassFileFactory.getKotlinModuleFile(): OutputFile? = asList().filter { it.relativePath.endsWith(".kotlin_module") }.run {
when (size) {
0 -> null
1 -> single()
else -> error("Module has non-unique .kotlin_metadata file")
}
}
fun List<OutputFile>.filterClassFiles(): List<OutputFile> {
return filter { it.relativePath.endsWith(".class") }
}