Gradle automatically creates several build tasks based on platforms, build types, etc. Say I have a project Foo, and the generated build tasks are:
- debugFoo32
- releaseFoo32
- debugFoo64
- releaseFoo64
I want a task allFoo64, which executes both debugFoo64 and releaseFoo64.
This is my attempt:
task buildAllExecutables64 {
dependsOn project.binaries.withType(NativeLibrary).findAll { it.targetPlatform.name.contains("64") }
//Shows result of find all
println "findAll = " +
project.binaries.withType(NativeLibrary).findAll{it.targetPlatform.name.contains("64") }
}
But the output of findAll is empty. So I changed the phase in which the task is executed, changing its definition in:
task buildAllExecutables64 << {...}
This however causes this exception to be thrown:
Execution failed for task ‘:buildAllExecutables64’.
Cannot call Task.mustRunAfter(Object…) on task ‘:buildAllExecutables64’ after task has started execution. Check the configuration of task ‘:buildAllExecutables64’ as you may have misused ‘<<’ at task declaration.
Any ideas? Sorry, but I’m a Gradle newbie