Hi,

I need to exclude specific file names since these are clearcase elements
and cannot ( should not ) be removed. I don't want the error message to
show so I thought excluding them from the fileset would do it.

<target name="test:clean" depends="init" description="clean all build
products.">
   <echo message="cleaning test ..."/> 
   <delete quiet="false" failonerror="false">
    <fileset dir="${classes.dir}"/>
    <fileset dir="${out.instr.dir}"/>
    <fileset dir="${test.classes.dir}"/>
    <fileset dir="${coverage.dir}"/>
    <fileset dir="${test.reports.dir}"/>
    <fileset dir="${test.alarm.dir}">
     <!--<include name="**/*.java"/>-->
      <exclude name="AlarmListInfoTest.java,
AlarmsDefinitionsConsistencyTest.java,
AlmDeviceWithAlarmsTestVobEdition.java,
NbapCommonWithAlarmsTestVobEdition.java,SectorWithAlarmsTestVobEdition.j
ava, TestAlarmBase.java,XxMoWithAlarmsTestTemplate.java"/>
    </fileset>
    <fileset dir="${test.function.dir}">
     <include name="**/*.java"/>
     <!-- only vob objects -->
     <exclude name="**/manual/*"/>
    </fileset>
    <fileset dir="${qrank.dir}"/>
   </delete>
  </target>

Here is the output that I still get. How can I get rid of the

[delete] Unable to delete file ... 

It seems like the exclude does not work!

What am I missing out?

Cheers,

//mikael 

-----Original Message-----
From: Kevin Jackson [mailto:[EMAIL PROTECTED] 
Sent: den 16 februari 2007 10:24
To: Ant Users List
Subject: Re: Exclude list of files with fileset

Hi,

> Is this the way to exclude the a list of files ( I have more names 
> that I need to exclude)? Shall I use ';' or the regular ',' ?

If you check the manual online :

http://ant.apache.org/manual/CoreTypes/fileset.html

You'll see that the the excludesfile is actually a text file of exclude
patterns (or filenames) to exclude from the fileset

You need to use something like :

<fileset dir="${dir}">
  <include name="**/*.java"/>
  <exclude name="**/AlarmListInfoTest.java,
**/AlarmsDefinitionsConsistencyTest.java"/>
</fileset>

but if you just want to exclude your test sources (so long as they
follow the pattern of being called *Test.java)

<fileset dir="${dir}">
  <include name="**/*.java"/>
  <exclude name="**/*Test.java"/>
</fileset>

> <fileset dir="${dir}">
>      <include name="**/*.java"/>
>      <excludesfile
> name="**/AlarmListInfoTest.java;**/AlarmsDefinitionsConsistencyTest.ja
> va
> "
> </fileset>

Thanks,
Kev

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to