nextcloud-android/build.gradle

246 lines
7.5 KiB
Groovy
Raw Normal View History

// 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 {
2016-08-16 16:04:43 +03:00
jcenter()
2017-02-22 01:56:13 +03:00
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
2017-04-09 11:38:37 +03:00
classpath 'com.android.tools.build:gradle:2.3.1'
2017-02-23 18:52:06 +03:00
classpath 'com.google.gms:google-services:3.0.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'findbugs'
2017-03-06 16:16:31 +03:00
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
ext {
2017-03-31 03:03:15 +03:00
supportLibraryVersion = '25.0.0'
2016-08-16 18:22:22 +03:00
travisBuild = System.getenv("TRAVIS") == "true"
// allows for -Dpre-dex=false to be set
preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))
}
repositories {
2016-08-16 16:04:43 +03:00
jcenter()
maven { url "https://jitpack.io" }
2017-04-09 11:38:37 +03:00
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
2016-06-07 15:18:54 +03:00
flatDir {
dirs 'libs'
}
}
2017-01-04 21:07:31 +03:00
android {
lintOptions {
abortOnError true
lintConfig file("${project.rootDir}/lint.xml")
htmlReport true
htmlOutput file("$project.buildDir/reports/lint/lint.html")
}
2017-02-22 02:46:47 +03:00
dexOptions {
javaMaxHeapSize "4g"
}
2017-03-12 17:16:02 +03:00
compileSdkVersion 25
2017-03-16 20:04:21 +03:00
buildToolsVersion '25.0.0'
2015-11-28 13:26:58 +03:00
2016-05-05 09:46:47 +03:00
defaultConfig {
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\""
2017-02-22 02:40:03 +03:00
multiDexEnabled true
2016-05-05 09:46:47 +03:00
// 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
productFlavors {
2017-04-26 22:11:27 +03:00
// used for f-droid
generic {
applicationId 'com.nextcloud.client'
}
gplay {
applicationId 'com.nextcloud.client'
}
2017-03-17 20:35:17 +03:00
modified {
// structure is:
// domain tld
// domain name
// .client
applicationId 'com.custom.client'
}
}
configurations {
2017-03-17 20:35:17 +03:00
modifiedCompile
}
}
// 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
2016-08-16 18:22:22 +03:00
dexOptions {
// Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
preDexLibraries = preDexEnabled && !travisBuild
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
2017-04-12 15:34:43 +03:00
exclude 'META-INF/LICENSE'
}
2017-02-25 05:00:36 +03:00
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 "$project.buildDir/reports/pmd/pmd.xml"
}
html {
destination "$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 "$project.buildDir/reports/findbugs/findbugs.html"
}
}
classpath = files()
}
check.dependsOn 'checkstyle', 'findbugs', 'pmd', 'lint'
2016-06-24 01:18:45 +03:00
}
dependencies {
/// dependencies for app building
compile name: 'touch-image-view'
compile 'com.android.support:multidex:1.0.1'
2016-11-22 18:18:22 +03:00
compile 'com.github.nextcloud:android-library:check_for_unshareable_federated_shares-SNAPSHOT'
compile "com.android.support:support-v4:${supportLibraryVersion}"
compile "com.android.support:design:${supportLibraryVersion}"
compile 'com.jakewharton:disklrucache:2.0.2'
compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
compile "com.android.support:cardview-v7:${supportLibraryVersion}"
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.google.code.findbugs:annotations:2.0.1'
compile group: 'commons-io', name: 'commons-io', version: '2.4'
2017-04-11 01:00:35 +03:00
compile 'com.github.evernote:android-job:v1.1.9'
compile 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
2017-03-10 20:36:18 +03:00
compile 'org.greenrobot:eventbus:3.0.0'
2017-04-12 15:34:43 +03:00
compile 'com.googlecode.ez-vcard:ez-vcard:0.10.2'
// uncomment for gplay, modified
//compile 'com.google.android.gms:play-services:10.2.4'
2017-03-12 17:16:02 +03:00
compile 'org.parceler:parceler-api:1.1.6'
annotationProcessor 'org.parceler:parceler:1.1.6'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.caverock:androidsvg:1.2.1'
/// dependencies for local unit tests
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
/// dependencies for instrumented tests
// JUnit4 Rules
androidTestCompile 'com.android.support.test:rules:0.5'
// Android JUnit Runner
androidTestCompile 'com.android.support.test:runner:0.5'
// Android Annotation Support
2017-03-30 19:49:53 +03:00
androidTestCompile "com.android.support:support-annotations:${supportLibraryVersion}"
// Espresso core
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
//androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
//androidTestCompile "com.android.support:support-annotations:${supportLibraryVersion}"
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
tasks.withType(Test) {
/// increased logging for tests
testLogging {
events "passed", "skipped", "failed"
}
}
// uncomment for gplay, modified (must be at the bottom)
//apply plugin: 'com.google.gms.google-services'