forked from kunny/RxFirebase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
128 lines (103 loc) · 3.26 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
125
126
127
128
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
apply from: file('dependencies.gradle')
repositories {
jcenter()
}
dependencies {
classpath androidBuildPlugin
classpath coverallsPlugin
classpath kotlinPlugin
}
}
allprojects {
repositories {
jcenter()
}
apply plugin: 'checkstyle'
checkstyle {
toolVersion = "6.6"
configFile = new File(rootProject.rootDir, 'config/checkstyle/checkstyle.xml')
configProperties.checkStyleConfigDir = rootProject.file('config/checkstyle')
}
task checkstyle(type: Checkstyle) {
group = "Verification"
description = "Runs checkstyle task."
source 'src'
ignoreFailures false
showViolations true
include '**/*.java'
exclude '**/gen/**'
exclude '**/**Test.java'
exclude '**/test/**'
classpath = files()
}
afterEvaluate {
tasks.findByName('check')?.dependsOn('checkstyle')
}
}
subprojects {
apply plugin: 'jacoco'
jacoco {
reportsDir = file("${buildDir}/reports")
}
task coverageReport(type: JacocoReport) {
group = "Reporting"
description = "Generate Jacoco coverage report"
sourceDirectories = files(["${projectDir}/src/main/java"])
classDirectories = fileTree(
dir: "${buildDir}/intermediates/classes/debug",
excludes: ['**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'com/android/**/*.class'])
executionData = files("${buildDir}/jacoco/testDebugUnitTest.exec")
reports {
xml.enabled = true
html.enabled = true
}
}
afterEvaluate {
tasks.findByName('coverageReport').dependsOn('testDebugUnitTest')
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'jacoco'
jacoco {
reportsDir = file("${buildDir}/reports")
}
task mergeCoverageReport(type: JacocoReport) {
group = "Reporting"
description = "Merge Jacoco coverage reports"
def sources = []
def classDirs = files()
def executions = []
subprojects.each {
if (!it.name.contains('kotlin')) {
sources << "${it.projectDir}/src/main/java"
//noinspection GrReassignedInClosureLocalVar
classDirs += fileTree(
dir: "${it.buildDir}/intermediates/classes/debug",
excludes: ['**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'com/android/**/*.class'])
def executionFile = file("${it.buildDir}/jacoco/testDebugUnitTest.exec")
if (executionFile.exists()) {
executions << executionFile.path
}
}
}
sourceDirectories = files(sources as String[])
classDirectories = classDirs
executionData = files(executions as String[])
reports {
xml.enabled = true
html.enabled = true
}
}
apply from: file('dependencies.gradle')