ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Multiple directory existence checking
Date Tue, 11 May 2004 16:01:09 GMT
Okay, gotta get my $0.02 in...

Using pure Ant, since you have said that all
directories share a parent, you should be able to do
what you want using:

a list of the subdirectories
one or more <dirset>s
one or more <pathconvert> invocations
the <equals> condition, possibly

-Matt

--- Peter Reilly <peter.reilly@corvil.com> wrote:
> Dominique Devienne wrote:
> 
> >>From: Rhino [mailto:rhino1@sympatico.ca]
> >>I may give this a try myself but I thought I'd
> post this first to minimize
> >>the time you have to wait for a suggestion. If I
> get my experiment to
> >>work, I'll post the technique.
> >>    
> >>
> >
> >Something along the lines of (untested):
> >
> ><condition property="all there">
> >  <and>
> >    <available file="${root}/dir1" type="dir" />
> >    <available file="${root}/dir2" type="dir" />
> >    <available file="${root}/dir3" type="dir" />
> >  </and>
> ></condition>
> >  
> >
> This works fine if you know the directories.
> If you do not (directories are in a property), you
> need to
> use something like the ant-contrib for task:
> <project xmlns:ac="antlib:net.sf.antcontrib">
>   <property name="root" location="src"/>
>   <property name="subdirs" value="a:b:c:d"/>
>   <target name="check.allpresent">
>     <ac:for list="${subdirs}" delimiter=":"
> param="dir">
>        <ac:sequential>
>           <condition property="not.all.there">
>              <not>
>                <available file="${root}/@{dir}"
> type="dir"/>
>              </not>
>           </condition>
>       </ac:sequential>
>     </ac:for>
>   </target>
>   <target name="dothetask"
> depends="check.allpresent" 
> unless="not.all.there">
>     ...
>   </target>
> </project>
> 
> Peter
> 
> >--DD
> >
>
>---------------------------------------------------------------------
> >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
> 



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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


Mime
View raw message