build.gradle 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.2'
  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.nextcloud:android-library:1.0.1'
  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. // Espresso core
  45. androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
  46. // UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
  47. androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
  48. }
  49. tasks.withType(Test) {
  50. /// increased logging for tests
  51. testLogging {
  52. events "passed", "skipped", "failed"
  53. }
  54. }
  55. android {
  56. compileSdkVersion 23
  57. buildToolsVersion "23.0.3"
  58. defaultConfig {
  59. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  60. // arguments to be passed to functional tests
  61. testInstrumentationRunnerArgument "TEST_USER", "\"$System.env.OCTEST_APP_USERNAME\""
  62. testInstrumentationRunnerArgument "TEST_PASSWORD", "\"$System.env.OCTEST_APP_PASSWORD\""
  63. testInstrumentationRunnerArgument "TEST_SERVER_URL", "\"$System.env.OCTEST_SERVER_BASE_URL\""
  64. applicationId "com.nextcloud.client"
  65. }
  66. // adapt structure from Eclipse to Gradle/Android Studio expectations;
  67. // see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
  68. sourceSets {
  69. main {
  70. manifest.srcFile 'AndroidManifest.xml'
  71. java.srcDirs = ['src']
  72. resources.srcDirs = ['src']
  73. aidl.srcDirs = ['src']
  74. renderscript.srcDirs = ['src']
  75. res.srcDirs = ['res']
  76. assets.srcDirs = ['assets']
  77. }
  78. // move whole local unit tests structure as a whole from src/test/* to test/*
  79. test.setRoot('test')
  80. // move whole instrumented tests structure as a whole from src/androidTest/* to androidTest/*
  81. androidTest.setRoot('androidTest')
  82. // Move the build types to build-types/<type>
  83. // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
  84. // This moves them out of them default location under src/<type>/... which would
  85. // conflict with src/ being used by the main source set.
  86. // Adding new build types or product flavors should be accompanied
  87. // by a similar customization.
  88. debug.setRoot('build-types/debug')
  89. release.setRoot('build-types/release')
  90. }
  91. compileOptions {
  92. sourceCompatibility JavaVersion.VERSION_1_7
  93. targetCompatibility JavaVersion.VERSION_1_7
  94. }
  95. lintOptions {
  96. abortOnError false
  97. }
  98. packagingOptions {
  99. exclude 'META-INF/LICENSE.txt'
  100. }
  101. }