The issue :
All my custom task in my gradle project are always launch, even When I don't call them./don't depend them
The context:
I adding multiple custom task to my project
this.tasks.add(task(MyTask(type: Copy) {
dependsOn "publish"
println "MyTask"
}))
My issue is that all my custom task are always launched (even when I do just a clean !)
>gradle clean
...
log: MyTask
...
I don't have a dependsOn MyTask hidden anywhere. I have the same issue with task who don't depend of anything and are not depended by anything .My IDE put the MyTask in the category "other".
I've use a taskTree plugin, who don't reveal anything expect:
> gradle clean tasktree
...
log: MyTask
...
"no mention of MyTask in the tree, but it's launched anyway"
and also
>gradle clean MyTask tasktree
...
log: MyTask
...
:myProject:MyTask
\--- :myProject:publish
How can I forbid the launch of MyTask when I don't do publish?