-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
124 lines (104 loc) · 3.2 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
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'java'
buildscript {
ext.kotlin_version = '1.1.1'
repositories {
jcenter()
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'net.researchgate:gradle-release:2.4.0'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.3.1'
classpath 'com.noveogroup.android:check:1.2.4'
}
}
allprojects {
repositories {
jcenter()
}
}
subprojects { proj ->
apply plugin: 'jacoco'
jacoco {
version "0.7.1.201405082137"
}
task jacocoTestReport(type: JacocoReport) {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.enabled = true
html.enabled = true
}
classDirectories = fileTree(
dir: 'build/intermediates/classes/debug',
excludes: ['**/R*.class',
'**/BuildConfig*'])
sourceDirectories = files('src/main/java')
executionData = files('build/jacoco/testDebugUnitTest.exec')
doFirst {
files('build/intermediates/classes/debug').getFiles().each { file ->
if (file.name.contains('$$')) {
file.renameTo(file.path.replace('$$', '$'))
}
}
}
}
}
jacoco {
toolVersion "0.7.1.201405082137"
}
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
group = "Reporting"
description = 'Generates an aggregate report from all subprojects'
dependsOn(subprojects.jacocoTestReport)
additionalSourceDirs = files('library/src/main/java')
sourceDirectories = files('library/src/main/java')
classDirectories = files('library/build/intermediates/classes/debug')
executionData = files(subprojects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = true
}
onlyIf = {
true
}
doFirst {
executionData = files(executionData.findAll { it.exists() })
}
}
coveralls {
sourceDirs = files('library/src/main/java').flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}
tasks.coveralls {
group = 'Coverage reports'
description = 'Uploads the aggregated coverage report to Coveralls'
dependsOn jacocoRootReport
onlyIf { System.env.'CI' }
}
// Define versions in a single place
ext {
// Sdk and tools
minSdkVersion = 10
targetSdkVersion = 24
compileSdkVersion = 24
buildToolsVersion = '24.0.2'
// App dependencies
supportLibraryVersion = '24.2.0'
guavaVersion = '18.0'
junitVersion = '4.12'
mockitoVersion = '1.10.19'
powerMockito = '1.6.2'
hamcrestVersion = '1.3'
runnerVersion = '0.5'
rulesVersion = '0.5'
espressoVersion = '2.2.2'
}