Skip to content Skip to sidebar Skip to footer

How To Configure Proguard Keep Options For Multiple Namespaces?

I understand that the keep options of ProGuard can be used with wildcards to include full namespaces. E.g.: -keepclassmembers class com.yourcompany.yourpackage.** { # relevant

Solution 1:

This is determined by ProGuard's Class Specifications.

Limited options, mimicking regular expressions, are available. But, these do not include the pipe (|) typically used for denoting options.

However, "[f]or additional flexibility, class names can actually be comma-separated lists of class names, with optional ! negators, just like file name filters. This notation doesn't look very Java-like, so it should be used with moderation."

Who cares about not looking very "Java-like", I just don't want to repeat myself. Besides, I'm using Kotlin. =) The following should thus work:

-keepclassmembers classcom.yourcompany.yourpackage.**, io.yourcompany.yourpackage.** {
    # relevant configuration
}

Post a Comment for "How To Configure Proguard Keep Options For Multiple Namespaces?"