You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by James Sinnamon <si...@usq.edu.au> on 2001/03/06 08:54:25 UTC
FileSet doesn't support the nested "fileset" element
I am having trouble in trying to create a "clean" target. . The
relevant section of
build.xml is below:
<!-- ===================================================================
-->
<!-- Clean
targets -->
<!--
=================================================================== -->
<target name="clean" depends="init">
<delete>
<fileset dir="${build.dir}">
<fileset dir="${src.dir}" includes="/**.class">
</delete>
</target>
</project>
.... and the output, when I run ant (through build.sh) is:
me:~/multipi:./build.sh clean
Building with classpath :
Starting Ant...
Searching for build.xml ...
Buildfile: /home/sinnamon/multipi/build.xml
BUILD FAILED
/home/sinnamon/multipi/build.xml:88: Class
org.apache.tools.ant.types.FileSet
doesn't support the nested "fileset" element
Total time: 1 second
... the documentation, in the "Ant user manual", in html, regarding the
"delete"
task. seems to be incomplete, or out of date (or have I missed
something?).
Would someone be able to tell me what I am doing wrong,
and, also , if possible, supply me with an example of a workable
"delete" task.
TIA,
James
--
James Sinnamon sinnamon@usq.edu.au
ph 07 46315566, 0412 319669
PO Box 517 Darling Heights QLD 4350
Re: FileSet doesn't support the nested "fileset" element
Posted by Peter Donald <do...@apache.org>.
At 11:16 7/3/01 +1000, James Sinnamon wrote:
>Still, having fixed the obvious mistake, I find myself still unable to
create a
>"clean" target which works properly, in relation to "*~" files.
>
>Here is the relevant sectiion of my build.xml file:
>
> <target name="clean" depends="init">
> <delete dir="${build.dir}"/>
> <delete>
> <fileset dir="${src.dir}" includes="**/*~"/>
> <fileset dir="${src.dir}" includes="**/*.class"/>
> </delete>
> </target>
yep - there is some files that are excluded by default (CVS directories~
files etc) so you need to specifiy defaultexclude="no" like
<delete>
<fileset dir="." includes="**/*~" defaultexcludes="no"/>
</delete>
Cheers,
Pete
*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof." |
| - John Kenneth Galbraith |
*-----------------------------------------------------*
Re: FileSet doesn't support the nested "fileset" element
Posted by James Sinnamon <si...@usq.edu.au>.
Firstly,
Thanks for pointing out what should have been obvious .
"J.Teo" wrote:
> Peter Donald wrote:
> >
> > At 05:54 6/3/01 +1000, James Sinnamon wrote:
> > > <target name="clean" depends="init">
> > > <delete>
> > > <fileset dir="${build.dir}">
> > > <fileset dir="${src.dir}" includes="/**.class">
> >
> > You end your tags with > rather than /> which is confusing the XML parser
> > ;) Fix that and it should work.
D'oh!
> >
> > Cheers,
> >
> > Pete
>
> I wouldn't call it "confusing the XML parser", though. He said something he
> didn't mean. The XML parser was right. :) Sorry, don't mean to be picky ...
>
> -jay
Still, having fixed the obvious mistake, I find myself still unable to create a
"clean" target which works properly, in relation to "*~" files.
Here is the relevant sectiion of my build.xml file:
<target name="clean" depends="init">
<delete dir="${build.dir}"/>
<delete>
<fileset dir="${src.dir}" includes="**/*~"/>
<fileset dir="${src.dir}" includes="**/*.class"/>
</delete>
</target>
... (I have also tried <fileset dir="${src.dir}" includes="**/*\~"/> and
<fileset dir="${src.dir}" includes="**/*[~]"/>)
Here is a listing of files and directories:
me:~/multipi:find src
src
src/CVS
src/CVS/Root
src/CVS/Repository
src/CVS/Entries
src/org
src/org/CVS
src/org/CVS/Root
src/org/CVS/Repository
src/org/CVS/Entries
src/org/multipi
src/org/multipi/CVS
src/org/multipi/CVS/Root
src/org/multipi/CVS/Repository
src/org/multipi/CVS/Entries
src/org/multipi/EmptyMsg.java
src/org/multipi/Interaction.java
src/org/multipi/Interactor.java
src/org/multipi/Message.java
src/org/multipi/MsgHeader.java
src/org/multipi/MsgQueue.java
src/org/multipi/MsgSlot.java
src/org/multipi/Multipi.java
src/org/multipi/Team.java
src/org/multipi/Team.java~
src/org/multipi/MsgSlot.java~
src/org/multipi/Multipi.class
... I run ant as follows:
me:~/multipi:./build.sh clean
Building with classpath :
Starting Ant...
Searching for build.xml ...
Buildfile: /home/sinnamon/multipi/build.xml
init:
----------- MULTIPI 0.1.1 [2001] ------------
clean:
[delete] Deleting 1 files from /home/sinnamon/multipi/src
BUILD SUCCESSFUL
Total time: 2 seconds
... after running ant, the *.class file(s) is removed, but the *~ files
are still there:
me:~/multipi/src/org/multipi:ls
CVS Interactor.java MsgQueue.java Multipi.java
EmptyMsg.java Message.java MsgSlot.java Team.java
Interaction.java MsgHeader.java MsgSlot.java~ Team.java~
... would someone know how to fix this? A copy of clean target which
handles *~ files and other types would be greatly appreciated.
TIA
James
--
James Sinnamon sinnamon@usq.edu.au
ph 07 46315566, 0412 319669
PO Box 517 Darling Heights QLD 4350
Re: FileSet doesn't support the nested "fileset" element
Posted by "J.Teo" <jc...@yahoo.com>.
Peter Donald wrote:
>
> At 05:54 6/3/01 +1000, James Sinnamon wrote:
> > <target name="clean" depends="init">
> > <delete>
> > <fileset dir="${build.dir}">
> > <fileset dir="${src.dir}" includes="/**.class">
>
> You end your tags with > rather than /> which is confusing the XML parser
> ;) Fix that and it should work.
>
> Cheers,
>
> Pete
I wouldn't call it "confusing the XML parser", though. He said something he
didn't mean. The XML parser was right. :) Sorry, don't mean to be picky ...
-jay
Re: FileSet doesn't support the nested "fileset" element
Posted by Peter Donald <do...@apache.org>.
At 05:54 6/3/01 +1000, James Sinnamon wrote:
> <target name="clean" depends="init">
> <delete>
> <fileset dir="${build.dir}">
> <fileset dir="${src.dir}" includes="/**.class">
You end your tags with > rather than /> which is confusing the XML parser
;) Fix that and it should work.
Cheers,
Pete
*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof." |
| - John Kenneth Galbraith |
*-----------------------------------------------------*