build.gradle 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. apply plugin: 'com.android.application'
  2. apply plugin: "com.jaredsburrows.license"
  3. dependencies {
  4. compile "com.android.support:support-v4:23.2.1"
  5. compile "com.android.support:appcompat-v7:23.2.1"
  6. testCompile 'junit:junit:4.12'
  7. testCompile 'org.mockito:mockito-core:1.10.19'
  8. // I had to add this dependencies because org.json is a part of the Android platform and
  9. // not available in unit tests (see "Method getString in org.json.JSONObject not mocked"
  10. // http://tools.android.com/tech-docs/unit-testing-support#TOC-Method-...-not-mocked.- )
  11. testCompile 'org.json:json:20180130'
  12. }
  13. android {
  14. compileSdkVersion 25
  15. buildToolsVersion '25.0.3'
  16. defaultConfig {
  17. versionCode 22
  18. versionName "57.0"
  19. minSdkVersion 9
  20. targetSdkVersion 25
  21. }
  22. buildTypes {
  23. release {
  24. // Enable proguard with default android settings (no obfuscation)
  25. minifyEnabled true
  26. shrinkResources true
  27. proguardFile getDefaultProguardFile('proguard-android.txt')
  28. }
  29. }
  30. compileOptions {
  31. encoding = "UTF-8"
  32. sourceCompatibility JavaVersion.VERSION_1_7
  33. targetCompatibility JavaVersion.VERSION_1_7
  34. }
  35. packagingOptions {
  36. exclude 'META-INF/NOTICE'
  37. exclude 'META-INF/NOTICE.txt'
  38. exclude 'META-INF/README'
  39. exclude 'META-INF/README.txt'
  40. exclude 'META-INF/LICENSE'
  41. exclude 'META-INF/LICENSE.txt'
  42. }
  43. testOptions {
  44. // workaround for the error "Method i in android.util.Log not mocked" (http://tools.android.com/tech-docs/unit-testing-support#TOC-Method-...-not-mocked.-)
  45. // without PowerMockito it is impossible to mock Log.
  46. unitTests.returnDefaultValues = true
  47. }
  48. }