Steve Appling wrote:
Hans Dockter wrote:
On Apr 20, 2009, at 3:26 PM, Steve Appling wrote:
I'm not clear how to accomplish what
DependencyManager.linkConfWithTask did using the new dependency
layer refactoring in the current main trunk.
I can get dependent projects to build before a given task executes
using:
task.dependsOn configurations.compile.buildDependencies
This is similar to the old:
dependencies.linkConfWithTask 'compile', 'libs'
What I want to do, though, is to make a particular task run in all
dependent modules - what I think used to be:
dependencies.linkConfWithTask 'compile', 'javadoc'
I don't see how to do this now. I need to make sure that the
javadoc for all dependent projects is built before the javadoc for
this one so that my inter-project links work correctly. BTW, it
seems like the javadoc task should already be configured to work
this way in the java plugin.
This was a bug in the Java plugin. It is fixed in trunk now. Please
give feedback if it works for you now.
Thanks, but this didn't do all that I was expecting. I think your
change effectively added:
javadoc.dependsOn(configurations.compile.getBuildDependencies())
This effectively just added the uploadDefaultInternal task for each
dependent project. While this is a necessary step towards what I
wanted, I really wanted to actually run the javadoc task on all the
dependent modules, not just build their archives.
I'm not sure if actually running the javadoc task for all dependent
modules should be the default for everyone, but that is how I wanted
my system to work. I thought that was what
"dependencies.linkConfWithTask 'compile', 'javadoc'" would do for me
in 0.5. I'm not sure how to do this now.
I don't think linkConfWithTask() ever did anything other than what
dependsOn(configurations.compile.buildDependencies) currently does.
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.
* 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.
Adam
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email