/
build.gradle
82 lines (73 loc) · 2.22 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'jacoco'
jacoco {
toolVersion = Versions.jacoco
}
android {
compileSdkVersion Versions.compile_sdk
defaultConfig {
minSdkVersion Versions.min_sdk
targetSdkVersion Versions.target_sdk
versionCode Versions.lemniscate_version_code
versionName Versions.lemniscate_version_name
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
testCoverageEnabled true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
testOptions {
unitTests.all {
jacoco {
includeNoLocationClasses = true
}
}
unitTests {
includeAndroidResources = true
}
}
}
task jacocoDebugReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
reports {
csv {
enabled true
}
xml {
enabled true
}
html {
enabled true
}
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
def debugTree = fileTree(dir: "${buildDir}/intermediates/classes/debug", excludes: fileFilter)
def kotlinDebugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter)
def mainSrc = "${project.projectDir}/src/androidTest/java"
getSourceDirectories().setFrom(files([mainSrc]))
getClassDirectories().setFrom(files([debugTree], [kotlinDebugTree]))
getExecutionData().setFrom(fileTree(dir: "$buildDir", includes: [
"jacoco/testDebugUnitTest.exec",
"outputs/code-coverage/connected/*coverage.ec"
]))
}
dependencies {
implementation Deps.appcompat
implementation Deps.kotlin_stdlib
testImplementation Deps.junit
testImplementation Deps.mockito_core
testImplementation Deps.mockito_kotlin
testImplementation Deps.truth
testImplementation Deps.robolectric
}
repositories {
mavenCentral()
}