123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- // Gradle build file
- //
- // This project was started in Eclipse and later moved to Android Studio. In the transition, both IDEs were supported.
- // Due to this, the files layout is not the usual in new projects created with Android Studio / gradle. This file
- // merges declarations usually split in two separates build.gradle file, one for global settings of the project in
- // its root folder, another one for the app module in subfolder of root.
- buildscript {
- repositories {
- jcenter()
- maven {
- url 'https://oss.sonatype.org/content/repositories/snapshots/'
- }
- google()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:3.0.1'
- classpath 'com.google.gms:google-services:3.0.0'
- }
- }
- apply plugin: 'com.android.application'
- apply plugin: 'checkstyle'
- apply plugin: 'pmd'
- apply plugin: 'findbugs'
- configurations.all {
- // check for updates every build
- resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
- }
- ext {
- supportLibraryVersion = '26.1.0'
- googleLibraryVersion = '11.2.2'
- travisBuild = System.getenv("TRAVIS") == "true"
- // allows for -Dpre-dex=false to be set
- preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
- }
- repositories {
- jcenter()
- maven { url "https://jitpack.io" }
- maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
- google()
- flatDir {
- dirs 'libs'
- }
- }
- android {
- lintOptions {
- abortOnError false
- htmlReport true
- htmlOutput file("$project.buildDir/reports/lint/lint.html")
- disable 'MissingTranslation'
- }
- dexOptions {
- javaMaxHeapSize "4g"
- }
- compileSdkVersion 26
- buildToolsVersion '26.0.2'
- defaultConfig {
- minSdkVersion 14
- targetSdkVersion 26
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- // arguments to be passed to functional tests
- testInstrumentationRunnerArgument "TEST_USER", "\"$System.env.OCTEST_APP_USERNAME\""
- testInstrumentationRunnerArgument "TEST_PASSWORD", "\"$System.env.OCTEST_APP_PASSWORD\""
- testInstrumentationRunnerArgument "TEST_SERVER_URL", "\"$System.env.OCTEST_SERVER_BASE_URL\""
- multiDexEnabled true
- versionCode = 30010000
- versionName = "3.1.0 Alpha"
- // adapt structure from Eclipse to Gradle/Android Studio expectations;
- // see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
- flavorDimensions "default"
- productFlavors {
- // used for f-droid
- generic {
- applicationId 'com.nextcloud.client'
- dimension "default"
- }
- gplay {
- applicationId 'com.nextcloud.client'
- dimension "default"
- }
- versionDev {
- applicationId "com.nextcloud.android.beta"
- dimension "default"
- versionCode 20180215
- versionName "20180215"
- }
- }
- }
- // adapt structure from Eclipse to Gradle/Android Studio expectations;
- // see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
- dexOptions {
- // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
- preDexLibraries = preDexEnabled && !travisBuild
- }
- packagingOptions {
- exclude 'META-INF/LICENSE.txt'
- exclude 'META-INF/LICENSE'
- }
- task checkstyle(type: Checkstyle) {
- configFile = file("${rootProject.projectDir}/checkstyle.xml")
- configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath
- source 'src'
- include '**/*.java'
- exclude '**/gen/**'
- classpath = files()
- }
- task pmd(type: Pmd) {
- ruleSetFiles = files("${project.rootDir}/pmd-ruleset.xml")
- ignoreFailures = false
- ruleSets = []
- source 'src'
- include '**/*.java'
- exclude '**/gen/**'
- reports {
- xml.enabled = false
- html.enabled = true
- xml {
- destination = file("$project.buildDir/reports/pmd/pmd.xml")
- }
- html {
- destination = file("$project.buildDir/reports/pmd/pmd.html")
- }
- }
- }
- task findbugs(type: FindBugs) {
- ignoreFailures = false
- effort = "max"
- reportLevel = "high"
- classes = files("$project.buildDir/intermediates/classes")
- excludeFilter = new File("${project.rootDir}/findbugs-filter.xml")
- source 'src'
- include '**/*.java'
- exclude '**/gen/**'
- reports {
- xml.enabled = false
- html.enabled = true
- html {
- destination = file("$project.buildDir/reports/findbugs/findbugs.html")
- }
- }
- classpath = files()
- }
- check.dependsOn 'checkstyle', 'findbugs', 'pmd', 'lint'
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- }
- dependencies {
- // dependencies for app building
- implementation 'com.android.support:multidex:1.0.2'
- // implementation project('nextcloud-android-library')
- implementation 'com.github.nextcloud:android-library:1.0.38'
- versionDevImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT' // use always latest master
- implementation "com.android.support:support-v4:${supportLibraryVersion}"
- implementation "com.android.support:design:${supportLibraryVersion}"
- implementation 'com.jakewharton:disklrucache:2.0.2'
- implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
- implementation "com.android.support:cardview-v7:${supportLibraryVersion}"
- implementation "com.android.support:exifinterface:${supportLibraryVersion}"
- implementation 'com.github.tobiasKaminsky:android-floating-action-button:1.10.2'
- implementation 'com.github.albfernandez:juniversalchardet:v2.0.0'
- implementation 'com.google.code.findbugs:annotations:2.0.1'
- implementation 'commons-io:commons-io:2.5'
- implementation 'com.github.evernote:android-job:v1.2.2'
- implementation 'com.jakewharton:butterknife:8.8.1'
- annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
- implementation 'org.greenrobot:eventbus:3.0.0'
- implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.2'
- implementation 'org.lukhnos:nnio:0.2'
- implementation 'com.madgag.spongycastle:pkix:1.54.0.0'
- implementation 'com.google.code.gson:gson:2.8.2'
- // uncomment for gplay
- // implementation "com.google.firebase:firebase-messaging:${googleLibraryVersion}"
- // implementation "com.google.android.gms:play-services-base:${googleLibraryVersion}"
- // implementation "com.google.android.gms:play-services-gcm:${googleLibraryVersion}"
- // implementation "com.google.firebase:firebase-core:${googleLibraryVersion}"
- implementation 'org.parceler:parceler-api:1.1.9'
- annotationProcessor 'org.parceler:parceler:1.1.9'
- implementation 'com.github.bumptech.glide:glide:3.7.0'
- implementation 'com.caverock:androidsvg:1.2.1'
- implementation "com.android.support:support-annotations:${supportLibraryVersion}"
- implementation 'com.google.code.gson:gson:2.8.2'
- // dependencies for local unit tests
- testImplementation 'junit:junit:4.12'
- testImplementation 'org.mockito:mockito-core:1.10.19'
- // dependencies for instrumented tests
- // JUnit4 Rules
- androidTestImplementation 'com.android.support.test:rules:1.0.1'
- // Android JUnit Runner
- androidTestImplementation 'com.android.support.test:runner:1.0.1'
- // Espresso core
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
- androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.1'
- // UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
- androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
- // fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
- //androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
- implementation 'org.jetbrains:annotations:15.0'
- androidTestCompile 'tools.fastlane:screengrab:1.0.0'
- }
- configurations.all {
- resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
- }
- tasks.withType(Test) {
- // increased logging for tests
- testLogging {
- events "passed", "skipped", "failed"
- }
- }
- // uncomment for gplay (must be at the bottom)
- //apply plugin: 'com.google.gms.google-services'
|