ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Butch Clark <>
Subject Re: [[antlist] delete and filesets]
Date Wed, 25 Jul 2001 13:18:56 GMT

When you specify an include (or includes as an attribute on the fileset tag)
those are the only files included.  So you don't need an explicit exclude for
your "*.java" files.

For example:  The following task deletes all the class files starting in the
"test" directory, and all its subdirectories:

<target name="delClasses">
		<fileset dir="test" >
			<include name="**/*.class" />

This leaves all the source code files (and all other non-.class files) alone.


"T Master" <> wrote:
> I want to delete only  *.class  files, so i have used the following code
> below.  However, is it imperative I use the exclude name, to avoid deletion
> of source files?
> <target name="cleanClasses">
>     <delete verbose="true|false">
>         <fileset>
>             <include name="**/*.class" />
>             <include name="**/*.class~" />
>             <exclude name="**/*.java" />
>             <exclude name="**/*.java~" />
>             <exclude name="**/*.vss" />
>         </fileset>
>     </delete>
> </target>

This email message is for the sole use of the intended recipient(s) and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by reply email and destroy
all copies of the original message.

View raw message