You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Eric Wood <EW...@llbean.com> on 2008/10/30 14:39:16 UTC
ANT resource selector examples
Can somebody point me to some examples on how to use resource selectors
on filelists? The manual page is a little terse and I having a hard
time finding good examples. I trying to understand how to use <non> and
<exists> to select non-existing files in the filelist.
Thanks, Eric
RE: ANT resource selector examples
Posted by Eric Wood <EW...@llbean.com>.
Thank you so much. This work great. I'll use it to help expand my knowledge on how to use this feature. Is the new "ANT in Action" book a good source of information on resources? I have an older ANT book that was good and was thinking of purchasing this book.
Eric
-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
Sent: Thursday, October 30, 2008 10:35 AM
To: user@ant.apache.org
Subject: AW: ANT resource selector examples
Based on Matts code here a working example:
<project>
<filelist id="allfiles" dir="${ant.home}/bin" files="ant.cmd,foo.txt,ant.bat,bar.txt,ant"/>
<restrict id="missingfiles">
<filelist refid="allfiles"/>
<rsel:not xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">
<rsel:exists/>
</rsel:not>
</restrict>
<echo>These files are missed: ${toString:missingfiles}</echo> </project>
This should show
Buildfile: build.xml
[echo] These files are missed: YOUR_ANT_HOME\bin\foo.txt;YOUR_ANT_HOME\bin\bar.txt
BUILD SUCCESSFUL
Jan
>-----Ursprüngliche Nachricht-----
>Von: Matt Benson [mailto:gudnabrsam@yahoo.com]
>Gesendet: Donnerstag, 30. Oktober 2008 15:14
>An: Ant Users List
>Betreff: Re: ANT resource selector examples
>
><filelist id="myfilelist" dir="foo"
>files="bar,baz,blah" />
>
><restrict id="myexistingfiles">
> <filelist refid="myfilelist" />
> <not>
> <exists />
> </not>
></restrict>
>
>HTH,
>Matt
>
>--- Eric Wood <EW...@llbean.com> wrote:
>
>> Can somebody point me to some examples on how to use resource
>> selectors on filelists? The manual page is a little terse and I
>> having a hard time finding good examples. I trying to understand how
>> to use <non> and <exists> to select non-existing files in the
>> filelist.
>>
>> Thanks, Eric
>>
>
>
>
>
>
>---------------------------------------------------------------------
>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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: AW: ANT resource selector examples
Posted by Ja...@rzf.fin-nrw.de.
Havent tried with TRUNK or 1.7.1.
You have to specify the xmlns on 1.7.0 and 1.7.1beta2.
Jan
>-----Ursprüngliche Nachricht-----
>Von: Matt Benson [mailto:gudnabrsam@yahoo.com]
>Gesendet: Donnerstag, 30. Oktober 2008 15:42
>An: Ant Users List
>Betreff: Re: AW: ANT resource selector examples
>
>Sorry, I thought Peter had fixed things so that the ns
>declarations were unnecessary.
>
>-Matt
>
>--- Jan.Materne@rzf.fin-nrw.de wrote:
>
>> Based on Matts code here a working example:
>>
>> <project>
>> <filelist id="allfiles" dir="${ant.home}/bin"
>> files="ant.cmd,foo.txt,ant.bat,bar.txt,ant"/>
>> <restrict id="missingfiles">
>> <filelist refid="allfiles"/>
>> <rsel:not
>>
>xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">
>> <rsel:exists/>
>> </rsel:not>
>> </restrict>
>> <echo>These files are missed:
>> ${toString:missingfiles}</echo>
>> </project>
>>
>> This should show
>>
>> Buildfile: build.xml
>> [echo] These files are missed:
>> YOUR_ANT_HOME\bin\foo.txt;YOUR_ANT_HOME\bin\bar.txt
>>
>> BUILD SUCCESSFUL
>>
>>
>>
>> Jan
>>
>>
>> >-----Ursprüngliche Nachricht-----
>> >Von: Matt Benson [mailto:gudnabrsam@yahoo.com]
>> >Gesendet: Donnerstag, 30. Oktober 2008 15:14
>> >An: Ant Users List
>> >Betreff: Re: ANT resource selector examples
>> >
>> ><filelist id="myfilelist" dir="foo"
>> >files="bar,baz,blah" />
>> >
>> ><restrict id="myexistingfiles">
>> > <filelist refid="myfilelist" />
>> > <not>
>> > <exists />
>> > </not>
>> ></restrict>
>> >
>> >HTH,
>> >Matt
>> >
>> >--- Eric Wood <EW...@llbean.com> wrote:
>> >
>> >> Can somebody point me to some examples on how to
>> use
>> >> resource selectors
>> >> on filelists? The manual page is a little terse
>> and
>> >> I having a hard
>> >> time finding good examples. I trying to
>> understand
>> >> how to use <non> and
>> >> <exists> to select non-existing files in the
>> >> filelist.
>> >>
>> >> Thanks, Eric
>> >>
>> >
>> >
>> >
>> >
>> >
>>
>>---------------------------------------------------------------------
>> >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
>>
>>
>
>
>
>
>
>---------------------------------------------------------------------
>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: AW: ANT resource selector examples
Posted by Matt Benson <gu...@yahoo.com>.
Sorry, I thought Peter had fixed things so that the ns
declarations were unnecessary.
-Matt
--- Jan.Materne@rzf.fin-nrw.de wrote:
> Based on Matts code here a working example:
>
> <project>
> <filelist id="allfiles" dir="${ant.home}/bin"
> files="ant.cmd,foo.txt,ant.bat,bar.txt,ant"/>
> <restrict id="missingfiles">
> <filelist refid="allfiles"/>
> <rsel:not
>
xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">
> <rsel:exists/>
> </rsel:not>
> </restrict>
> <echo>These files are missed:
> ${toString:missingfiles}</echo>
> </project>
>
> This should show
>
> Buildfile: build.xml
> [echo] These files are missed:
> YOUR_ANT_HOME\bin\foo.txt;YOUR_ANT_HOME\bin\bar.txt
>
> BUILD SUCCESSFUL
>
>
>
> Jan
>
>
> >-----Ursprüngliche Nachricht-----
> >Von: Matt Benson [mailto:gudnabrsam@yahoo.com]
> >Gesendet: Donnerstag, 30. Oktober 2008 15:14
> >An: Ant Users List
> >Betreff: Re: ANT resource selector examples
> >
> ><filelist id="myfilelist" dir="foo"
> >files="bar,baz,blah" />
> >
> ><restrict id="myexistingfiles">
> > <filelist refid="myfilelist" />
> > <not>
> > <exists />
> > </not>
> ></restrict>
> >
> >HTH,
> >Matt
> >
> >--- Eric Wood <EW...@llbean.com> wrote:
> >
> >> Can somebody point me to some examples on how to
> use
> >> resource selectors
> >> on filelists? The manual page is a little terse
> and
> >> I having a hard
> >> time finding good examples. I trying to
> understand
> >> how to use <non> and
> >> <exists> to select non-existing files in the
> >> filelist.
> >>
> >> Thanks, Eric
> >>
> >
> >
> >
> >
> >
>
>---------------------------------------------------------------------
> >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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: ANT resource selector examples
Posted by Ja...@rzf.fin-nrw.de.
Based on Matts code here a working example:
<project>
<filelist id="allfiles" dir="${ant.home}/bin" files="ant.cmd,foo.txt,ant.bat,bar.txt,ant"/>
<restrict id="missingfiles">
<filelist refid="allfiles"/>
<rsel:not xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">
<rsel:exists/>
</rsel:not>
</restrict>
<echo>These files are missed: ${toString:missingfiles}</echo>
</project>
This should show
Buildfile: build.xml
[echo] These files are missed: YOUR_ANT_HOME\bin\foo.txt;YOUR_ANT_HOME\bin\bar.txt
BUILD SUCCESSFUL
Jan
>-----Ursprüngliche Nachricht-----
>Von: Matt Benson [mailto:gudnabrsam@yahoo.com]
>Gesendet: Donnerstag, 30. Oktober 2008 15:14
>An: Ant Users List
>Betreff: Re: ANT resource selector examples
>
><filelist id="myfilelist" dir="foo"
>files="bar,baz,blah" />
>
><restrict id="myexistingfiles">
> <filelist refid="myfilelist" />
> <not>
> <exists />
> </not>
></restrict>
>
>HTH,
>Matt
>
>--- Eric Wood <EW...@llbean.com> wrote:
>
>> Can somebody point me to some examples on how to use
>> resource selectors
>> on filelists? The manual page is a little terse and
>> I having a hard
>> time finding good examples. I trying to understand
>> how to use <non> and
>> <exists> to select non-existing files in the
>> filelist.
>>
>> Thanks, Eric
>>
>
>
>
>
>
>---------------------------------------------------------------------
>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: ANT resource selector examples
Posted by Matt Benson <gu...@yahoo.com>.
<filelist id="myfilelist" dir="foo"
files="bar,baz,blah" />
<restrict id="myexistingfiles">
<filelist refid="myfilelist" />
<not>
<exists />
</not>
</restrict>
HTH,
Matt
--- Eric Wood <EW...@llbean.com> wrote:
> Can somebody point me to some examples on how to use
> resource selectors
> on filelists? The manual page is a little terse and
> I having a hard
> time finding good examples. I trying to understand
> how to use <non> and
> <exists> to select non-existing files in the
> filelist.
>
> Thanks, Eric
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org