Steve Appling wrote:
Thanks for the response. There are still a few things I am not clear on, however.

Adam Murdoch wrote:

I don't think linkConfWithTask() ever did anything other than what dependsOn(configurations.compile.buildDependencies) currently does.
Apparently I misunderstood the javadoc for linkConfWithTask. What was the point
of the task name parameter?

linkConfWithTask('config', 'task') declared that task 'task' will use configuration 'config', so the project dependencies in 'config' should be added to 'task'.

I thought that it ran the the specified task for
all project dependencies in the specified configuration.


Some options:

* Option 1 *

You could use dependsOn() for each dependent project:

dependsOn(':someOtherProject')

This effectively adds:

javadoc dependsOn ':someOtherProject:javadoc'

You'd still need to declare the dependency in the compile configuration, however. Perhaps we should change the java plugin to add these in for each project which the current project dependsOn().

dependsOn() is a bit heavy-handed, however, in that it adds a bunch of dependencies that you probably don't want.
Does Project.dependsOn(':someOtherProject') add a task dependency between all tasks in this project and similarly named tasks in 'someOtherProject'?

Yes.





* Option 2 *

javadoc dependsOn { configurations.compile.buildDependencies.getDependencies(javadoc)*.project.javadoc }

i.e. javadoc dependsOn { the javadoc task in each project which the compile configuration depends on }

Perhaps the java plugin should add this dependency too. Or we could add a method to Configuration which expresses this more clearly than the above.

I think that this is what I really want, but I also think it would be useful to have a method on the configuration to help with this. Perhaps something like:

javadoc.dependsOn(configurations.compile.tasks('javadoc'))

I had not realized that Task.dependsOn could take a closure. This was the information I was missing.

Task.dependsOn() is one of the few things in Gradle which is documented in both the userguide and javadocs, and where the documentation is complete and up-to-date and has plenty of examples. I'm curious, what we could improve to help people find this information?


Adam


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to