I want to write a set of global tasks which should be available in every project in my multip-project setup. The tasks are not project-related and thus should be executed only once, also if I execute the task in the root folder. How can I achieve that?
In the root project I put this build.gradle:
allprojects {
task myTask() {
doLast{
println("hello world")
}
}
}
If I run the task “myTask” in root folder, the task will be executed in root and all subprojects. I want to execute the task only once.