forked from palantir/tritium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
113 lines (100 loc) · 3.76 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
buildscript {
repositories {
mavenCentral()
maven {
url 'https://dl.bintray.com/palantir/releases/'
}
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.netflix.nebula:nebula-publishing-plugin:11.1.0'
classpath 'com.palantir.baseline:gradle-baseline-java:0.57.0'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.5.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.11.0'
classpath 'gradle.plugin.org.inferred:gradle-processors:2.2.0'
}
}
apply plugin: 'java'
apply plugin: 'com.palantir.baseline'
apply plugin: 'com.palantir.consistent-versions'
apply plugin: 'com.palantir.git-version'
allprojects {
group 'com.palantir.tritium'
version gitVersion()
apply plugin: 'java-library'
apply plugin: 'org.inferred.processors' // installs the "processor" configuration needed for baseline-error-prone
apply plugin: 'com.palantir.baseline-class-uniqueness'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
configurations {
checkstyle {
resolutionStrategy {
// checkstyle requires different Guava
force 'com.google.guava:guava:25.1-jre'
}
}
}
repositories {
mavenCentral()
maven {
url 'https://dl.bintray.com/palantir/releases/'
}
maven {
url 'https://dl.bintray.com/marshallpierce/maven/'
}
}
plugins.withId('com.palantir.baseline-error-prone', {
dependencies {
compileOnly 'com.google.code.findbugs:jsr305'
errorprone 'com.uber.nullaway:nullaway'
}
tasks.withType(JavaCompile).configureEach {
options.errorprone.disableWarningsInGeneratedCode = true
options.errorprone.errorproneArgs += [
'-Werror',
'-Xlint:deprecation',
'-Xlint:unchecked',
'-XepDisableWarningsInGeneratedCode',
// skipping Immutable* explicitly due to https://github.com/google/error-prone/issues/1165
'-XepExcludedPaths:.*(generated|Immutable).*',
'-XepOpt:NullAway:AnnotatedPackages=com.palantir',
'-Xep:AmbiguousMethodReference:ERROR',
'-Xep:BoxedPrimitiveConstructor:ERROR',
'-Xep:CatchFail:ERROR',
'-Xep:ClassCanBeStatic:ERROR',
'-Xep:DefaultCharset:ERROR',
'-Xep:FunctionalInterfaceClash:ERROR',
'-Xep:JavaTimeDefaultTimeZone:ERROR',
'-Xep:MethodCanBeStatic:ERROR',
'-Xep:NullAway:ERROR',
'-Xep:NonCanonicalStaticMemberImport:ERROR',
'-Xep:PreferSafeLoggableExceptions:ERROR',
'-Xep:PreferSafeLoggingPreconditions:ERROR',
'-Xep:ReturnMissingNullable:ERROR',
'-Xep:Slf4jLogsafeArgs:ERROR',
'-Xep:SwitchStatementDefaultCase:ERROR',
'-Xep:UnnecessaryParentheses:ERROR',
'-Xep:UnusedVariable:ERROR',
]
}
})
tasks.withType(Test) {
testLogging {
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
events "started", "passed", "skipped", "failed"
}
}
tasks.withType(Javadoc) {
// suppress Javadoc doclint warnings in Java 8+
if (!System.getProperty("java.version").startsWith("1.7")) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
tasks.check.dependsOn(javadoc)
}