-
Notifications
You must be signed in to change notification settings - Fork 578
/
build.gradle
117 lines (103 loc) · 3.64 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
plugins {
id 'groovy'
}
sourceSets {
main {
java {
srcDirs = ['src/java', 'src/fakeAnnotations', 'src/fakeLibraries']
}
groovy {
srcDirs = ['src/groovy']
}
}
}
dependencies {
implementation 'jakarta.servlet:jakarta.servlet-api:4.0.4'
implementation 'jakarta.ejb:jakarta.ejb-api:3.2.6'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.google.guava:guava:33.2.0-jre'
implementation libs.guice
implementation libs.guice.assistedinject
implementation libs.guice.servlet
implementation 'com.google.truth:truth:1.4.2'
implementation 'joda-time:joda-time:2.12.7'
api 'com.github.stephenc.jcip:jcip-annotations:1.0-1'
implementation 'org.springframework:spring-core:5.3.34'
compileOnly 'jakarta.annotation:jakarta.annotation-api:1.3.5'
implementation 'org.checkerframework:checker-qual:3.42.0'
implementation 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
implementation 'org.junit.jupiter:junit-jupiter-params:5.10.2'
implementation 'org.testng:testng:7.10.2'
implementation project(':spotbugs')
api project(':spotbugs-annotations')
implementation 'org.apache.groovy:groovy-all:4.0.21'
implementation 'org.apache.commons:commons-lang3:3.14.0'
implementation 'org.mockito:mockito-core:5.11.0'
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << '-Xlint:none'
options.encoding = 'UTF-8'
if (it.name == 'classesJava21') {
options.release = 21
} else if (it.name == 'classesJava17') {
options.release = 17
} else if (it.name == 'classesJava11') {
options.release = 11
} else if (it.name != 'compileJava') {
options.release = 8
}
}
// This disables hundreds of javadoc warnings on missing tags etc, see #340
tasks.named('javadoc', Javadoc).configure {
// This is supposed to enable everything except "missing" but doesn't work with gradle
// See http://docs.oracle.com/javase/8/docs/technotes/tools/unix/javadoc.html
options.addBooleanOption('Xdoclint:all,-missing', true)
// TODO remove command and warning below if the doclint can be properly configured
options.addStringOption('Xmaxwarns', '3')
doLast {
logger.warn('Javadoc: too many warnings, only first 3 are shown, see #340!')
}
}
def classesJava8 = tasks.register('classesJava8', JavaCompile) {
destinationDirectory.set(layout.buildDirectory.dir("classes/java/java8"))
classpath = sourceSets.main.compileClasspath
source = file('src/java8')
}
def classesJava11 = tasks.register('classesJava11', JavaCompile) {
destinationDirectory.set(layout.buildDirectory.dir("classes/java/java11"))
classpath = sourceSets.main.compileClasspath
source = file('src/java11')
}
def classesJava17 = tasks.register('classesJava17', JavaCompile) {
destinationDirectory.set(layout.buildDirectory.dir("classes/java/java17"))
classpath = sourceSets.main.compileClasspath
source = file('src/java17')
}
def classesJava21 = tasks.register('classesJava21', JavaCompile) {
destinationDirectory.set(layout.buildDirectory.dir("classes/java/java21"))
classpath = sourceSets.main.compileClasspath
source = file('src/java21')
}
def jvmVersion = JavaVersion.current()
tasks.named('classes').configure {
dependsOn classesJava8
dependsOn classesJava11
if (jvmVersion.isCompatibleWith(JavaVersion.VERSION_17)) {
dependsOn classesJava17
} else {
println "skip tests for Java 17 features"
}
if (jvmVersion.isCompatibleWith(JavaVersion.VERSION_21)) {
dependsOn classesJava21
} else {
println "skip tests for Java 21 features"
}
}
sonar {
// this project should not be analyzed with sonarqube
// as it is test data, not real code
skipProject true
}
spotbugs {
ignoreFailures = true
}