-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle
More file actions
67 lines (53 loc) · 1.64 KB
/
build.gradle
File metadata and controls
67 lines (53 loc) · 1.64 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
plugins {
alias libs.plugins.errorprone
alias libs.plugins.versions
alias libs.plugins.dependencycheck
alias libs.plugins.git.version
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
dependencyCheck {
scanConfigurations = ['runtimeClasspath']
}
subprojects {
apply plugin: "java"
apply plugin: 'net.ltgt.errorprone'
apply plugin: 'com.github.ben-manes.versions'
java {
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
}
repositories {
mavenCentral()
}
// Reject all non stable versions in dependency check
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
// keep current time stamps in tar
tasks.withType(Tar).configureEach {
preserveFileTimestamps = true
}
// fix or errorprone on java 21
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += "-XDaddTypeAnnotationsToSymbol=true"
}
test {
useJUnitPlatform()
}
// Standard libraries added to all projects
dependencies {
errorprone(libs.errorprone.core)
compileOnly libs.errorprone.annotations
implementation libs.slf4j.api
testImplementation(platform(libs.junit.bom))
testImplementation libs.junit.jupiter
testRuntimeOnly libs.junit.platform.launcher
testImplementation libs.mockito.core
}
}