Klib Dump
Represents KLib ABI dump and allows manipulating it.
Usual KlibDump workflows consists of loading, updating and writing a dump back.
Creating a textual dump from a klib
val dump = KlibDump.fromKlib(File("/path/to/library.klib"))
dump.saveTo(File("/path/to/dump.klib.api"))
Content copied to clipboard
Loading a dump
val dump = KlibDump.from(File("/path/to/dump.klib.api"))
Content copied to clipboard
Merging multiple dumps into a new merged dump
val klibs = listOf(File("/path/to/library-linuxX64.klib"), File("/path/to/library-linuxArm64.klib"), ...)
val mergedDump = KlibDump()
klibs.forEach { mergedDump.mergeFromKlib(it) }
mergedDump.saveTo(File("/path/to/merged.klib.api"))
Content copied to clipboard
Updating an existing merged dump
val mergedDump = KlibDump.from(File("/path/to/merged.klib.api"))
val newTargetDump = KlibDump.fromKlib(File("/path/to/library-linuxX64.klib"))
mergedDump.remove(newTargetDump.targets)
mergedDump.merge(newTargetDump)
mergedDump.saveTo(File("/path/to/merged.klib.api"))
Content copied to clipboard
Functions
Link copied to clipboard
fun KlibDump.mergeFromKlib(klibFile: File, configurableTargetName: String? = null, filters: KlibDumpFilters = KlibDumpFilters.DEFAULT)
Link copied to clipboard
Remove all declarations that do belong to specified targets and remove these targets from the dump.
Link copied to clipboard
Removes all declarations that do not belong to specified targets and removes these targets from the dump.
Link copied to clipboard
Serializes the dump and writes it to to.