mbonnin
08/06/2021, 10:00 AM@Metadata
, *.kotlin_modules
, *.kotlin_metadata
, *.kotlin_builtins
, what's safe to strip and what am I exposing myself to if I strip too much?Zac Sweers
08/07/2021, 4:13 PM@Metadata
contains a few things about the kotlin class (namely the kotlin version, metadata version, and a protobuf of metadata itself containing information about the kotlin language features. Only used by the compiler or kotlin-reflect (or kotlinx-metadata)
.kotlin_modules
is related to this, but contain data specific to an entire module rather than specific classes. https://github.com/JetBrains/kotlin/blob/master/libraries/kotlinx-metadata/jvm/ReadMe.md#module-metadata
.kotlin_builtins
I believe is a protobuf of kotlin intrinsics like Any
that kotlin-reflect uses at runtime to load types
.kotlin_metadata
is similar to builtins but for metadata and I believe only used by kotlin-reflect or the compiler. I don’t know exactly what’s in these files though that’s different from what’s in @Metadata
annotationsmbonnin
08/07/2021, 4:18 PM.kotlin_builtins
and .kotlin_metadata
. Stripping .kotlin_modules
breaks top level function and stripping @Metadata
breaks a few other things that I unfortunately can't remember anymore.Zac Sweers
08/07/2021, 5:05 PMZac Sweers
08/07/2021, 5:06 PMmbonnin
08/07/2021, 5:09 PM.kotlin_*
files so I'm not sure Gradle/the Kotlin compiler can look them up.mbonnin
08/07/2021, 5:10 PMmbonnin
08/07/2021, 5:17 PMwe keep all of them for instrumentation tests in androidDoes that mean they end up in the production APK too? Users shouldn't need to download all theses bytes?
Zac Sweers
08/07/2021, 5:23 PMZac Sweers
08/07/2021, 5:23 PMmbonnin
08/07/2021, 5:27 PM.kotlin_
either. Maybe it's ok though since it's not in the public API so Gradle should not try to do anything with the relocated classes.Zac Sweers
08/07/2021, 5:28 PM