Peter Niederwieser wrote:
Think I figured it out myself. Maybe there is an even better solution that
doesn't create the war file in the first place?

When (if?) we reuse the copy task's CopySpec with the archive tasks, then it will be very simple, as both the war task and the explodedWar task can use exactly the same spec. Something like:

war {
   // declare the stuff to be included in the war
   from('some-dir') {
      into('WEB-INF')
      include '*.xml'
   }
   ... some other stuff for the war ...
}

task explodedWar(type: Copy) {
    from war.rootSpec  // reuse the declaration from the war task
    into new File(buildDir, 'exploded-war')
}

 Anyway, after fighting with
Maven's inflexibility for several years, it's amazing how simple it is to
customize a Gradle build. Still have to get used to that.

Cheers,
Peter

war.doLast {
  ant.unzip(src: war.archivePath, dest: "$buildDir/exploded")
}


Peter Niederwieser wrote:
I'd like to switch to a Gradle build for my Google App Engine project
(http://meet.spockframework.org). The build should produce an exploded war
directory, and preferably no war file at all. What's the best way to
achieve this?

Cheers,
Peter


Reply via email to