I need to create an initialization task that will be executed before any other task when it is executed.
task A {
println "Task A"
}
task initializer {
println "initialized"
}
If I execute gradle -q A, the output will be:
>initialized
>Task A
Now, if I add:
task B {
println "Task B"
}
Run gradle -q Band I get:
>initialized
>Task B
So, no matter what task I perform, it is always “initialized” first.
source
share