How to use jarfilelist in ant jar bundler task

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 ?

It should be something like this…

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

This method is documented [here](,%20java.lang.String,%20org.gradle.api.file.FileCollection.AntType)).