SBNTT
08/13/2019, 4:10 PMlouiscad
08/13/2019, 4:27 PMtasks.all {
dependsOn(yourTask)
}
louiscad
08/13/2019, 4:28 PMtasks.all {
if (this != yourTask) dependsOn(yourTask)
}
SBNTT
08/13/2019, 4:41 PMtasks.all {
if (this.name != "customTask") dependsOn customTask
}
and
tasks.all {
if (this != tasks.getByName("customTask")) dependsOn customTask
}
SBNTT
08/13/2019, 4:45 PMthis != yourTask
does not work because my custom task is of type Execlouiscad
08/13/2019, 4:48 PMequals
.
This should work but keep in mind it's using internal API, so they could change in the future:
tasks.all {
if (this != yourTask && yourTask !in taskDependencies.getDependencies(this)) {
dependsOn(yourTask)
}
}
SBNTT
08/13/2019, 4:53 PMlouiscad
08/13/2019, 4:54 PMSBNTT
08/13/2019, 5:11 PM