-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
124 lines (102 loc) · 3.52 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath Deps.tools_androidgradle
classpath Deps.tools_kotlingradle
classpath Deps.androidx_safeargs
}
}
plugins {
id("io.gitlab.arturbosch.detekt").version("1.0.0.RC9.2")
}
allprojects {
repositories {
google()
maven {
url "https://maven.mozilla.org/maven2"
}
jcenter()
}
}
subprojects {
apply plugin: 'jacoco'
afterEvaluate {
if (it.hasProperty('android')) {
jacoco {
toolVersion = "0.8.2"
}
android {
testOptions {
unitTests {
includeAndroidResources = true
}
}
lintOptions {
warningsAsErrors true
abortOnError true
}
}
if (project.hasProperty("coverage") && project.name != "support-test") {
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
finalizedBy jacocoTestReport
}
task jacocoTestReport(type: JacocoReport) {
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*',
'**/*Test*.*', 'android/**/*.*', '**/*$[0-9].*']
def kotlinDebugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter)
def javaDebugTree = fileTree(dir: "$project.buildDir/intermediates/classes/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"
sourceDirectories = files([mainSrc])
classDirectories = files([kotlinDebugTree, javaDebugTree])
executionData = fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec'
])
}
android {
buildTypes {
debug {
testCoverageEnabled true
}
}
}
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
detekt {
// The version number is duplicated, please refer to plugins block for more details
version = "1.0.0.RC9.2"
input = files("$projectDir/app/src", "$projectDir/freshtab/src", "$projectDir/extension/src", "$projectDir/dat/src")
config = files("$projectDir/config/detekt.yml")
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
reports {
html {
enabled = true
destination = file("$projectDir/build/reports/detekt.html")
}
}
}
configurations {
ktlint
}
dependencies {
ktlint "com.github.shyiko:ktlint:0.24.0"
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args "app/src/**/*.kt", "freshtab/src/**/*.kt", "extension/src/**/*.kt", "dat/src/**/*.kt", "/buildSrc/src/main/java/com/**/.kt"
}