Are there plans for a `@Keep` annotation for Kotli...
# javascript
a
Are there plans for a
@Keep
annotation for Kotlin/JS projects that automatically whitelists things from being DCEed? Similar to how Android has
@Keep
for ProGuard?
youtrack 2
g
a
So right now, you need to go into
build.gradle
and explicitly configure
runDceKotlinJs.keep
manually for every declaration you want to keep. Whenever you add a new method/field/whatever in Kotlin/JS, if you want to force DCE to keep it, you need to manually update the declaration in Gradle. What I'm hoping for is an annotation that you can apply to any such declaration in actual Kotlin source (
.kt
files) to have the same effect. This way, as you rename/move/refactor/delete declarations, you don't need to manually muck around in
build.gradle
to keep your
runDceKotlinJs.keep
declaration up-to-date with your actual code.
b
@ankushg please file an issue
a
👍 Just wanted to make sure that wasn't something that already existed, or was out of scope for the JB team to work on