This repository has been archived by the owner on May 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
139 lines (119 loc) · 3.86 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
129
130
131
132
133
134
135
136
137
138
139
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
id "com.github.spotbugs" version "${spotbugsPluginVersion}"
id "net.ltgt.errorprone" version "${errorPronePluginVersion}"
id "checkstyle"
id "jacoco"
id "com.github.kt3k.coveralls" version "${coverallsPluginVersion}"
}
allprojects {
group = "${dcmGroupId}"
version = "${dcmVersion}"
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: "com.github.spotbugs"
apply plugin: "checkstyle"
apply plugin: "net.ltgt.errorprone"
apply plugin: "jacoco"
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation ("org.apache.logging.log4j:log4j-api") {
version {
strictly("[${log4jVersion}, 3[")
prefer("${log4jVersion}")
}
}
implementation ("org.apache.logging.log4j:log4j-core") {
version {
strictly("[${log4jVersion}, 3[")
prefer("${log4jVersion}")
}
}
implementation ("org.apache.logging.log4j:log4j-slf4j-impl") {
version {
strictly("[${log4jVersion}, 3[")
prefer("${log4jVersion}")
}
}
implementation "org.jooq:jooq:${jooqVersion}"
implementation "org.jooq:jooq-meta:${jooqVersion}"
implementation "com.google.guava:guava:${guavaVersion}"
testImplementation "org.junit.jupiter:junit-jupiter:${junitJupiterVersion}"
testImplementation "org.junit-pioneer:junit-pioneer:${junitPioneerVersion}"
spotbugs "com.github.spotbugs:spotbugs:${spotbugsVersion}"
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugsVersion}"
errorprone "com.google.errorprone:error_prone_core:${errorproneVersion}"
}
spotbugs {
effort = "Max"
excludeFilter = file("../config/spotbugs/findbugs-exclude.xml")
}
checkstyle {
toolVersion = "${checkstyleVersion}"
}
tasks.withType(JavaCompile).configureEach {
options.errorprone.disableWarningsInGeneratedCode = true
options.errorprone.excludedPaths = "(.*/com/vmware/dcm/generated/.*|.*/javacc/com/vmware/dcm/parser/.*" +
"|.*/com/vmware/dcm/k8s/generated/.*)"
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport // report is always generated after tests run
testLogging {
exceptionFormat = 'full'
}
}
// Example to configure HTML report
spotbugsMain {
reports {
html {
enabled = true
destination = file("$buildDir/reports/spotbugs/spotbugs.html")
stylesheet = 'fancy-hist.xsl'
}
}
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: '**/generated/**')
}))
}
}
}
task codeCoverageReport(type: JacocoReport) {
repositories {
mavenLocal()
mavenCentral()
}
// Gather execution data from all subprojects
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
// Add all relevant sourcesets from the subprojects
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
html.enabled true
csv.enabled false
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/generated/**', '**/**Benchmark**'])
}))
}
}