-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
112 lines (94 loc) · 3.56 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
// ========== GRADLE PLUGINS / REPOSITORIES SETUP
buildscript {
repositories {
mavenCentral()
}
dependencies {
}
}
allprojects {
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'project-report'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: classes) {
classifier = 'javadoc'
from javadoc
}
javadoc {
failOnError = false
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
artifacts {
archives sourcesJar, javadocJar
}
repositories {
mavenCentral()
}
idea {
module {
downloadSources = true
}
}
// http://www.gradle.org/docs/current/userguide/java_plugin.html
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
// Disable jar, sourcesJar, and javadoc tasks for the root project - we only want them to run for submodules
jar.enabled = false
sourcesJar.enabled = false
javadocJar.enabled = false
// ========== PROPERTIES FOR GRADLE BUILD - DEPENDENCY VERSIONS / ETC
ext {
slf4jVersion = '1.7.36'
junitVersion = '4.11'
mockitoVersion = '1.10.19'
assertJVersion = '3.5.2'
junitDataproviderVersion = '1.11.0'
// JACOCO PROPERTIES
jacocoToolVersion = '0.8.4'
// Anything in this jacocoExclusions list will be excluded from coverage reports. The format is paths to class
// files, with wildcards allowed. e.g.: jacocoExclusions = [ "com/nike/Foo.class", "**/Bar*.*" ]
jacocoExclusions = []
jacocoCoverageThresholdSetup = {
configure(subprojects.findAll { isSubprojectIncludedInJacocoReports(it) }) {
// Configure the minimum code coverage rules.
jacocoTestCoverageVerification { JacocoCoverageVerification v ->
violationRules {
rule { JacocoViolationRule r ->
enabled = true
limit {
minimum = 0.95
counter = "INSTRUCTION"
}
}
rule { JacocoViolationRule r ->
enabled = true
limit {
minimum = 0.95
counter = "BRANCH"
}
}
}
}
}
}
// Configure which subprojects we're doing jacoco for.
isSubprojectIncludedInJacocoReports = { Project subProj ->
// For this repo we'll include everything that's not a sample or testonly module.
return !subProj.name.startsWith("sample") && !subProj.getName().startsWith("testonly")
}
}
// ========== COMBO TEST REPORT - View the combined/merged report at: [project_root]/build/reports/tests/index.html
apply from: file(rootProject.projectDir.getAbsolutePath() + '/gradle/junitComboTestReport.gradle')
// ========== JACOCO SETUP - View the combined/merged report at: [project_root]/build/reports/jacoco/jacocoRootReport/html/index.html.
// Individual reports for each submodule can be found at: [project_root]/[submodule]/build/reports/jacoco/test/html/index.html
apply from: file(rootProject.projectDir.getAbsolutePath() + '/gradle/jacoco.gradle')
// ========== MAVEN CENTRAL PUBLISHING
apply from: file(rootProject.projectDir.getAbsolutePath() + '/gradle/publishing.gradle')