use custom proguard config for running tests

The new Android Testing Support library stuff causes proguard to freak
out, so make proguard ignore all that stuff when running tests.
This commit is contained in:
Hans-Christoph Steiner 2016-04-04 11:59:35 +02:00
parent fc0df0dcf4
commit 70864e3479
2 changed files with 17 additions and 0 deletions

View File

@ -132,6 +132,7 @@ android {
minifyEnabled true minifyEnabled true
shrinkResources true shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'src/androidTest/proguard-rules.pro'
} }
debug { debug {
testCoverageEnabled = true testCoverageEnabled = true

16
app/src/androidTest/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,16 @@
-dontwarn android.test.**
-dontwarn android.support.test.**
-dontnote junit.framework.**
-dontnote junit.runner.**
# Uncomment this if you use Mockito
#-dontwarn org.mockito.**
-keep class org.hamcrest.** { *; }
-dontwarn org.hamcrest.**
-keep class org.junit.** { *; }
-dontwarn org.junit.**
-keep class junit.** { *; }
-dontwarn junit.**