-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
138 lines (117 loc) · 4.06 KB
/
build.gradle
File metadata and controls
138 lines (117 loc) · 4.06 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
// mavenCentral()
// mavenLocal()
}
dependencies {
// https://github.com/melix/japicmp-gradle-plugin/issues/36
classpath 'com.google.guava:guava:30.1.1-jre'
classpath 'com.github.tjni.captainhook:captain-hook:0.1.5'
}
}
plugins {
id 'io.franzbecker.gradle-lombok' version '5.0.0'
// id 'com.github.johnrengelman.shadow' version '8.1.1' // requires Gradle 8.x but Ubuntu LTS snaps are limited to 7.2
id 'me.champeau.gradle.japicmp' version '0.4.1' apply false
id 'com.diffplug.spotless' version '6.13.0' apply false
id 'org.owasp.dependencycheck' version "7.4.4"
}
apply from: "$rootDir/gradle/ci-support.gradle"
apply plugin: 'com.github.tjni.captainhook'
apply plugin: 'org.owasp.dependencycheck'
captainHook {
autoApplyGitHooks = Boolean.valueOf(System.getenv("AUTO_APPLY_GIT_HOOKS"))
preCommit = './gradlew spotlessApply'
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'idea'
// apply plugin: 'io.franzbecker.gradle-lombok'
// apply from: "$rootDir/gradle/shading.gradle"
apply from: "$rootDir/gradle/spotless.gradle"
apply plugin: 'checkstyle'
group = "com.coyotesong.testcontainers-java-extras"
// I don't know why I need to explicitly set this
// while the org.testcontainers:testcontainers-java does not.
// Still misunderstand gradle.properties?...
version = '0.5.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
repositories {
// jcenter()
mavenCentral()
}
configurations {
api.canBeResolved=true // for publication
provided
api.extendsFrom(provided)
}
// specific modules should be excluded from publication
if ( ! ["test-support", "jdbc-test"].contains(it.name)) {
apply from: "$rootDir/gradle/publishing.gradle"
}
//if ( ! ["test-support", "jdbc-test"].contains(it.name) && !it.path.startsWith(":docs:") && it != project(":docs") ) {
// apply from: "$rootDir/gradle/publishing.gradle"
// if (it.name != "bom") {
// apply plugin: "me.champeau.gradle.japicmp"
// tasks.register('japicmp', me.champeau.gradle.japicmp.JapicmpTask)
// apply from: "$rootDir/gradle/japicmp.gradle"
// }
//}
test {
defaultCharacterEncoding = "UTF-8"
testLogging {
displayGranularity 1
showStackTraces = true
exceptionFormat = 'full'
events "STARTED", "PASSED", "FAILED", "SKIPPED"
}
ext.isCI = System.getenv("CI") != null
if (isCI) {
retry {
maxRetries = 2
maxFailures = 5
failOnPassedAfterRetry = false
}
}
}
tasks.withType(Javadoc).all {
enabled = true
}
tasks.withType(Test).all {
reports {
junitXml.outputPerTestCase = true
}
}
// Ensure that Javadoc generation is always tested
check.dependsOn(javadoc)
// Ensure that dependency checks are always performed
check.dependsOn(dependencyCheckAggregate)
// see https://jeremylong.github.io/DependencyCheck/dependency-check-gradle/configuration.html
dependencyCheck {
format='ALL'
}
def postCheckCommand = properties["postCheckCommand"]
if (postCheckCommand) {
check.finalizedBy(tasks.create("postCheckExec", Exec) {
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
commandLine('cmd', '/c', postCheckCommand)
} else {
commandLine('sh', '-c', postCheckCommand)
}
})
}
dependencies {
testImplementation 'ch.qos.logback:logback-classic:1.3.8'
}
checkstyle {
toolVersion = "9.3"
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
}
}