Skip to content

Commit b552b74

Browse files
Merge branch '58-embed-r8-rules' into 'dev'
Embed R8/ProGuard rules in JAR. See merge request objectbox/objectbox-java!68
2 parents ca9a877 + 92f3cd5 commit b552b74

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# When editing this file, also look at consumer-proguard-rules.pro of objectbox-android.
2+
3+
-keepattributes *Annotation*
4+
5+
# Native methods
6+
-keepclasseswithmembernames class io.objectbox.** {
7+
native <methods>;
8+
}
9+
10+
# For __boxStore field in entities
11+
-keep class io.objectbox.BoxStore
12+
13+
-keep class * extends io.objectbox.Cursor {
14+
<init>(...);
15+
}
16+
17+
# Native code expects names to match
18+
-keep class io.objectbox.relation.ToOne {
19+
void setTargetId(long);
20+
}
21+
-keep class io.objectbox.relation.ToMany
22+
23+
-keep @interface io.objectbox.annotation.Entity
24+
25+
# Keep entity constructors
26+
-keep @io.objectbox.annotation.Entity class * { <init>(...); }
27+
28+
# For relation ID fields
29+
-keepclassmembers @io.objectbox.annotation.Entity class * {
30+
<fields>;
31+
}
32+
33+
-keep interface io.objectbox.converter.PropertyConverter {*;}
34+
-keep class * implements io.objectbox.converter.PropertyConverter {*;}
35+
36+
-keep class io.objectbox.exception.DbException {*;}
37+
-keep class * extends io.objectbox.exception.DbException {*;}
38+
39+
-keep class io.objectbox.exception.DbExceptionListener {*;}
40+
-keep class * implements io.objectbox.exception.DbExceptionListener {*;}
41+
42+
# for essentials
43+
-dontwarn sun.misc.Unsafe

0 commit comments

Comments
 (0)