I have an alljavadoc task that attempts to aggregate information from the
sources from all subprojects into a full project javadoc task.

task alljavadoc(type: Javadoc) {}

def depTasks = []
subprojects.each
{
  Project subproject ->

  depTasks.add(subproject.classes)
}

alljavadoc.dependsOn depTasks

alljavadoc.doFirst()
{
  Task task ->

  task.project.subprojects.each
  {
    Project subproject ->
    task.source = task.source + subproject.javadoc.source

    // NOTE: All java plugin projects have "compile"
    if (subproject.configurations.findByName('compile') != null)
    {
      subDeps = subproject.configurations.compile.getDependencies()
      task.project.configurations.compile.getDependencies().addAll(subDeps)
    }

    // NOTE: All java war plugin projects have "providedCompile"
    if (subproject.configurations.findByName('providedCompile') != null)
    {
      subDeps = subproject.configurations.providedCompile.getDependencies()
      task.project.configurations.compile.getDependencies().addAll(subDeps)
    }
  }
}

This definitely works fine in 0.8, and it also worked in older 0.9 snapshots
(don't know exactly when it started failing.

The stack trace is:
        at
org.gradle.api.internal.file.CompositeFileTree.getSourceCollections(CompositeFileTree.java:30)
        at
org.gradle.api.internal.file.CompositeFileTree$FilteredFileTree.addSourceCollections(CompositeFileTree.java:90)
        at
org.gradle.api.internal.file.CompositeFileCollection.getSourceCollections(CompositeFileCollection.java:149)
        at
org.gradle.api.internal.file.CompositeFileTree.getSourceCollections(CompositeFileTree.java:30)
        at
org.gradle.api.internal.file.CompositeFileTree$FilteredFileTree.addSourceCollections(CompositeFileTree.java:90)
        at
org.gradle.api.internal.file.CompositeFileCollection.getSourceCollections(CompositeFileCollection.java:149)
(until StackOverflow occurs)

Obviously there is an infinite recursion happening.

There is probably a much better way to do what I've done in 0.9, but that's
what worked for me in 0.8.

I'll gladly accept suggestions on how to do the equivalent of what I've
defined in 0.9 without the failure, but since it worked in 0.8 and earlier
0.9 snapshots, I'm kind of curious as to what fundamentally changed to allow
this cycle to occur.

-Spencer
-- 
View this message in context: 
http://old.nabble.com/StackOverflow-with-latest-0.9-snapshot-from-Feb-02%2C-2010-tp27475547p27475547.html
Sent from the gradle-user mailing list archive at Nabble.com.


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

    http://xircles.codehaus.org/manage_email


Reply via email to