Dynamic tasks not showing up in tasks list?


(George Stockfisch) #1

I’m having some minor issue with dynamic tasks.

tools = [‘tool1’, ‘tool2’, ‘tool3’ ] task makeAll( dependsOn: tasks.matching { Task task -> task.name.startsWith(“cppMake”)} ){}

tools.each { singleTool ->

task “cppMake$singleTool” {

println “building: $singleTool”

} }

if I do a “gradle tasks” none of my dynamic tasks show up. If I remove the “dependsOn: tasks.matching { Task task -> task.name.startsWith(“cppMake”)}” then I get all the tasks listed.

I’m new to dynamic tasks, as I’m sure you can see, but I don’t understand why adding the dependsOn, removes my dynamic tasks from my tasks list.


(Peter Niederwieser) #2

‘gradle tasks’ only shows a subset of tasks, including those that no other tasks depend on. ‘gradle tasks --all’ shows all tasks.


(George Stockfisch) #3

That worked, thanks.