Here is one way to achieve what you want:

subprojects.each { subproject ->
  evaluationDependsOn(subproject.path)
}

task myjar(type: Jar, dependsOn: subprojects.assemble) {
  baseName = 'fatjar'
  subprojects.each { subproject ->
    from subproject.configurations.archives.allArtifactFiles.collect {
      zipTree(it)
    }
  }
}

That produced an error ("Circular dependency between tasks"), but the following works:

subprojects.each { subproject ->
  evaluationDependsOn(subproject.path)
}

task myjar(type: Jar, dependsOn: subprojects.jar) {
  baseName = 'fatjar'
  subprojects.each { subproject ->
    from subproject.configurations.archives.allArtifactFiles.collect {
      zipTree(it)
    }
  }
}

Many thanks! I've tried various approaches, but I would have never come up with that one! There is really a step learning curve with Gradle, but it's so worth it :)

Cheers,

Marco

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

   http://xircles.codehaus.org/manage_email


Reply via email to