Join Slack
Powered by
Is there a way to parse the knm files in a klib in...
# multiplatform
o
Omico
07/20/2025, 11:10 AM
Is there a way to parse the knm files in a klib into a syntax tree? I want to check some annotations inside of it.
h
hfhbd
07/20/2025, 11:31 AM
AFAIK only on the JVM cause you would need to use the kotlin compiler
j
jw
07/20/2025, 8:55 PM
Are they public? There an ABI reader library for klibs
o
Omico
07/21/2025, 5:46 PM
@jw
yes, they are! Is this the ABI reader library that you talking about?
https://github.com/JetBrains/kotlin/blob/master/compiler/util-klib-abi/src/org/jetbrains/kotlin/library/abi/LibraryAbiReader.kt
Omico
07/21/2025, 5:52 PM
Seem this is the correct answer. I notice that BCV is using this way.
https://github.com/Kotlin/binary-compatibility-validator/blob/af4772c7cf1901fb0b82[…]d4d5343353aa4eadcb7/src/main/kotlin/api/klib/KlibDumpFilters.kt
Omico
07/21/2025, 5:53 PM
I really appreciate your help!
2
Views
Open in Slack
Previous
Next