Adam Murdoch wrote:
[snip]
I put a println in the alldocs tasks and I definitely see that before
the println at the top of my first child project. So it all makes
sense... I just don't know how to get my child projects to configure
themselves before the alldocs task configures itself.
As I mentioned before, you shouldn't have to. The Javadoc task is
supposed to evaluate its inputs lazily, that is, when the task executes,
which is after all the projects have been configured. And this works
fine for the Gradle build, and for a test build. So something about your
build is causing this to not work.
Let's try this:
task alldocs(type: Javadoc) {
subprojects.each {subproject ->
subproject.sourceSets.each {sourceSet ->
source { sourceSet.java } // <- note the reference to
sourceSet.java is in a closure
}
}
}
In retrospect this seems obvious, but it was my debug output that was
failing. Once I fixed the optionsFile issue then the javadoc is
generated correctly. Since my debug output was executing during
configuration time it was getting invalid results.
The sourceSets wiring is really almost magical.
At any rate, here is what I ended up with in case anyone cares or there
is a better way to do this:
task alldocs(type: Javadoc) {
title = "Meta-JB version $version Project API Documentation"
destinationDir = new File(project.buildDir, 'docs/javadoc')
optionsFile = new File( 'build/tmp/javadoc.txt' )
subprojects.each {subproject ->
source subproject.sourceSets.main.java
}
subprojects.each {subproject ->
if( classpath )
classpath += subproject.sourceSets.main.classes +
subproject.sourceSets.main.compileClasspath
else
classpath = subproject.sourceSets.main.classes +
subproject.sourceSets.main.compileClasspath
}
}
I still need to figure out how to set some of the options that I'm used
to but at least it works. :)
Thanks for your patience.
-Paul
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email