-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
87 lines (74 loc) · 2.71 KB
/
build.gradle.kts
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
import net.ltgt.gradle.errorprone.errorprone
import net.ltgt.gradle.errorprone.CheckSeverity
buildscript {
repositories {
gradlePluginPortal()
maven { setUrl("https://palantir.bintray.com/releases") }
}
}
repositories {
mavenCentral()
maven { setUrl("https://palantir.bintray.com/releases") }
}
plugins {
`java-library`
jacoco
// Part of palantir baseline sanity checks.
// Processor for Google's "Error Prone" tool.
id("org.inferred.processors") version "3.6.0"
id("com.palantir.baseline") version "4.47.0"
id("org.asciidoctor.jvm.convert") version "3.3.2"
}
java {
withSourcesJar()
withJavadocJar()
}
asciidoctorj {
modules {
diagram.use()
diagram.setVersion("2.2.1")
}
}
dependencies {
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation("com.google.guava:guava:30.1-jre")
val log4jVersion = "2.14.1"
implementation("org.apache.logging.log4j:log4j-api:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-core:$log4jVersion")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion")
// Use JUnit Jupiter API for testing.
val junitVersion = "5.8.2"
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.assertj:assertj-core:3.21.0")
testImplementation("org.mockito:mockito-core:4.1.0")
}
tasks.withType<JavaCompile>().configureEach {
options.errorprone.disable("MissingSummary", "EqualsGetClass", "OptionalOrElseMethodInvocation",
"PreferSafeLoggableExceptions", "PreferSafeLoggingPreconditions",
"StrictUnusedVariable" // Re-enable in the future
)
options.errorprone {
check("PreferSafeLogger", CheckSeverity.OFF)
check("PreferSafeLoggingPreconditions", CheckSeverity.OFF)
check("PreferSafeLoggableExceptions", CheckSeverity.OFF)
check("Slf4jLogsafeArgs", CheckSeverity.OFF)
}
}
tasks.named<JavaCompile>("compileTestJava") {
options.errorprone.isEnabled.set(false)
}
tasks.withType<Javadoc>().configureEach {
options.encoding = "UTF-8"
}
tasks.named<org.asciidoctor.gradle.jvm.AsciidoctorTask>("asciidoctor") {
// By default the output dir is "build/docs/asciidoc".
// For github-pages we expose the "docs" root directory.
// However, we want to use the asciidoc as the index page of the website.
setOutputDir(file("build/docs"))
}
val test by tasks.getting(Test::class) {
// Use junit platform for unit tests
useJUnitPlatform()
}