2016-05-04 15:33:43 +03:00
|
|
|
// 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.
|
2019-03-31 01:50:50 +03:00
|
|
|
import com.github.spotbugs.SpotBugsTask
|
2016-05-04 15:33:43 +03:00
|
|
|
|
2014-10-03 14:33:41 +04:00
|
|
|
buildscript {
|
2019-07-04 04:14:00 +03:00
|
|
|
ext.kotlin_version = '1.3.41'
|
2014-10-03 14:33:41 +04:00
|
|
|
repositories {
|
2018-10-24 09:44:44 +03:00
|
|
|
google()
|
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/'
|
|
|
|
}
|
2019-03-31 01:50:50 +03:00
|
|
|
maven {
|
|
|
|
url 'https://plugins.gradle.org/m2/'
|
|
|
|
}
|
2018-08-22 18:42:15 +03:00
|
|
|
mavenCentral()
|
2014-10-03 14:33:41 +04:00
|
|
|
}
|
|
|
|
dependencies {
|
2019-07-10 04:12:15 +03:00
|
|
|
classpath 'com.android.tools.build:gradle:3.4.2'
|
2019-02-26 05:16:44 +03:00
|
|
|
classpath('com.dicedmelon.gradle:jacoco-android:0.1.4') {
|
2019-01-15 11:29:12 +03:00
|
|
|
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
|
|
|
|
}
|
2019-03-31 01:50:50 +03:00
|
|
|
classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.6'
|
2019-05-06 14:50:28 +03:00
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
2019-05-19 13:07:39 +03:00
|
|
|
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0-RC14"
|
2014-10-03 14:33:41 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'com.android.application'
|
2019-05-19 13:07:39 +03:00
|
|
|
|
2019-05-06 14:50:28 +03:00
|
|
|
apply plugin: 'kotlin-android'
|
|
|
|
apply plugin: 'kotlin-android-extensions'
|
2019-05-19 13:07:39 +03:00
|
|
|
apply plugin: 'kotlin-kapt'
|
2016-10-09 02:33:12 +03:00
|
|
|
apply plugin: 'checkstyle'
|
|
|
|
apply plugin: 'pmd'
|
2018-03-02 14:08:09 +03:00
|
|
|
apply plugin: 'jacoco-android'
|
2019-03-31 01:50:50 +03:00
|
|
|
apply plugin: "com.github.spotbugs"
|
2019-05-19 13:07:39 +03:00
|
|
|
apply plugin: "io.gitlab.arturbosch.detekt"
|
2014-10-03 14:33:41 +04:00
|
|
|
|
2019-05-23 12:58:59 +03:00
|
|
|
configurations {
|
|
|
|
ktlint
|
2019-02-17 15:29:27 +03:00
|
|
|
|
2019-05-23 12:58:59 +03:00
|
|
|
all {
|
|
|
|
exclude group: 'com.google.firebase', module: 'firebase-core'
|
|
|
|
exclude group: 'com.google.firebase', module: 'firebase-analytics'
|
|
|
|
exclude group: 'com.google.firebase', module: 'firebase-measurement-connector'
|
|
|
|
|
|
|
|
// check for updates every build
|
|
|
|
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
|
|
|
}
|
2017-03-06 16:16:31 +03:00
|
|
|
}
|
|
|
|
|
2016-04-27 15:48:05 +03:00
|
|
|
ext {
|
2018-09-13 04:14:21 +03:00
|
|
|
jacocoVersion = "0.8.2"
|
2019-07-26 10:25:26 +03:00
|
|
|
daggerVersion = "2.24"
|
2019-05-07 18:00:22 +03:00
|
|
|
androidLibraryVersion = "master-SNAPSHOT"
|
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"))
|
2016-04-27 15:48:05 +03:00
|
|
|
}
|
2014-10-03 14:33:41 +04:00
|
|
|
|
|
|
|
repositories {
|
2018-10-24 09:44:44 +03:00
|
|
|
google()
|
2016-08-16 16:04:43 +03:00
|
|
|
jcenter()
|
2016-06-07 15:02:36 +03:00
|
|
|
maven { url "https://jitpack.io" }
|
2017-11-28 17:01:14 +03:00
|
|
|
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
2017-08-07 12:53:58 +03:00
|
|
|
|
2014-10-03 14:33:41 +04:00
|
|
|
flatDir {
|
|
|
|
dirs 'libs'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-12 14:38:38 +03:00
|
|
|
// semantic versioning for version code
|
|
|
|
def versionMajor = 3
|
2019-07-09 18:14:20 +03:00
|
|
|
def versionMinor = 8
|
2018-02-12 14:38:38 +03:00
|
|
|
def versionPatch = 0
|
2018-11-29 13:13:04 +03:00
|
|
|
def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable
|
2018-02-12 14:38:38 +03:00
|
|
|
|
2018-08-15 17:37:10 +03:00
|
|
|
def taskRequest = getGradle().getStartParameter().getTaskRequests().toString()
|
2019-05-18 21:36:12 +03:00
|
|
|
if (taskRequest.contains("Gplay") || taskRequest.contains("lint")) {
|
2018-07-13 15:03:09 +03:00
|
|
|
apply from: 'gplay.gradle'
|
|
|
|
}
|
|
|
|
|
2019-03-31 01:50:50 +03:00
|
|
|
spotbugs {
|
|
|
|
toolVersion = '3.1.12'
|
|
|
|
}
|
|
|
|
|
2014-10-03 14:33:41 +04:00
|
|
|
android {
|
2016-10-09 02:33:12 +03:00
|
|
|
lintOptions {
|
2017-05-13 09:52:56 +03:00
|
|
|
abortOnError false
|
2016-10-09 02:33:12 +03:00
|
|
|
htmlReport true
|
|
|
|
htmlOutput file("$project.buildDir/reports/lint/lint.html")
|
2018-07-03 15:33:26 +03:00
|
|
|
disable 'MissingTranslation', 'GradleDependency', 'VectorPath', 'IconMissingDensityFolder', 'IconDensities'
|
2016-10-09 02:33:12 +03:00
|
|
|
}
|
2017-02-22 02:46:47 +03:00
|
|
|
|
|
|
|
dexOptions {
|
|
|
|
javaMaxHeapSize "4g"
|
|
|
|
}
|
|
|
|
|
2018-09-24 09:42:19 +03:00
|
|
|
compileSdkVersion 28
|
2015-11-28 13:26:58 +03:00
|
|
|
|
2016-05-05 09:46:47 +03:00
|
|
|
defaultConfig {
|
2017-12-21 11:47:10 +03:00
|
|
|
minSdkVersion 14
|
2018-09-24 09:42:19 +03:00
|
|
|
targetSdkVersion 28
|
2017-12-21 11:47:10 +03:00
|
|
|
|
2016-05-09 15:06:44 +03:00
|
|
|
// arguments to be passed to functional tests
|
2019-02-21 02:15:12 +03:00
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}"
|
|
|
|
testInstrumentationRunnerArgument "TEST_SERVER_USERNAME", "${NC_TEST_SERVER_USERNAME}"
|
|
|
|
testInstrumentationRunnerArgument "TEST_SERVER_PASSWORD", "${NC_TEST_SERVER_PASSWORD}"
|
2016-06-07 22:58:37 +03:00
|
|
|
|
2017-02-22 02:40:03 +03:00
|
|
|
multiDexEnabled true
|
2016-05-05 09:46:47 +03:00
|
|
|
|
2018-03-20 14:53:56 +03:00
|
|
|
versionCode versionMajor * 10000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
|
2018-02-12 18:10:41 +03:00
|
|
|
|
2018-11-29 13:13:04 +03:00
|
|
|
if (versionBuild > 89) {
|
2018-02-12 18:10:41 +03:00
|
|
|
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
|
2018-09-19 08:46:50 +03:00
|
|
|
} else if (versionBuild > 50) {
|
2018-07-11 15:57:02 +03:00
|
|
|
versionName "${versionMajor}.${versionMinor}.${versionPatch} RC" + (versionBuild - 50)
|
2018-02-12 18:10:41 +03:00
|
|
|
} else {
|
2018-07-11 15:57:02 +03:00
|
|
|
versionName "${versionMajor}.${versionMinor}.${versionPatch} Alpha" + (versionBuild + 1)
|
2018-02-12 18:10:41 +03:00
|
|
|
}
|
2017-10-06 11:41:15 +03:00
|
|
|
|
2017-03-05 23:09:36 +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
|
2014-10-03 14:33:41 +04:00
|
|
|
|
2017-06-07 10:42:41 +03:00
|
|
|
flavorDimensions "default"
|
|
|
|
|
2018-03-02 14:08:09 +03:00
|
|
|
buildTypes {
|
|
|
|
debug {
|
2019-06-05 17:54:41 +03:00
|
|
|
testCoverageEnabled (project.hasProperty('coverage'))
|
2018-03-02 14:08:09 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-05 23:09:36 +03:00
|
|
|
productFlavors {
|
2017-04-26 22:11:27 +03:00
|
|
|
// used for f-droid
|
2017-02-24 17:22:02 +03:00
|
|
|
generic {
|
2017-02-23 17:11:56 +03:00
|
|
|
applicationId 'com.nextcloud.client'
|
2017-06-07 10:42:41 +03:00
|
|
|
dimension "default"
|
2017-02-23 17:11:56 +03:00
|
|
|
}
|
2016-08-15 15:01:00 +03:00
|
|
|
|
2017-04-28 10:26:16 +03:00
|
|
|
gplay {
|
|
|
|
applicationId 'com.nextcloud.client'
|
2017-06-07 10:42:41 +03:00
|
|
|
dimension "default"
|
2017-04-28 10:26:16 +03:00
|
|
|
}
|
|
|
|
|
2017-04-13 10:14:19 +03:00
|
|
|
versionDev {
|
|
|
|
applicationId "com.nextcloud.android.beta"
|
|
|
|
dimension "default"
|
2019-08-17 04:36:17 +03:00
|
|
|
versionCode 20190817
|
|
|
|
versionName "20190817"
|
2017-04-13 10:14:19 +03:00
|
|
|
}
|
2019-05-15 09:59:06 +03:00
|
|
|
|
|
|
|
qa {
|
|
|
|
applicationId "com.nextcloud.android.qa"
|
|
|
|
dimension "default"
|
|
|
|
versionCode 1
|
|
|
|
versionName "1"
|
|
|
|
}
|
2017-02-23 17:11:56 +03:00
|
|
|
}
|
2019-08-01 01:19:12 +03:00
|
|
|
|
|
|
|
testOptions {
|
|
|
|
unitTests.returnDefaultValues = true
|
|
|
|
}
|
2017-02-23 17:11:56 +03:00
|
|
|
}
|
2014-10-03 14:33:41 +04:00
|
|
|
|
2017-02-23 17:11:56 +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
|
2016-08-15 15:01:00 +03:00
|
|
|
|
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
|
|
|
|
}
|
2014-10-03 14:33:41 +04:00
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
exclude 'META-INF/LICENSE.txt'
|
2017-04-12 15:34:43 +03:00
|
|
|
exclude 'META-INF/LICENSE'
|
2014-10-03 14:33:41 +04:00
|
|
|
}
|
2017-02-25 05:00:36 +03:00
|
|
|
|
2019-01-15 16:12:28 +03:00
|
|
|
tasks.register("checkstyle", Checkstyle) {
|
2016-10-09 02:33:12 +03:00
|
|
|
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()
|
|
|
|
}
|
|
|
|
|
2019-01-15 16:12:28 +03:00
|
|
|
tasks.register("pmd", Pmd) {
|
2019-04-11 16:22:55 +03:00
|
|
|
ruleSetFiles = files("${project.rootDir}/ruleset.xml")
|
2016-10-09 02:33:12 +03:00
|
|
|
ignoreFailures = false
|
|
|
|
ruleSets = []
|
|
|
|
|
|
|
|
source 'src'
|
|
|
|
include '**/*.java'
|
|
|
|
exclude '**/gen/**'
|
|
|
|
|
|
|
|
reports {
|
|
|
|
xml.enabled = false
|
|
|
|
html.enabled = true
|
|
|
|
xml {
|
2017-08-08 12:36:41 +03:00
|
|
|
destination = file("$project.buildDir/reports/pmd/pmd.xml")
|
2016-10-09 02:33:12 +03:00
|
|
|
}
|
|
|
|
html {
|
2017-08-08 12:36:41 +03:00
|
|
|
destination = file("$project.buildDir/reports/pmd/pmd.html")
|
2016-10-09 02:33:12 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-31 01:50:50 +03:00
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
String variantName = variant.name
|
2019-04-29 15:53:02 +03:00
|
|
|
String capVariantName = variantName.substring(0, 1).toUpperCase() + variantName.substring(1)
|
2019-03-31 01:50:50 +03:00
|
|
|
tasks.register("spotbugs${capVariantName}", SpotBugsTask) {
|
|
|
|
ignoreFailures = false
|
|
|
|
effort = "max"
|
|
|
|
reportLevel = "medium"
|
|
|
|
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/compile${capVariantName}JavaWithJavac/classes/")
|
2019-05-18 21:36:12 +03:00
|
|
|
excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
|
2019-04-01 10:47:30 +03:00
|
|
|
pluginClasspath = project.configurations.spotbugsPlugins
|
2019-03-31 01:50:50 +03:00
|
|
|
source = fileTree('src/main/java')
|
|
|
|
classpath = files()
|
|
|
|
include '**/*.java'
|
|
|
|
exclude '**/gen/**'
|
|
|
|
|
|
|
|
reports {
|
|
|
|
xml.enabled = false
|
|
|
|
html.enabled = true
|
|
|
|
html {
|
|
|
|
destination = file("$project.buildDir/reports/spotbugs/spotbugs.html")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-23 12:58:59 +03:00
|
|
|
check.dependsOn 'checkstyle', 'spotbugs', 'pmd', 'lint', 'ktlint'
|
2016-10-09 02:33:12 +03:00
|
|
|
|
2017-05-05 21:00:52 +03:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
2019-08-11 15:11:21 +03:00
|
|
|
|
|
|
|
dataBinding {
|
|
|
|
enabled true
|
|
|
|
}
|
2016-06-24 01:18:45 +03:00
|
|
|
}
|
2017-02-23 17:11:56 +03:00
|
|
|
|
|
|
|
dependencies {
|
2018-01-10 10:13:18 +03:00
|
|
|
// dependencies for app building
|
2018-12-18 05:16:42 +03:00
|
|
|
implementation 'androidx.multidex:multidex:2.0.1'
|
2017-12-15 13:36:55 +03:00
|
|
|
// implementation project('nextcloud-android-library')
|
2019-05-07 18:00:22 +03:00
|
|
|
genericImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
|
|
|
|
gplayImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
|
|
|
|
versionDevImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
|
2019-05-23 10:48:54 +03:00
|
|
|
qaImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
|
2018-12-07 15:28:35 +03:00
|
|
|
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
|
|
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
|
|
implementation 'com.google.android.material:material:1.0.0'
|
2017-08-08 12:36:41 +03:00
|
|
|
implementation 'com.jakewharton:disklrucache:2.0.2'
|
2018-12-07 15:28:35 +03:00
|
|
|
implementation 'androidx.appcompat:appcompat:1.0.2'
|
|
|
|
implementation 'androidx.cardview:cardview:1.0.0'
|
|
|
|
implementation 'androidx.exifinterface:exifinterface:1.0.0'
|
2019-06-10 23:28:37 +03:00
|
|
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.0.0"
|
2019-01-28 15:56:37 +03:00
|
|
|
implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7
|
2017-08-08 12:36:41 +03:00
|
|
|
implementation 'com.google.code.findbugs:annotations:2.0.1'
|
2018-09-07 17:55:59 +03:00
|
|
|
implementation 'commons-io:commons-io:2.6'
|
2018-12-13 12:22:23 +03:00
|
|
|
implementation 'com.github.tobiaskaminsky:android-job:v1.2.6.1' // 'com.github.evernote:android-job:v1.2.5'
|
2019-02-15 05:15:32 +03:00
|
|
|
implementation 'com.jakewharton:butterknife:10.1.0'
|
2019-05-19 13:07:39 +03:00
|
|
|
kapt 'com.jakewharton:butterknife-compiler:10.1.0'
|
2018-09-05 18:56:31 +03:00
|
|
|
implementation 'org.greenrobot:eventbus:3.1.1'
|
2019-01-04 15:07:37 +03:00
|
|
|
implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.5'
|
2017-08-08 12:36:41 +03:00
|
|
|
implementation 'org.lukhnos:nnio:0.2'
|
2018-01-13 11:43:53 +03:00
|
|
|
implementation 'com.madgag.spongycastle:pkix:1.54.0.0'
|
2018-09-07 18:08:15 +03:00
|
|
|
implementation 'com.google.code.gson:gson:2.8.5'
|
2018-01-24 17:59:51 +03:00
|
|
|
implementation 'com.afollestad:sectioned-recyclerview:0.5.0'
|
2018-12-11 10:43:05 +03:00
|
|
|
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
2018-08-10 01:50:12 +03:00
|
|
|
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
|
2018-11-29 12:37:30 +03:00
|
|
|
implementation 'com.github.tobiaskaminsky:qrcodescanner:0.1.2.2' // 'com.github.blikoon:QRCodeScanner:0.1.2'
|
2019-02-06 09:55:50 +03:00
|
|
|
implementation 'com.google.android:flexbox:1.1.0'
|
2018-12-03 05:14:22 +03:00
|
|
|
implementation 'org.parceler:parceler-api:1.1.12'
|
2019-06-25 21:17:37 +03:00
|
|
|
kapt 'org.parceler:parceler:1.1.12'
|
2018-07-11 15:57:02 +03:00
|
|
|
implementation('com.github.bumptech.glide:glide:3.7.0') {
|
2018-04-03 18:18:24 +03:00
|
|
|
exclude group: "com.android.support"
|
|
|
|
}
|
2019-05-29 04:13:24 +03:00
|
|
|
implementation 'com.caverock:androidsvg:1.4'
|
2019-06-06 04:13:19 +03:00
|
|
|
implementation 'androidx.annotation:annotation:1.1.0'
|
2018-09-07 18:08:15 +03:00
|
|
|
implementation 'com.google.code.gson:gson:2.8.5'
|
2019-04-29 15:53:02 +03:00
|
|
|
implementation 'org.jetbrains:annotations:17.0.0'
|
|
|
|
|
2019-08-15 10:24:22 +03:00
|
|
|
implementation 'com.github.cotechde.hwsecurity:hwsecurity-fido:2.4.6'
|
2019-07-31 16:44:14 +03:00
|
|
|
|
2019-04-29 15:53:02 +03:00
|
|
|
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.9.0'
|
2019-06-17 04:12:23 +03:00
|
|
|
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.6'
|
2019-06-05 17:54:41 +03:00
|
|
|
|
2019-07-26 10:25:26 +03:00
|
|
|
implementation "com.google.dagger:dagger:$daggerVersion"
|
|
|
|
implementation "com.google.dagger:dagger-android:$daggerVersion"
|
|
|
|
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
|
|
|
|
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
|
|
|
|
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
|
2019-04-29 15:53:02 +03:00
|
|
|
|
2019-05-07 04:11:45 +03:00
|
|
|
compileOnly "org.projectlombok:lombok:1.18.8"
|
|
|
|
annotationProcessor "org.projectlombok:lombok:1.18.8"
|
2018-01-12 19:00:53 +03:00
|
|
|
|
2019-07-24 04:12:49 +03:00
|
|
|
ktlint "com.pinterest:ktlint:0.34.2"
|
2019-05-23 12:58:59 +03:00
|
|
|
|
2018-01-10 10:13:18 +03:00
|
|
|
// dependencies for local unit tests
|
2017-08-08 12:36:41 +03:00
|
|
|
testImplementation 'junit:junit:4.12'
|
2019-07-09 04:12:35 +03:00
|
|
|
testImplementation 'org.mockito:mockito-core:3.0.0'
|
2019-05-30 20:43:21 +03:00
|
|
|
testImplementation 'androidx.test:core:1.2.0'
|
2019-04-22 04:12:33 +03:00
|
|
|
testImplementation 'org.powermock:powermock-core:2.0.2'
|
2019-04-25 11:40:25 +03:00
|
|
|
testImplementation 'org.powermock:powermock-module-junit4:2.0.2'
|
|
|
|
testImplementation 'org.powermock:powermock-api-mockito2:2.0.2'
|
2019-08-07 04:12:37 +03:00
|
|
|
testImplementation 'org.json:json:20190722'
|
2019-05-13 22:14:29 +03:00
|
|
|
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0"
|
2019-06-10 23:28:37 +03:00
|
|
|
testImplementation "androidx.arch.core:core-testing:2.0.1"
|
2019-03-06 09:03:47 +03:00
|
|
|
|
2018-01-10 10:13:18 +03:00
|
|
|
// dependencies for instrumented tests
|
2017-02-23 17:11:56 +03:00
|
|
|
// JUnit4 Rules
|
2019-05-30 04:14:05 +03:00
|
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
2019-05-30 20:42:15 +03:00
|
|
|
androidTestImplementation 'androidx.test:rules:1.2.0'
|
2017-02-23 17:11:56 +03:00
|
|
|
// Android JUnit Runner
|
2019-05-30 20:42:39 +03:00
|
|
|
androidTestImplementation 'androidx.test:runner:1.2.0'
|
2017-08-31 09:01:39 +03:00
|
|
|
|
2017-02-23 17:11:56 +03:00
|
|
|
// Espresso core
|
2019-05-30 04:14:30 +03:00
|
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
2019-05-30 04:13:16 +03:00
|
|
|
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
|
2019-05-30 04:15:12 +03:00
|
|
|
androidTestImplementation 'org.mockito:mockito-core:2.28.2'
|
2017-02-23 17:11:56 +03:00
|
|
|
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
|
2018-12-10 19:26:53 +03:00
|
|
|
// androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
2017-02-23 17:11:56 +03:00
|
|
|
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
|
2017-08-08 12:36:41 +03:00
|
|
|
//androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
|
2018-09-07 17:57:08 +03:00
|
|
|
androidTestImplementation 'tools.fastlane:screengrab:1.2.0'
|
2019-05-06 14:50:28 +03:00
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
2018-06-21 10:06:33 +03:00
|
|
|
|
2018-03-02 14:08:09 +03:00
|
|
|
// jacocoAnt "org.jacoco:org.jacoco.ant:${jacocoVersion}"
|
|
|
|
// jacocoAgent "org.jacoco:org.jacoco.agent:${jacocoVersion}"
|
|
|
|
// androidJacocoAgent "org.jacoco:org.jacoco.agent:${jacocoVersion}"
|
|
|
|
// androidJacocoAnt "org.jacoco:org.jacoco.ant:${jacocoVersion}"
|
|
|
|
// androidJacocoAnt "org.jacoco:org.jacoco.core:${jacocoVersion}"
|
|
|
|
// androidJacocoAnt "org.jacoco:org.jacoco.report:${jacocoVersion}"
|
|
|
|
// androidJacocoAnt "org.jacoco:org.jacoco.agent:${jacocoVersion}"
|
2017-02-23 17:11:56 +03:00
|
|
|
}
|
|
|
|
|
2017-03-28 01:11:56 +03:00
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
|
|
|
}
|
|
|
|
|
2017-02-23 17:11:56 +03:00
|
|
|
tasks.withType(Test) {
|
2018-01-10 10:13:18 +03:00
|
|
|
// increased logging for tests
|
2017-02-23 17:11:56 +03:00
|
|
|
testLogging {
|
|
|
|
events "passed", "skipped", "failed"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-29 18:43:08 +03:00
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
variant.outputs.all { output ->
|
|
|
|
outputFileName = "${output.baseName}-${variant.versionCode}.apk"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-15 16:12:28 +03:00
|
|
|
tasks.register("combinedTestReport", JacocoReport) {
|
2018-03-02 14:08:09 +03:00
|
|
|
|
|
|
|
reports {
|
|
|
|
xml.enabled = true
|
|
|
|
html.enabled = true
|
|
|
|
}
|
|
|
|
|
|
|
|
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
|
|
|
|
def debugTree = fileTree(dir: "$project.buildDir/intermediates/classes/gplay/debug", excludes: fileFilter)
|
|
|
|
def mainSrc = "$project.projectDir/src/main/java"
|
|
|
|
|
|
|
|
sourceDirectories = files([mainSrc])
|
|
|
|
classDirectories = files([debugTree])
|
|
|
|
executionData = fileTree(dir: project.buildDir, includes: [
|
2018-07-11 15:57:02 +03:00
|
|
|
'jacoco/testGplayDebugUnitTest.exec', 'outputs/code-coverage/connected/flavors/GPLAY/*coverage.ec'
|
2018-03-02 14:08:09 +03:00
|
|
|
])
|
|
|
|
}
|
2019-05-23 12:58:59 +03:00
|
|
|
|
|
|
|
task ktlint(type: JavaExec, group: "verification") {
|
|
|
|
description = "Check Kotlin code style."
|
|
|
|
main = "com.pinterest.ktlint.Main"
|
|
|
|
classpath = configurations.ktlint
|
2019-05-19 13:07:39 +03:00
|
|
|
args "--reporter=plain", "--reporter=plain,output=${buildDir}/ktlint.txt,src/**/*.kt"
|
2019-05-23 12:58:59 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
task ktlintFormat(type: JavaExec, group: "formatting") {
|
|
|
|
description = "Fix Kotlin code style deviations."
|
|
|
|
main = "com.pinterest.ktlint.Main"
|
|
|
|
classpath = configurations.ktlint
|
|
|
|
args "-F", "src/**/*.kt"
|
|
|
|
}
|
2019-05-19 13:07:39 +03:00
|
|
|
|
|
|
|
detekt {
|
|
|
|
reports {
|
|
|
|
xml {
|
|
|
|
enabled = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
config = files("detekt.yml")
|
|
|
|
input = files("src/")
|
|
|
|
}
|