You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Mikael Petterson (KI/EAB)" <mi...@ericsson.com> on 2007/02/16 09:29:52 UTC

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 ',' ?
<fileset dir="${dir}">
     <include name="**/*.java"/>
     <excludesfile
name="**/AlarmListInfoTest.java;**/AlarmsDefinitionsConsistencyTest.java
"
</fileset>

Cheers,

//mikael

Re: RE: Exclude list of files with fileset

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Mikael,

-------- Original-Nachricht --------
Datum: Fri, 16 Feb 2007 14:40:22 +0100
Von: "Mikael Petterson \\(KI/EAB\\)" <mi...@ericsson.com>
An: "Ant Users List" <us...@ant.apache.org>
CC: 
Betreff: RE: Exclude list of files with fileset

> 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"/>

this is wrong

the right way is

      <exclude name="AlarmListInfoTest.java"/>
      <exclude name="AlarmsDefinitionsConsistencyTest.java"/>

...

     the exclude nested element does not expect a comma separated list in the name attribute.

Regards,

Antoine


>     </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 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Exclude list of files with fileset

Posted by "Mikael Petterson (KI/EAB)" <mi...@ericsson.com>.
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:foamdino@gmail.com] 
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: user-unsubscribe@ant.apache.org For additional
commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Exclude list of files with fileset

Posted by Kevin Jackson <fo...@gmail.com>.
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.java
> "
> </fileset>

Thanks,
Kev

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org