-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
128 lines (105 loc) · 4.35 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 {
repositories {
google()
mavenCentral()
maven{ url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:8.4.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.12.2'
classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2'
//classpath 'com.palantir:jacoco-coverage:0.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply plugin: 'com.github.kt3k.coveralls'
apply from: 'configs.gradle'
allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
maven { url "https://jitpack.io" }
maven { url "https://repository.liferay.com/nexus/content/repositories/public" }
maven {
url "https://dl.cloudsmith.io/public/terraframe/geoprism-registry/maven/"
}
maven {
url "https://api.mapbox.com/downloads/v2/releases/maven"
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = "mapbox"
// Use the secret token you stored in gradle.properties as the password
password = localProperties['mapbox.sdk.token'] ?: ""
}
}
maven{url "https://oss.sonatype.org/content/repositories/snapshots"}
maven{url "https://s01.oss.sonatype.org/content/repositories/snapshots"}
}
}
/*
task clean(type: Delete) {
delete rootProject.buildDir
}
*/
apply plugin: 'java'
coveralls {
jacocoReportPath = layout.buildDirectory.dir("reports/jacoco/jacocoFullReport/jacocoFullReport.xml")
sourceDirs += ["utils/src/main/java"
, "library/src/main/java"
, "sample/src/main/java"
, "wrapper/src/main/java"]
}
task jacocoFullReport(type: JacocoReport, group: 'Coverage reports') {
mustRunAfter ":library:testDebugUnitTest"
mustRunAfter ":utils:testDebugUnitTest"
mustRunAfter ":sample:testDebugUnitTest"
mustRunAfter ":library:connectedDebugAndroidTest"
mustRunAfter ":utils:connectedDebugAndroidTest"
mustRunAfter ":sample:connectedDebugAndroidTest"
mustRunAfter ":library:jacocoTestReport"
mustRunAfter ":utils:jacocoTestReport"
mustRunAfter ":sample:jacocoTestReport"
description = 'Generates an aggregate report from all subprojects'
additionalSourceDirs.from = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from = files(subprojects.sourceSets.main.output)
List<File> executionDataPaths = new ArrayList<>()
List<File> classPaths = new ArrayList<>()
List<File> sourcePaths = new ArrayList<>()
List<File> jacocoClasspathPaths = new ArrayList<>()
for (subModule in subprojects) {
def jacocoTestReportTask = subModule.getTasksByName("jacocoTestReport", false)
jacocoTestReportTask.forEach({task ->
if (task instanceof JacocoReport) {
executionDataPaths.addAll((task as JacocoReport).executionData.getFiles())
classPaths.addAll((task as JacocoReport).classDirectories)
sourcePaths.addAll((task as JacocoReport).sourceDirectories)
jacocoClasspathPaths.addAll((task as JacocoReport).jacocoClasspath)
}
})
}
executionData.from = executionDataPaths
sourceDirectories.from = sourcePaths
classDirectories.from = classPaths
reports {
xml.required.set(true)
html.required.set(true)
xml.outputLocation = layout.buildDirectory.file("reports/jacoco/jacocoFullReport/jacocoFullReport.xml")
html.outputLocation = layout.buildDirectory.dir("reports/jacoco/jacocoFullReport/html")
}
jacocoClasspath = files(jacocoClasspathPaths)
}
task printClasspath {
doLast {
this.printClasspath
}
//def task = org.gradle.testing.jacoco.tasks.JacocoReport()
}