Proper way to set the dependencies of tasks across projects


(Gloria Santin) #1

I have 2 projects that have tasks that depend on each other.
I would like to know the best way to create the dependency structure for these tasks.
Currently, I have a parent gradle file that defines the buildAll task that will create the 2 ear files for the projects.
This is the task:

gradle.projectsEvaluated {
task buildAll (dependsOn:
[ project(’:loadRemote’).remoteLoadCleanCompileStage,
project(’:load’).loadCleanCompileStage,
project(’:loadRemote’).remoteLoadPackage,
project(’:load’).loadPackage
])
}

This task runs successfully but the tasks associated with the load project do not run. During configuration I get this output:
**Task ':load:clean-compile' is not up-to-date because: Task has not declared any outputs despite executing actions.**

What is the proper way to setup the dependency structure for these tasks?