Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // inside android block
- debug {
- shrinkResources true // removes unused graphics etc
- minifyEnabled true
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- testProguardFile('test-proguard-rules.pro')
- }
- # Proguard rules that are applied to your test apk/code.
- -ignorewarnings
- -keepattributes *Annotation*
- -dontnote junit.framework.**
- -dontnote junit.runner.**
- -dontwarn android.test.**
- -dontwarn android.support.test.**
- -dontwarn org.junit.**
- -dontwarn org.hamcrest.**
- -dontwarn com.squareup.javawriter.JavaWriter
- # Uncomment this if you use Mockito
- #-dontwarn org.mockito.**
- The add the following to your build.gradle for your app. To use the proguard file when testing.
- /project/app/build.gradle
- android {
- debug {
- minifyEnabled true
- testProguardFile 'proguard-test-rules.pro'
- }
- }
- android {
- variantFilter { variant ->
- if (variant.buildType.name.equals('debug')) {
- variant.setIgnore(true);
- }
- }
- }
- buildscript {
- ext.kotlin_version = '1.2.10'
- ...
- dependencies {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
- }
- apply plugin: 'com.android.application'
- apply plugin: 'kotlin-android'
- repositories {
- mavenCentral()
- }
- dependencies {
- compile "org.jetbrains.kotlin:kotlin-stdlib"
- }
- compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
- configurations.all {
- resolutionStrategy {
- force "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
- }
- }
- // Instead, because the new build model delays dependency resolution, you
- // should query and modify the resolution strategy using the Variant API:
- android {
- applicationVariants.all { variant ->
- variant.getCompileConfiguration().resolutionStrategy {
- ...
- }
- variant.runtimeConfiguration.resolutionStrategy {
- ...
- }
- variant.getAnnotationProcessorConfiguration().resolutionStrategy {
- ...
- }
- }
- }
- android.testVariants.all { variant ->
- variant.getCompileConfiguration().exclude group: 'com.jakewharton.threetenabp', module: 'threetenabp'
- variant.getRuntimeConfiguration().exclude group: 'com.jakewharton.threetenabp', module: 'threetenabp'
- }
- compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7"
- compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
- compile "org.jetbrains.kotlin:kotlin-reflect"
- testCompile "org.jetbrains.kotlin:kotlin-test"
- testCompile "org.jetbrains.kotlin:kotlin-test-junit"
- apply plugin: 'kotlin-kapt'
Add Comment
Please, Sign In to add comment