On Sep 4, 2009, at 11:05 AM, Jira wrote:


Hi,

I would like to use http://one-jar.sourceforge.net/ project to generate jar containing all libs important for running project. This project has special
ant task to create such a jar:

<one-jar destfile="hello.jar" manifest="hello.mf">
  <main>
     <fileset dir="${classes.dir}/src"/>
  </main>
  <lib>
     <fileset file="${build.dir}/lib.jar" />
  </lib>
</one-jar>

And this task need reference to manifest file. But I would like to reference
to gradle's one. Is it possible in some way?

My task in gradle looks like:

ant.taskdef(name: "oneJar", classname:
"com.simontuffs.onejar.ant.OneJarTask", classpath:
configurations.oneJar.asPath)
ant.oneJar(destfile: new File(distsDir, name + "-" + version + ".jar"),
manifest: ??manifest.file??) {
  main() {
     fileset(dir: classesDir)
  }
  lib() {
     fileset(dir: libsDir)
  }
}       

Thanks a lot for any help ...

This is possible.

manifest.createManifest() returns a java.util.jar.Manifest object which has a write() method.

As your pseudo code above suggests, I think Gradle should provide a Manifest.toFile() method. Could you file a Jira?

- Hans

--
Hans Dockter
Gradle Project Manager
http://www.gradle.org

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

   http://xircles.codehaus.org/manage_email


Reply via email to