build.gradle 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // Gradle build file
  2. //
  3. // This project was started in Eclipse and later moved to Android Studio. In the transition, both IDEs were supported.
  4. // Due to this, the files layout is not the usual in new projects created with Android Studio / gradle. This file
  5. // merges declarations usually split in two separates build.gradle file, one for global settings of the project in
  6. // its root folder, another one for the app module in subfolder of root.
  7. buildscript {
  8. repositories {
  9. mavenCentral()
  10. }
  11. dependencies {
  12. classpath 'com.android.tools.build:gradle:2.1.0'
  13. }
  14. }
  15. apply plugin: 'com.android.application'
  16. ext {
  17. supportLibraryVersion = '23.1.1'
  18. TEST_USER = "$System.env.TEST_USER"
  19. TEST_PASSWORD = "$System.env.TEST_PASSWORD"
  20. TEST_SERVER_URL = "$System.env.TEST_SERVER_URL"
  21. }
  22. repositories {
  23. mavenCentral()
  24. flatDir {
  25. dirs 'libs'
  26. }
  27. }
  28. dependencies {
  29. /// dependencies for app building
  30. compile name: 'touch-image-view'
  31. compile project(':owncloud-android-library')
  32. compile "com.android.support:support-v4:${supportLibraryVersion}"
  33. compile "com.android.support:design:${supportLibraryVersion}"
  34. compile 'com.jakewharton:disklrucache:2.0.2'
  35. compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
  36. compile 'com.getbase:floatingactionbutton:1.10.1'
  37. /// dependencies for local unit tests
  38. testCompile 'junit:junit:4.12'
  39. testCompile 'org.mockito:mockito-core:1.10.19'
  40. /// dependencies for instrumented tests
  41. // JUnit4 Rules
  42. androidTestCompile 'com.android.support.test:rules:0.5'
  43. // Android JUnit Runner
  44. androidTestCompile 'com.android.support.test:runner:0.5'
  45. // Espresso core
  46. androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
  47. }
  48. android {
  49. compileSdkVersion 23
  50. buildToolsVersion "23.0.3"
  51. defaultConfig {
  52. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  53. testInstrumentationRunnerArguments TEST_USER: "${TEST_USER}"
  54. testInstrumentationRunnerArguments TEST_PASSWORD: "${TEST_PASSWORD}"
  55. testInstrumentationRunnerArguments TEST_SERVER_URL: "${TEST_SERVER_URL}"
  56. }
  57. // adapt structure from Eclipse to Gradle/Android Studio expectations;
  58. // see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
  59. sourceSets {
  60. main {
  61. manifest.srcFile 'AndroidManifest.xml'
  62. java.srcDirs = ['src']
  63. resources.srcDirs = ['src']
  64. aidl.srcDirs = ['src']
  65. renderscript.srcDirs = ['src']
  66. res.srcDirs = ['res']
  67. assets.srcDirs = ['assets']
  68. }
  69. // move whole local unit tests structure as a whole from src/test/* to test/*
  70. test.setRoot('test')
  71. // move whole instrumented tests structure as a whole from src/androidTest/* to androidTest/*
  72. androidTest.setRoot('androidTest')
  73. // Move the build types to build-types/<type>
  74. // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
  75. // This moves them out of them default location under src/<type>/... which would
  76. // conflict with src/ being used by the main source set.
  77. // Adding new build types or product flavors should be accompanied
  78. // by a similar customization.
  79. debug.setRoot('build-types/debug')
  80. release.setRoot('build-types/release')
  81. }
  82. compileOptions {
  83. sourceCompatibility JavaVersion.VERSION_1_7
  84. targetCompatibility JavaVersion.VERSION_1_7
  85. }
  86. lintOptions {
  87. abortOnError false
  88. }
  89. packagingOptions {
  90. exclude 'META-INF/LICENSE.txt'
  91. }
  92. }