-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.common.gradle
110 lines (95 loc) · 2.4 KB
/
build.common.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
apply plugin: 'java-library'
apply plugin: 'signing'
apply plugin: 'checkstyle'
apply plugin: 'com.github.spotbugs'
group = 'com.transferwise.common'
apply from: "${project.rootDir}/build.libraries.gradle"
configurations {
configureEach {
exclude module: 'slf4j-log4j12'
resolutionStrategy {
failOnVersionConflict()
preferProjectModules()
if (System.getenv("RUNS_IN_CI") == "true") {
// This is faster, than using Gradle's `--refresh-dependencies`, which will refresh also all non-dynamic things.
cacheDynamicVersionsFor 10, 'minutes'
cacheChangingModulesFor 10, 'minutes'
}
}
}
local {
canBeResolved(false)
canBeConsumed(false)
}
compileClasspath {
extendsFrom(local)
}
runtimeClasspath {
extendsFrom(local)
}
testCompileClasspath {
extendsFrom(local)
}
testRuntimeClasspath {
extendsFrom(local)
}
annotationProcessor {
extendsFrom(local)
}
testAnnotationProcessor {
extendsFrom(local)
}
}
java {
if (springBootVersion.startsWith("3.")) {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
} else {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
withSourcesJar()
withJavadocJar()
}
jar {
manifest {
attributes(
"Implementation-Title": "Wise graceful shutdown",
"Implementation-Version": archiveVersion
)
}
}
dependencies {
local platform(libraries.springBootDependencies)
local libraries.lombok
compileOnly libraries.spotbugsAnnotations
}
compileJava {
options.encoding = 'utf-8'
options.compilerArgs << '-parameters'
}
repositories {
mavenCentral()
maven {
url 'https://arti.tw.ee/artifactory/libs-release'
}
mavenLocal()
}
test {
useJUnitPlatform()
}
tasks.withType(Checkstyle).configureEach {
config = resources.text.fromFile(file('../google_checks.xml'))
maxWarnings = 0
reports {
xml.required = true
html.required = true
}
}
tasks.findAll { it.name.startsWith("spotbugs") }*.configure {
excludeFilter = file('../spotbugs-exclude.xml')
reports {
xml.required = true
html.required = true
}
}