build.gradle 4.2 KB

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