Permalink
Cannot retrieve contributors at this time
34 lines (30 sloc)
1.15 KB
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} | |
} |