-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
120 lines (97 loc) · 3.13 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
import com.github.spotbugs.snom.Confidence
import com.github.spotbugs.snom.Effort
import com.github.spotbugs.snom.SpotBugsReport
import com.github.spotbugs.snom.SpotBugsTask
plugins {
id 'java-library'
id 'maven-publish'
id 'checkstyle'
id 'com.github.spotbugs' version '6.1.3'
id 'com.github.ben-manes.versions' version '0.52.0'
}
ext {
minOpenfireVersion = '4.7.0'
pluginName = 'Password Reset'
pluginDescription = 'Provides the ability for users to reset their own passwords if they have forgotten them.'
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
withJavadocJar()
withSourcesJar()
}
apply from: 'build.openfire-plugin.gradle'
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}
checkstyle {
toolVersion = '10.21.1'
maxWarnings = 0
}
tasks.withType(Checkstyle).configureEach {
reports {
xml.required = false
html.required = true
}
exclude '**/org/jivesoftware/openfire/plugin/passwordreset/jsp/**'
}
spotbugs {
effort = Effort.MAX
reportLevel = Confidence.values()[0] // LOW - See also https://github.com/spotbugs/spotbugs-gradle-plugin/issues/972
ignoreFailures.set false
extraArgs.add "-longBugCodes"
}
//noinspection ConfigurationAvoidance - as this registers a new task, we can't use .forEach
tasks.withType(SpotBugsTask) {
reports(({
text.enabled = true
xml.enabled = false
} as Closure<NamedDomainObjectContainer<? extends SpotBugsReport>>))
//noinspection GroovyAssignabilityCheck
tasks.register("${it.name}Report") {
def input = reports.named("text").get().outputLocation.asFile.get()
inputs.file input
doLast {
input.readLines().forEach {
println(it)
}
}
}
it.finalizedBy "${it.name}Report"
}
spotbugsMain {
classes = classes.filter {
!it.path.contains(new File('/org/jivesoftware/openfire/plugin/passwordreset/jsp/').path)
}
}
dependencies {
def lombok = 'org.projectlombok:lombok:1.18.36'
annotationProcessor lombok
compileOnly lombok
implementation 'com.github.spotbugs:spotbugs-annotations:4.9.0'
implementation 'com.github.bbottema:emailaddress-rfc2822:2.3.1'
testAnnotationProcessor lombok
testCompileOnly lombok
testImplementation platform('org.junit:junit-bom:5.11.4')
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.mockito:mockito-junit-jupiter:5.15.2'
testImplementation 'org.assertj:assertj-core:3.27.3'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
dependencyUpdates.gradleReleaseChannel="current"
// See https://github.com/jeremylong/DependencyCheck/issues/2764#issuecomment-680680558 flr an expla nation
dependencies {
components {
withModule('org.dom4j:dom4j', ClearDependencies)
}
}
class ClearDependencies implements ComponentMetadataRule {
void execute(ComponentMetadataContext context) {
context.details.allVariants { withDependencies { clear() } }
}
}