forked from testcontainers/testcontainers-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci-support.gradle
34 lines (30 loc) · 1.15 KB
/
ci-support.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
import groovy.json.JsonOutput
// Emit a JSON-formatted list of check tasks to be run in CI
task testMatrix {
project.afterEvaluate {
def checkTasks = subprojects.collect {
it.tasks.findByName("check")
}.findAll { it != null }
dependsOn(checkTasks)
doLast {
def checkTaskPaths = checkTasks
.collect { it.path }
println(JsonOutput.toJson(checkTaskPaths))
}
}
}
// If we're executing the `testMatrix` task, disable tests and other slow tasks
// so that we can get a result quickly.
gradle.taskGraph.whenReady {
if (it.hasTask(tasks.testMatrix)) {
for (subproject in subprojects) {
subproject.tasks.withType(Test).all {
testExecuter([execute: { spec, processor -> }, stopNow:{}] as org.gradle.api.internal.tasks.testing.TestExecuter)
}
subproject.tasks.findByName("shadowJar")?.enabled = false
subproject.tasks.findByName("javadoc")?.enabled = false
subproject.tasks.findByName("delombok")?.enabled = false
subproject.tasks.findByName("japicmp")?.enabled = false
}
}
}