Guest User

Untitled

a guest
Jan 10th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. // inside android block
  2. debug {
  3. shrinkResources true // removes unused graphics etc
  4. minifyEnabled true
  5. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  6. testProguardFile('test-proguard-rules.pro')
  7. }
  8.  
  9. # Proguard rules that are applied to your test apk/code.
  10. -ignorewarnings
  11.  
  12. -keepattributes *Annotation*
  13.  
  14. -dontnote junit.framework.**
  15. -dontnote junit.runner.**
  16.  
  17. -dontwarn android.test.**
  18. -dontwarn android.support.test.**
  19. -dontwarn org.junit.**
  20. -dontwarn org.hamcrest.**
  21. -dontwarn com.squareup.javawriter.JavaWriter
  22. # Uncomment this if you use Mockito
  23. #-dontwarn org.mockito.**
  24. The add the following to your build.gradle for your app. To use the proguard file when testing.
  25.  
  26. /project/app/build.gradle
  27.  
  28. android {
  29. debug {
  30. minifyEnabled true
  31. testProguardFile 'proguard-test-rules.pro'
  32. }
  33. }
  34.  
  35. android {
  36. variantFilter { variant ->
  37. if (variant.buildType.name.equals('debug')) {
  38. variant.setIgnore(true);
  39. }
  40. }
  41. }
  42.  
  43. buildscript {
  44. ext.kotlin_version = '1.2.10'
  45.  
  46. ...
  47.  
  48. dependencies {
  49. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  50. }
  51. }
  52. apply plugin: 'com.android.application'
  53. apply plugin: 'kotlin-android'
  54.  
  55. repositories {
  56. mavenCentral()
  57. }
  58.  
  59. dependencies {
  60. compile "org.jetbrains.kotlin:kotlin-stdlib"
  61. }
  62.  
  63. compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  64.  
  65. configurations.all {
  66. resolutionStrategy {
  67. force "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  68. }
  69. }
  70.  
  71. // Instead, because the new build model delays dependency resolution, you
  72. // should query and modify the resolution strategy using the Variant API:
  73. android {
  74. applicationVariants.all { variant ->
  75. variant.getCompileConfiguration().resolutionStrategy {
  76. ...
  77. }
  78. variant.runtimeConfiguration.resolutionStrategy {
  79. ...
  80. }
  81. variant.getAnnotationProcessorConfiguration().resolutionStrategy {
  82. ...
  83. }
  84. }
  85. }
  86.  
  87. android.testVariants.all { variant ->
  88. variant.getCompileConfiguration().exclude group: 'com.jakewharton.threetenabp', module: 'threetenabp'
  89. variant.getRuntimeConfiguration().exclude group: 'com.jakewharton.threetenabp', module: 'threetenabp'
  90. }
  91.  
  92. compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7"
  93. compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
  94.  
  95. compile "org.jetbrains.kotlin:kotlin-reflect"
  96. testCompile "org.jetbrains.kotlin:kotlin-test"
  97. testCompile "org.jetbrains.kotlin:kotlin-test-junit"
  98.  
  99. apply plugin: 'kotlin-kapt'
Add Comment
Please, Sign In to add comment