I have been beating my head against this and feel if I am to continue, I should just ask.
I have a project which consists of a bunch of subprojects. I am trying to write a plugin that allows me to write a build.gradle like
apply plugin: MyPlugin
runtime project(":subproject2") }
for one of the subprojects which will be conditionally added to the given root project.
The plugin MyPlugin would have as dependencies on two subprojects subproject1 and subproject2. There would be a task foo that MyPlugin would add which gets the artifacts built for subproject1 and subproject2 and all of the recursive dependencies of those projects. The subprojects will be projects with the Java plugin applied and the recursive dependencies can include other java sub projects and jar dependencies that come in from Maven or Ivy or some such thing. I want foo to have a dependency which will build all artifacts which need to be built before foo runs.
The reason I am doing this is that I want to copy all of the artifacts or the recursive dependencies from the listed subprojects into a specified directory, all jars in my immediate need, and then postprocess all of the jars after they are copied.