I'm trying to convert this to the "new way" as of 0.9 "Dec 10th edition" and I've fallen off the map.

I can get the jar parts to work just fine but converting the distZip task is giving me problems. I can currently get it to zip the jars in the build/libs _or_ the dependencies but not both.

Any ideas?
-Paul

Helmut Denk wrote:
samples are always a good startingpoint ...
maybe a wiki-page or snipplr.com could become source for a collection of useful gradle-snippets.


Adam Murdoch-2 wrote:
I wonder if this is the start of a 'java-application' plugin

such a plugin targets a typical usecase but implicates the danger of beeing 'overgeneric'.

for the interested gradle-user ... i improved my script a little bit:


Set runtimeLibFiles = configurations.runtime.resolve()

manifest.mainAttributes(
  'Provider': group,
'Main-Class': 'insert_mainclass_here', 'Implementation-Version': version,
  'Built-With': 'gradle-' + new GradleVersion().getVersion(),
  'Class-Path': getManifestCp(runtimeLibFiles))

task distZip(type: Zip) {
  fileSet(dir: libsDir)
  zipFileSet(dir: 'lib') {
          runtimeLibFiles.each {        
                include(it.name)
          }
          prefix = 'lib'
  }
  files(new File('insert_name_of_propertiesfile_here'))
}

String getManifestCp(Set runtimeLibFiles) {
        StringBuffer manifestCp = new StringBuffer()
        runtimeLibFiles.eachWithIndex() {
                                file, index ->
if (index > 0) manifestCp.append(' ')
                manifestCp.append("lib/$file.name")
        }
        return manifestCp.toString()    
}


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

   http://xircles.codehaus.org/manage_email


Reply via email to