-
Notifications
You must be signed in to change notification settings - Fork 578
/
build.gradle
97 lines (83 loc) · 2.96 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
sourceSets {
main {
java {
srcDirs = ['src/java', 'src/fakeAnnotations', 'src/fakeLibraries']
}
}
}
ext {
guiceVersion = '5.0.1'
}
dependencies {
// TODO : Some of these can be extracted to actual dependencies
implementation fileTree(dir: 'lib', include: '*.jar')
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.google.guava:guava:30.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.2'
implementation 'joda-time:joda-time:2.10.10'
api 'net.jcip:jcip-annotations:1.0'
implementation 'org.springframework:spring-core:5.3.4'
compileOnly 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'org.checkerframework:checker-qual:3.11.0'
implementation 'junit:junit:4.13.1'
implementation 'org.testng:testng:7.4.0'
implementation project(':spotbugs')
api project(':spotbugs-annotations')
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << '-Xlint:none'
options.encoding = 'UTF-8'
if (it.name == 'classesJava14') {
options.release = 15
} 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 jvmVersion = Integer.parseInt(System.getProperty("java.specification.version"))
def classesJava8 = tasks.register('classesJava8', JavaCompile) {
destinationDir = file("$buildDir/classes/java/java8")
classpath = sourceSets.main.compileClasspath
source = file('src/java8')
}
def classesJava11 = tasks.register('classesJava11', JavaCompile) {
destinationDir = file("$buildDir/classes/java/java11")
classpath = sourceSets.main.compileClasspath
source = file('src/java11')
}
def classesJava14 = tasks.register('classesJava14', JavaCompile) {
options.compilerArgs.add('--enable-preview')
destinationDir = file("$buildDir/classes/java/java14")
classpath = sourceSets.main.compileClasspath
source = file('src/java14')
}
tasks.named('classes').configure {
dependsOn classesJava8
dependsOn classesJava11
if (jvmVersion >= 14) {
dependsOn classesJava14
}
}
sonarqube {
// this project should not be analyzed with sonarqube
// as it is test data, not real code
skipProject true
}
spotbugs {
ignoreFailures = true
}