kosi-libs / Kaverit

A light multiplatform Kotlin reflection API
MIT License
17 stars 1 forks source link

Add proguard rules to avoid dead code elimination #6

Closed romainbsl closed 1 year ago

romainbsl commented 3 years ago

from https://github.com/Kodein-Framework/Kodein-DI/issues/309

-keep, allowobfuscation, allowoptimization class org.kodein.type.TypeReference
-keep, allowobfuscation, allowoptimization class org.kodein.type.JVMAbstractTypeToken$Companion$WrappingTest

-keep, allowobfuscation, allowoptimization class * extends org.kodein.type.TypeReference
-keep, allowobfuscation, allowoptimization class * extends org.kodein.type.JVMAbstractTypeToken$Companion$WrappingTest
slavonnet commented 2 years ago

Some issue with 7.8.0;. Need manual add rules

eygraber commented 1 year ago

@romainbsl any chance this will ever get added?

romainbsl commented 1 year ago

@eygraber I am sorry about the delay on that one. And honestly kinda forgot about it. I should be able to do it by the end of February.

romainbsl commented 1 year ago

@eygraber I did publish a snapshot version of Kaverit, under the version 2.4.0-android-proguard-SNAPSHOT, so that the .aar embed a proguard.txt file to be merged with the one in an application.

I also published a snapshot of Kodein that embed that specific version of Kaverit, 7.20.0-kaverit-proguard-rules-SNAPSHOT.

I didn't try those, but I guess that you can easily try this on your own projects.

eygraber commented 1 year ago

Thanks, I'll try that when I get a chance.

mujahid-iitr commented 1 year ago

For someone who is still struggling, try this: -keep, allowobfuscation, allowoptimization class org.kodein.di.TypeReference -keep, allowobfuscation, allowoptimization class * extends org.kodein.di.TypeReference

romainbsl commented 1 year ago

org.kodein.di.TypeReference has been removed since a long time! Almost, since this library exists.

romainbsl commented 1 year ago

Published within v.2.7.0