T
Thomas Stien
I want to add a couple of files to a jar archive with the ANT built tool.
The files are spread over three different directories.
Simplified the situation is as follows:
1.) Include all files from directory ${blah} and its subdirectories
2.) Include exactly the files karl.txt and paul.txt from directory ${test}
3.) All files from directory ${myproj} (but NOT its subdirectories)
except the file log.dat
Can I achieve this with ONE jar target with three filesets?
The following doesn't work. The first part is collected successfully
but there are differences with the latter two. The files from the second
part are not included whereas the files from the subdirectories are
included in the third part.
How can it be done better?
(All files are existing)
<target name="bbb" description="Build test jar file" depends="aaa">
<jar destfile="mytest.jar">
<fileset dir="${blah}" />
<fileset dir="${test}" >
<filename name="**/karl.txt" />
<filename name="**/paul.txt" />
</fileset>
<fileset dir="${myproj}" excludefile="${myproj}/log.dat" />
</jar>
</target>
Thomas
The files are spread over three different directories.
Simplified the situation is as follows:
1.) Include all files from directory ${blah} and its subdirectories
2.) Include exactly the files karl.txt and paul.txt from directory ${test}
3.) All files from directory ${myproj} (but NOT its subdirectories)
except the file log.dat
Can I achieve this with ONE jar target with three filesets?
The following doesn't work. The first part is collected successfully
but there are differences with the latter two. The files from the second
part are not included whereas the files from the subdirectories are
included in the third part.
How can it be done better?
(All files are existing)
<target name="bbb" description="Build test jar file" depends="aaa">
<jar destfile="mytest.jar">
<fileset dir="${blah}" />
<fileset dir="${test}" >
<filename name="**/karl.txt" />
<filename name="**/paul.txt" />
</fileset>
<fileset dir="${myproj}" excludefile="${myproj}/log.dat" />
</jar>
</target>
Thomas