How to use jarfilelist in ant jar bundler task


(Stephan Pfab) #1

I am converting a ant build to a gradle build. The ant jarbundler task works except for the inclusion of the runtime dependencies. Jarbundler uses an nested datatype task ‘jarfilelist’ for this. Assuming that all jars are already collected in one directory than, works in ant.

How do you formulate that in gradle ?


(Luke Daley) #2

It should be something like this…

ant.jarbundler {
  configurations.runtime.addToAntBuilder(ant, "jarfileset", FileCollection.AntType.FileSet)
}

This method is documented [here](http://gradle.org/docs/current/javadoc/org/gradle/api/file/FileCollection.html#addToAntBuilder(java.lang.Object,%20java.lang.String,%20org.gradle.api.file.FileCollection.AntType)).