File tree Expand file tree Collapse file tree 10 files changed +41
-6
lines changed
src/main/java/com/mindorks/demo
placeholderview-annotations/src/main/java/com/mindorks/placeholderview/annotations
placeholderview-compiler/src/main/java/com/mindorks/placeholderview/compiler/structures Expand file tree Collapse file tree 10 files changed +41
-6
lines changed Original file line number Diff line number Diff line change 1515#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616# public *;
1717#}
18+ -keepattributes *Annotation*
19+ -keepclassmembers class ** {
20+ @com.mindorks.butterknifelite.annotations.** <methods>;
21+ }
Original file line number Diff line number Diff line change 44import android .support .annotation .Nullable ;
55import android .support .v7 .app .AppCompatActivity ;
66import android .util .Log ;
7- import android .view .Gravity ;
87
98import com .mindorks .butterknifelite .ButterKnifeLite ;
109import com .mindorks .butterknifelite .annotations .BindView ;
Original file line number Diff line number Diff line change 1+ package com .mindorks .placeholderview .annotations ;
2+
3+ import java .lang .annotation .ElementType ;
4+ import java .lang .annotation .Retention ;
5+ import java .lang .annotation .RetentionPolicy ;
6+ import java .lang .annotation .Target ;
7+
8+ /**
9+ * Created by janisharali on 18/08/16.
10+ */
11+
12+ /**
13+ * Will keep any class after proguard minify
14+ */
15+ @ Retention (RetentionPolicy .CLASS )
16+ @ Target (ElementType .TYPE )
17+ public @interface Keep {
18+ }
Original file line number Diff line number Diff line change 1010/**
1111 * Created by janisharali on 18/08/16.
1212 */
13- @ Retention (RetentionPolicy .SOURCE )
13+ @ Retention (RetentionPolicy .CLASS )
1414@ Target (ElementType .TYPE )
1515public @interface Layout {
1616 @ LayoutRes int value ();
Original file line number Diff line number Diff line change 11package com .mindorks .placeholderview .compiler .structures ;
22
3+ import com .mindorks .placeholderview .annotations .Keep ;
34import com .mindorks .placeholderview .annotations .infinite .LoadMore ;
45import com .mindorks .placeholderview .annotations .internal .BindingSuffix ;
56import com .mindorks .placeholderview .compiler .RClassBuilder ;
@@ -55,7 +56,8 @@ protected TypeSpec.Builder createClassBuilder() {
5556 .superclass (parentClassName )
5657 .addSuperinterface (ParameterizedTypeName .get (loadMoreCallbackClassName ,
5758 TypeVariableName .get (getClassDetail ().getTypeElement ().asType ())))
58- .addModifiers (Modifier .PUBLIC );
59+ .addModifiers (Modifier .PUBLIC )
60+ .addAnnotation (Keep .class );
5961 }
6062
6163 public LoadMoreViewBinderClassStructure addConstructor () {
Original file line number Diff line number Diff line change 11package com .mindorks .placeholderview .compiler .structures ;
22
3+ import com .mindorks .placeholderview .annotations .Keep ;
34import com .mindorks .placeholderview .annotations .internal .BindingSuffix ;
45import com .mindorks .placeholderview .annotations .swipe .SwipeInDirectional ;
56import com .mindorks .placeholderview .annotations .swipe .SwipeOutDirectional ;
@@ -52,7 +53,8 @@ protected TypeSpec.Builder createClassBuilder() {
5253 getClassDetail ().getFrameViewClassName (),
5354 getClassDetail ().getSwipeDirectionalOptionClassName (),
5455 getClassDetail ().getSwipeDecorClassName ()))
55- .addModifiers (Modifier .PUBLIC );
56+ .addModifiers (Modifier .PUBLIC )
57+ .addAnnotation (Keep .class );
5658 }
5759
5860 @ Override
Original file line number Diff line number Diff line change 11package com .mindorks .placeholderview .compiler .structures ;
22
3+ import com .mindorks .placeholderview .annotations .Keep ;
34import com .mindorks .placeholderview .annotations .internal .BindingSuffix ;
45import com .mindorks .placeholderview .annotations .swipe .SwipeCancelState ;
56import com .mindorks .placeholderview .annotations .swipe .SwipeHead ;
@@ -56,7 +57,8 @@ protected TypeSpec.Builder createClassBuilder() {
5657 getClassDetail ().getFrameViewClassName (),
5758 getClassDetail ().getSwipeOptionClassName (),
5859 getClassDetail ().getSwipeDecorClassName ()))
59- .addModifiers (Modifier .PUBLIC );
60+ .addModifiers (Modifier .PUBLIC )
61+ .addAnnotation (Keep .class );
6062 }
6163
6264 @ Override
Original file line number Diff line number Diff line change 11package com .mindorks .placeholderview .compiler .structures ;
22
33import com .mindorks .placeholderview .annotations .Click ;
4+ import com .mindorks .placeholderview .annotations .Keep ;
45import com .mindorks .placeholderview .annotations .Layout ;
56import com .mindorks .placeholderview .annotations .LongClick ;
67import com .mindorks .placeholderview .annotations .NonReusable ;
@@ -57,7 +58,8 @@ protected TypeSpec.Builder createClassBuilder() {
5758 getClassDetail ().getSuperClassName (),
5859 TypeVariableName .get (getClassDetail ().getTypeElement ().asType ()),
5960 TypeVariableName .get (getClassDetail ().getViewTypeParameterClassName ().simpleName ())))
60- .addModifiers (Modifier .PUBLIC );
61+ .addModifiers (Modifier .PUBLIC )
62+ .addAnnotation (Keep .class );
6163 }
6264
6365 public ViewBinderClassStructure addConstructor () {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ android {
99 targetSdkVersion rootProject. ext. libTargetSdkVersion
1010 versionCode rootProject. ext. libPublishVersionCode
1111 versionName rootProject. ext. libPublishVersionName
12+ consumerProguardFiles ' proguard-rules.pro'
1213 }
1314 buildTypes {
1415 release {
Original file line number Diff line number Diff line change 1515#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616# public *;
1717#}
18+ -keep @com.mindorks.placeholderview.annotations.Layout public class *
19+ -keep @com.mindorks.placeholderview.annotations.Keep public class *
20+ -keepclassmembers @com.mindorks.placeholderview.annotations.Layout class ** { *;}
21+ -keepclassmembers @com.mindorks.placeholderview.annotations.Keep class ** { *;}
22+
You can’t perform that action at this time.
0 commit comments