build.gradle 4.0 KB

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