Thanks for your help and suggestions.

The source subprojects*.sourceSets*.allJava form does not work - it causes
the message *Could not find property 'allJava' on SourceSet container*. The
foreach does work, so I'm fine with using that.

I created http://jira.codehaus.org/browse/GRADLE-686 for the options file
issue.

Thanks again,
  Levi

On Wed, Oct 7, 2009 at 10:43 PM, Adam Murdoch <[email protected]> wrote:

>
>
> Levi Hoogenberg wrote:
>
> I'm trying to upgrade one of my projects from Gradle 0.7 to Gradle 0.8. The
> project has a number of subprojects, for which I'd like to generate combined
> Javadocs. At the moment, I have the following in my root build.gradle:
>
> task apidocs(type: Javadoc, visible: false)  {
>     destinationDir = new File(project.buildDir, 'docs/api')
>
>     srcDirs = []
>     options.links = ['http://java.sun.com/javase/6/docs/api/']
>
>     subprojects.each {subproject ->
>         subproject.sourceSets.each {sourceSet ->
>             sourceSet.java.srcDirs.each {srcDir ->
>                 srcDirs << srcDir
>             }
>         }
>
>         if (classpath) {
>             classpath += subproject.configurations.apidocs
>         } else {
>             classpath = subproject.configurations.apidocs
>         }
>
>         if (subproject.hasProperty('apidocUrls')) {
>             options.links += subproject.property('apidocUrls')
>         }
>     }
> }
>
>
> The srcDirs property was replaced with the source property in 0.8. You
> could do something like:
>
> subprojects.each {subproject ->
>     subproject.sourceSets.each {sourceSet ->
>         source sourceSet.allJava
>     }
> }
>
> or, more concisely
>
> source subprojects*.sourceSets*.allJava
>
> I have a couple of questions:
>
> - in the 0.7 version, I used the options' classpath property, but that
> seems to be removed. My current approach seems a bit clumsy - is there a
> more elegant way?
>
>
> It was removed from the options. It was on the task and the options. Now
> it's just on the task.
>
> To assemble the classpath, you could do something like:
>
> classpath = files(subprojects*.configurations*.apidocs)
>
> Another option would be to use a configuration to declare the classpath:
>
> dependencies {
>      subprojects.each {
>          apidocs project(path: it.path, configuration: apidocs)
>     }
> }
>
> javadoc {
>     classpath = configurations.apidocs
> }
>
> - the build fails with the message *No value has been specified for
> property 'optionsFile'*. Is optionsFile intended to be required?
>
>
> It shouldn't be - could you add a JIRA issue for this?
>
>
> --
> Adam Murdoch
> Gradle Developerhttp://www.gradle.org
>
>

Reply via email to