gson-comments/shrinker-test/common.pro
Søren Gjesse 7b5629bcfc
Update ProGuard default shrinking rules (#2448)
* Update ProGuard default shrinking rules to correctly deal with classes without a no-args constructor

* Update test after changing default shrinking rules

* Adjust shrinker tests

* Update rules

* Addressed review comments

* Addressed more review comments

* Addressed more review comments

---------

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2023-08-22 08:40:31 -07:00

41 lines
1.1 KiB
Prolog

### Common rules for ProGuard and R8
### Should only contains rules needed specifically for the integration test;
### any general rules which are relevant for all users should not be here but in `META-INF/proguard` of Gson
-allowaccessmodification
# On Windows mixed case class names might cause problems
-dontusemixedcaseclassnames
# Ignore notes about duplicate JDK classes
-dontnote module-info,jdk.internal.**
# Keep test entrypoints
-keep class com.example.Main {
public static void runTests(...);
}
-keep class com.example.NoSerializedNameMain {
public static java.lang.String runTest();
public static java.lang.String runTestNoJdkUnsafe();
public static java.lang.String runTestNoDefaultConstructor();
}
### Test data setup
# Keep fields without annotations which should be preserved
-keepclassmembers class com.example.ClassWithNamedFields {
!transient <fields>;
}
-keepclassmembernames class com.example.ClassWithExposeAnnotation {
<fields>;
}
-keepclassmembernames class com.example.ClassWithJsonAdapterAnnotation {
** f;
}
-keepclassmembernames class com.example.ClassWithVersionAnnotations {
<fields>;
}