With the script that you have here, if you do a clean from the root project, and do a gradle -m war to examine the task graph, does copyWar appear?
On Thu, Jun 2, 2011 at 5:49 AM, mraccola <[email protected]> wrote: > Thought I'd shared the solution I ended up with. I added the following code > to the build script for the 2nd war project (the one that needs to import > content from another war project). > > > def thisone = fileTree { from webAppDirName } > > def explodedWebAppDir = "${buildDir}/explodedWebAppDir" > > task copyWar(type:Copy) { > from fileTree(project(':FrameworkWeb').webAppDir) > into explodedWebAppDir > exclude {fte -> thisone.contains(file("$thisone.dir/$fte.path"))} > } > > war.doFirst {copyWar.execute()} > > war { > from explodedWebAppDir > } > > > Most of the script is here to deal with a bug in Gradle's Zip task which > causes duplicate files to be added to the Zip. If that bug gets fixed then > the code becomes extremely simple as documented in this post, > http://gradle.1045684.n5.nabble.com/War-dependency-to-another-war-td4257270.html#a4257700 > War dependency to another war . > > > The basic idea of the script is to copy all non-duplicate files from the > depended-upon war project into the build/explodedWebAppDir folder and then > include the contents of this folder in the WAR. I decided to use the > depended-upon project's webAppDir instead of exploding the depended-upon > project's war because then I don't have to detect duplicates in the > WEB-INF/lib folder. > > -- > View this message in context: > http://gradle.1045684.n5.nabble.com/WAR-Overlay-tp4406652p4447986.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 > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
