Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
177 lines (158 loc) · 4.61 KB
/
Copy pathbuild.gradle
File metadata and controls
177 lines (158 loc) · 4.61 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import com.github.spotbugs.snom.Effort
import com.github.spotbugs.snom.SpotBugsTask
plugins {
id "jacoco"
id "pmd"
id "checkstyle"
id 'maven-publish'
id 'com.gradle.plugin-publish' version '1.2.1'
id 'com.diffplug.spotless' version '7.0.2'
id "net.ltgt.errorprone" version "4.1.0"
id "net.ltgt.nullaway" version "2.2.0"
id "com.github.spotbugs" version "6.1.3"
}
group = 'io.github.mridang.gradle'
version = project.findProperty("version") ?: "0.0.0"
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
javadoc.options.addStringOption('Xdoclint:none')
// Configuration for the Spotbugs plugin. It seems that it isn't possible to define
// the output report formats here and those seem to be defined on the individual
// task level.
spotbugs {
effort = Effort.MAX
showProgress = true
}
tasks.withType(SpotBugsTask).configureEach { task ->
task.reports {
sarif {
required = true
}
xml {
required = true
}
html {
required = true
}
}
}
// Configuration for the Checkstyle plugin. It seems that it isn't possible to define
// the output report formats here and those seem to be defined on the individual
// task level.
checkstyle {
config = rootProject.resources.text.fromFile("gradle/config/checkstyle/google_checks.xml")
}
tasks.withType(Checkstyle).configureEach { task ->
task.enabled = true
task.reports {
sarif {
required = true
}
xml {
required = true
}
html {
required = true
}
}
}
//// Configuration for the nullaway extension. The rest of the parameters must be
//// specified on the java-compile tasks. The only option that be specified here
//// is the name of the root package to be analysed.
nullaway {
annotatedPackages.add("io.github.mridang")
}
// Configuration for the Jacoco plugin. It seems that it isn't possible to define
// the output report formats here and those seem to be defined on the individual
// task level.
jacoco {
}
// We only need the XML report so that the CI tools can parse it. The HTML isn't needed.
jacocoTestReport {
reports {
csv {
required = true
destination = file("$buildDir/reports/jacoco/test/jacoco.csv")
}
xml {
required = true
destination = file("$buildDir/reports/jacoco/test/jacoco.xml")
}
html {
required = true
}
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
reports {
junitXml {
required = true
destination = file("$buildDir/reports/tests/test")
}
html {
required = true
}
}
systemProperty 'java.awt.headless', 'true'
maxParallelForks = (int) (Runtime.runtime.availableProcessors() / 2 + 1)
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}
spotless {
java {
target '**/*.java'
targetExclude 'buildSrc/build/**/*'
googleJavaFormat()
}
}
dependencies {
checkstyle group: 'com.puppycrawl.tools', name: 'checkstyle', version: '10.23.1'
errorprone group: 'com.uber.nullaway', name: 'nullaway', version: '0.12.2'
errorprone group: 'com.google.errorprone', name: 'error_prone_core', version: '2.36.0'
spotbugsPlugins group: 'com.h3xstream.findsecbugs', name: 'findsecbugs-plugin', version: '1.13.0'
spotbugs group: 'com.github.spotbugs', name: 'spotbugs', version: '4.8.6'
jacocoAgent group: 'org.jacoco', name: 'org.jacoco.agent', version: '0.8.12'
jacocoAnt group: 'org.jacoco', name: 'org.jacoco.ant', version: '0.8.12'
implementation gradleApi()
implementation group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1u2'
implementation group: 'com.spotify', name: 'missinglink-core', version: '0.2.11'
implementation("com.fasterxml.jackson.core:jackson-databind:2.18.2")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.19.0")
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.11.4'
}
gradlePlugin {
website = "https://github.com/mridang/gradle-missinglink"
vcsUrl = "https://github.com/mridang/gradle-missinglink"
plugins {
missingLink {
id = 'io.github.mridang.gradle.missinglink'
implementationClass = 'io.github.mridang.gradle.missinglink.MissingLinkPlugin'
displayName = 'Gradle MissingLink Plugin'
description = 'A Gradle plugin that checks for dependency conflicts using Spotify MissingLink'
tags.set([
'dependencies',
'classpath',
'verfication',
])
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}