forked from crate/crate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavaModule.gradle
More file actions
91 lines (75 loc) · 2.74 KB
/
Copy pathjavaModule.gradle
File metadata and controls
91 lines (75 loc) · 2.74 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
apply plugin: 'java'
apply plugin: 'de.thetaphi.forbiddenapis'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'checkstyle'
repositories {
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
}
compileJava {
options.warnings = false
options.deprecation = false
options.compilerArgs << '-XDignore.symbol.file'
}
javadoc {
options.addStringOption('XDignore.symbol.file', '')
}
if (project.hasProperty('testLogging')) {
// Used to enable logging for tests
test {
testLogging.showStandardStreams = true
}
}
if (project.hasProperty('lint-unchecked')) {
compileJava.options.compilerArgs = compileJava.options.compilerArgs << '-Xlint:unchecked'
compileTestJava.options.compilerArgs = compileTestJava.options.compilerArgs << '-Xlint:unchecked'
}
if (project.hasProperty('lint-deprecation')) {
compileJava.options.compilerArgs = compileJava.options.compilerArgs << '-Xlint:deprecation'
compileTestJava.options.compilerArgs = compileTestJava.options.compilerArgs << '-Xlint:deprecation'
}
forbiddenApisMain {
bundledSignatures = ['jdk-unsafe', 'jdk-deprecated']
signaturesFiles = files("$rootDir/gradle/forbidden-signatures.txt")
suppressAnnotations = ['**.SuppressForbidden']
ignoreFailures = false
}
checkstyle {
toolVersion = "8.36"
def checkstyle_dir = "$rootDir/gradle/checkstyle/"
configProperties = [
'checkstyleDir' : checkstyle_dir,
// May be overwritten by other modules, e.g. enterprise
'licenseHeaderFile' : 'header.txt'
]
configFile = file(checkstyle_dir + "rules.xml")
checkstyleTest.enabled = false
}
test {
// by default `-D` arguments are "caught" in the gradle process
// and not passed-through to the test process.
// this enables test options like '-Dtests.iters=20'
System.properties.each { k, v ->
if (k.startsWith('tests.')) {
systemProperty k, v
}
}
filter {
setFailOnNoMatchingTests(false)
}
jacoco {
enabled = true;
}
// ES testing framework adds the resources target build paths to the classpath of the tests,
// but if the src/[main|test]/resources directories of a project are empty, then these dirs
// are missing from the target build directory which causes all tests to fail.
// The groovy target build paths have the same problem.
// To prevent this case we always create the target build resource and groovy directories upfront.
doFirst {
file(project.buildDir.path + '/resources/main').mkdirs()
file(project.buildDir.path + '/resources/test').mkdirs()
file(project.buildDir.path + '/classes/groovy/main').mkdirs()
file(project.buildDir.path + '/classes/groovy/test').mkdirs()
}
}