build: Configure task rules for multiproject builds
This commit is contained in:
5 files changed
+46
-12
No files matched your search
@@ -0,0 +1,16 @@
|
|||||||
|
listOf("compileJava", "assemble", "test", "build", "publish").forEach {
|
||||||
|
tasks.register(it) {
|
||||||
|
description = "Composite task for $this"
|
||||||
|
dependsOn(getTasksByName(it, true).filter { t -> t != this })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.addRule("All subproject tasks are available as composite tasks running across all subprojects") {
|
||||||
|
val subProjectTasks = getTasksByName(this, true)
|
||||||
|
if (subProjectTasks.isNotEmpty()) {
|
||||||
|
tasks.register(this) {
|
||||||
|
description = "composite task for $this"
|
||||||
|
dependsOn(subProjectTasks)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
tasks.register("compileJava") {
|
||||||
|
group = BasePlugin.BUILD_GROUP
|
||||||
|
description = "Compile Java"
|
||||||
|
|
||||||
|
dependsOn(gradle.includedBuilds.map { it.task(":compileJava") })
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register("test") {
|
||||||
|
group = LifecycleBasePlugin.VERIFICATION_GROUP
|
||||||
|
description = "Test all"
|
||||||
|
|
||||||
|
dependsOn(gradle.includedBuilds.map { it.task(":test") })
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register("build") {
|
||||||
|
group = BasePlugin.BUILD_GROUP
|
||||||
|
description = "Build and test"
|
||||||
|
|
||||||
|
dependsOn(gradle.includedBuilds.map { it.task(":build") })
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register("publish") {
|
||||||
|
group = PublishingPlugin.PUBLISH_TASK_GROUP
|
||||||
|
description = "Publish all"
|
||||||
|
|
||||||
|
dependsOn(gradle.includedBuilds.map { it.task(":publish") })
|
||||||
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
cd tweed5 || exit
|
|
||||||
../gradlew publish
|
|
||||||
cd .. || exit
|
|
||||||
cd tweed5-minecraft || exit
|
|
||||||
./helpers/run-each-mc.sh ../gradlew publish
|
|
||||||
cd .. || exit
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
`maven-publish`
|
|
||||||
id("de.siphalor.tweed5.root-properties")
|
id("de.siphalor.tweed5.root-properties")
|
||||||
|
id("de.siphalor.tweed5.transitive-tasks")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "de.siphalor.tweed5.minecraft"
|
group = "de.siphalor.tweed5.minecraft"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
plugins {
|
plugins {
|
||||||
`test-report-aggregation`
|
`test-report-aggregation`
|
||||||
`jacoco-report-aggregation`
|
`jacoco-report-aggregation`
|
||||||
`maven-publish`
|
|
||||||
id("de.siphalor.tweed5.root-properties")
|
id("de.siphalor.tweed5.root-properties")
|
||||||
|
id("de.siphalor.tweed5.transitive-tasks")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "de.siphalor.tweed5"
|
group = "de.siphalor.tweed5"
|
||||||
@@ -41,9 +41,8 @@ reporting {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("test") {
|
tasks.named("test") {
|
||||||
group = LifecycleBasePlugin.VERIFICATION_GROUP
|
group = LifecycleBasePlugin.VERIFICATION_GROUP
|
||||||
description = "Runs all tests"
|
description = "Runs all tests"
|
||||||
subprojects.mapNotNull { it.tasks.findByName("test") }.forEach { dependsOn(it) }
|
|
||||||
finalizedBy(tasks.named("aggregatedTestReport"), tasks.named("aggregatedCoverageReport"))
|
finalizedBy(tasks.named("aggregatedTestReport"), tasks.named("aggregatedCoverageReport"))
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user