build.gradle 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. }
  19. repositories {
  20. mavenCentral()
  21. flatDir {
  22. dirs 'libs'
  23. }
  24. }
  25. dependencies {
  26. /// dependencies for app building
  27. compile name: 'touch-image-view'
  28. compile project(':owncloud-android-library')
  29. compile "com.android.support:support-v4:${supportLibraryVersion}"
  30. compile "com.android.support:design:${supportLibraryVersion}"
  31. compile 'com.jakewharton:disklrucache:2.0.2'
  32. compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
  33. compile 'com.getbase:floatingactionbutton:1.10.1'
  34. /// dependencies for local unit tests
  35. testCompile 'junit:junit:4.12'
  36. testCompile 'org.mockito:mockito-core:1.10.19'
  37. /// dependencies for instrumented tests
  38. // JUnit4 Rules
  39. androidTestCompile 'com.android.support.test:rules:0.5'
  40. // Android JUnit Runner
  41. androidTestCompile 'com.android.support.test:runner:0.5'
  42. // Espresso core
  43. androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
  44. // UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
  45. androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
  46. }
  47. tasks.withType(Test) {
  48. /// increased logging for tests
  49. testLogging {
  50. events "passed", "skipped", "failed"
  51. }
  52. }
  53. android {
  54. compileSdkVersion 23
  55. buildToolsVersion "23.0.3"
  56. defaultConfig {
  57. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  58. // arguments to be passed to functional tests
  59. testInstrumentationRunnerArgument "TEST_USER", "\"$System.env.OCTEST_APP_USERNAME\""
  60. testInstrumentationRunnerArgument "TEST_PASSWORD", "\"$System.env.OCTEST_APP_PASSWORD\""
  61. testInstrumentationRunnerArgument "TEST_SERVER_URL", "\"$System.env.OCTEST_SERVER_BASE_URL\""
  62. }
  63. // adapt structure from Eclipse to Gradle/Android Studio expectations;
  64. // see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
  65. sourceSets {
  66. main {
  67. manifest.srcFile 'AndroidManifest.xml'
  68. java.srcDirs = ['src']
  69. resources.srcDirs = ['src']
  70. aidl.srcDirs = ['src']
  71. renderscript.srcDirs = ['src']
  72. res.srcDirs = ['res']
  73. assets.srcDirs = ['assets']
  74. }
  75. // move whole local unit tests structure as a whole from src/test/* to test/*
  76. test.setRoot('test')
  77. // move whole instrumented tests structure as a whole from src/androidTest/* to androidTest/*
  78. androidTest.setRoot('androidTest')
  79. // Move the build types to build-types/<type>
  80. // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
  81. // This moves them out of them default location under src/<type>/... which would
  82. // conflict with src/ being used by the main source set.
  83. // Adding new build types or product flavors should be accompanied
  84. // by a similar customization.
  85. debug.setRoot('build-types/debug')
  86. release.setRoot('build-types/release')
  87. }
  88. compileOptions {
  89. sourceCompatibility JavaVersion.VERSION_1_7
  90. targetCompatibility JavaVersion.VERSION_1_7
  91. }
  92. lintOptions {
  93. abortOnError false
  94. }
  95. packagingOptions {
  96. exclude 'META-INF/LICENSE.txt'
  97. }
  98. }