Skip to content
This repository has been archived by the owner on May 30, 2020. It is now read-only.

Commit

Permalink
Add rules for icepick, bundles, android-dart, okhttp, okio and retrofit.
Browse files Browse the repository at this point in the history
  • Loading branch information
hvisser committed Aug 15, 2014
1 parent 6db582c commit b047204
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 1 deletion.
8 changes: 7 additions & 1 deletion squadleader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ android {
'src/rules/gson.pro',
'src/rules/butterknife.pro',
'src/rules/otto.pro',
'src/rules/framework.pro'
'src/rules/framework.pro',
'src/rules/bundles.pro',
'src/rules/icepick.pro',
'src/rules/android-dart.pro',
'src/rules/okio.pro',
'src/rules/retrofit.pro',
'src/rules/okhttp.pro'
}
buildTypes {
debug {
Expand Down
4 changes: 4 additions & 0 deletions squadleader/src/rules/android-dart.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Rules for Dart https://github.com/f2prateek/android-dart
-dontwarn com.f2prateek.dart.internal.**
-keep class **$$ExtraInjector { *; }
-keepnames class * { @com.f2prateek.dart.InjectExtra *;}
3 changes: 3 additions & 0 deletions squadleader/src/rules/bundles.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Rules for the bundles @Frozen and @Argument annotations https://bitbucket.org/hvisser/bundles
-dontwarn com.neenbedankt.bundles.processor.**
-dontwarn com.squareup.javawriter.JavaWriter
4 changes: 4 additions & 0 deletions squadleader/src/rules/icepick.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Rules for Icepick https://github.com/frankiesardo/icepick
-dontwarn icepick.**
-keep class **$$Icicle { *; }
-keepnames class * { @icepick.Icicle *;}
7 changes: 7 additions & 0 deletions squadleader/src/rules/okhttp.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Rules for OkHttp http://square.github.io/okhttp/
-dontwarn com.squareup.okhttp.internal.**
# Okio
-dontwarn org.codehaus.mojo.animal_sniffer.**
-dontwarn java.nio.file.Files
-dontwarn java.nio.file.Path
-dontwarn java.nio.file.OpenOption
5 changes: 5 additions & 0 deletions squadleader/src/rules/okio.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Rules for Okio https://github.com/square/okio/
-dontwarn org.codehaus.mojo.animal_sniffer.**
-dontwarn java.nio.file.Files
-dontwarn java.nio.file.Path
-dontwarn java.nio.file.OpenOption
6 changes: 6 additions & 0 deletions squadleader/src/rules/retrofit.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Rules for Retrofit
-dontwarn retrofit.RxSupport
-dontwarn retrofit.RxSupport$*
-dontwarn retrofit.appengine.**
-dontwarn retrofit.client.OkClient
-dontwarn retrofit.RestMethodInfo$RxSupport
11 changes: 11 additions & 0 deletions verification/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,22 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}

packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(":squadleader")
compile 'com.jakewharton:butterknife:5.1.2'
compile 'com.squareup:otto:1.3.5'
compile 'com.github.frankiesardo:icepick:2.3.6'
provided 'com.github.frankiesardo:icepick-processor:2.3.6'
compile 'com.neenbedankt.bundles:frozen:1.0.4'
compile 'com.f2prateek.dart:dart:1.1.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,32 @@
import android.view.View;
import android.webkit.JavascriptInterface;

import com.f2prateek.dart.InjectExtra;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.otto.Produce;
import com.squareup.otto.Subscribe;

import butterknife.InjectView;
import butterknife.OnClick;
import icepick.Icicle;
import nl.littlerobots.squadleader.Keep;
import retrofit.RestAdapter.Builder;

public class MyActivity extends Activity {

@Icicle
String icepickString;
@InjectExtra("test")
String dartString;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
// need a reference because otherwise ProGuard will strip out KeepFieldsTester
KeepFieldsTester object = new KeepFieldsTester();
OkHttpClient client = new OkHttpClient();
RetrofitTester service = new Builder().setEndpoint("http://www.test.com").build().create(RetrofitTester.class);
}

@Subscribe
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package nl.littlerobots.squadleader.verification;

import retrofit.http.GET;

public interface RetrofitTester {
@GET("/test")
public String test();
}

0 comments on commit b047204

Please sign in to comment.