/
build.gradle
96 lines (82 loc) · 2.92 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
sourceSets {
main {
java {
srcDirs = ['src/java', 'src/fakeAnnotations', 'src/fakeLibraries']
}
}
}
ext {
guiceVersion = '5.1.0'
}
dependencies {
// TODO : Some of these can be extracted to actual dependencies
implementation fileTree(dir: 'lib', include: '*.jar')
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.google.guava:guava:30.1.1-jre'
implementation "com.google.inject:guice:${guiceVersion}"
implementation "com.google.inject.extensions:guice-assistedinject:${guiceVersion}"
implementation "com.google.inject.extensions:guice-servlet:${guiceVersion}"
implementation 'com.google.truth:truth:1.1.3'
implementation 'joda-time:joda-time:2.10.14'
api 'net.jcip:jcip-annotations:1.0'
implementation 'org.springframework:spring-core:5.3.19'
compileOnly 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'org.checkerframework:checker-qual:3.22.0'
implementation 'junit:junit:4.13.2'
implementation 'org.testng:testng:7.5'
implementation project(':spotbugs')
api project(':spotbugs-annotations')
}
tasks.withType(JavaCompile).configureEach {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
}
options.compilerArgs << '-Xlint:none'
options.encoding = 'UTF-8'
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(file("$buildDir/classes/java/java8"))
classpath = sourceSets.main.compileClasspath
source = file('src/java8')
}
def classesJava11 = tasks.register('classesJava11', JavaCompile) {
destinationDirectory.set(file("$buildDir/classes/java/java11"))
classpath = sourceSets.main.compileClasspath
source = file('src/java11')
}
def classesJava17 = tasks.register('classesJava17', JavaCompile) {
destinationDirectory.set(file("$buildDir/classes/java/java14"))
classpath = sourceSets.main.compileClasspath
source = file('src/java14')
}
tasks.named('classes').configure {
dependsOn classesJava8
dependsOn classesJava11
dependsOn classesJava17
}
sonarqube {
// this project should not be analyzed with sonarqube
// as it is test data, not real code
skipProject true
}
spotbugs {
ignoreFailures = true
}