From the sample:
<jar basedir="${build}/preverifiedobf"
jarfile="${build}/bin/${program_name}.jar"
manifest="bin/MANIFEST.MF">
<fileset dir="${top}/${res}">
<include name="${package_name}/*.png"/>
</fileset>
</jar>
This will only include *.png
files which are in /res
folder. If you want to include more types, add more <include>
lines or include "${package_name}/**"
.
If you want to include the content of existing .jar files, you can unjar them like this:
<mkdir dir="${build}/libs"/>
<unjar src="yourlibrary.jar" dest="${build}/libs" />
Then you can jar them up again:
<jar basedir="${build}/preverifiedobf"
jarfile="${build}/bin/${program_name}.jar"
manifest="bin/MANIFEST.MF">
<fileset dir="${top}/${res}">
<include name="${package_name}/*.png"/>
</fileset>
<fileset dir="${build}/libs">
<include name="**/*"/>
</fileset>
</jar>
The Apache Ant manual contains a lot of examples for all the supported tags.