ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: how to detect a file while looping thru a list of directories
Date Thu, 04 Mar 2010 14:56:24 GMT
Just describe the path with a fileset (or use the fileset directly as  
this deprecated approach should still work):

<fileset dir="C:\temp" includes="*/test.xml" />

or

<fileset dir="C:\temp" includes="**/test.xml" />

if you're wanting to match test.xml at any point in that directory  
structure...

HTH,
Matt


On Mar 4, 2010, at 5:09 AM, Michael Powe wrote:

> On Wed, Mar 03, 2010 at 05:08:06PM -0800, Andy2008 wrote:
>
>> I want to loop thru a list of directories and only call a target  
>> called "ABC"
>> if a directory contains a "test.xml" file.  below is my initial code
>>
>> <foreach target="ABC" param="ABCParam">
>>     	<path>
>>       		<dirset dir="c:\temp"/>
>>       	</path>
>> </foreach>
>>
>> Do you have any ideas?
>
> Hello,
>
> <project default="main">
>   <target name="main" depends="check" if="ok">
> 	<echo>
> 	  it works.
> 	</echo>
>   </target>
>   <target name="check">
> 	<condition property="ok">
> 	  <or>
> 		<available file="test.xml" filepath="/home/powem/src/php"/>
> 		<available file="test.xml" filepath="/home/powem/src/java"/>
> 	  </or>
> 	</condition>
>   </target>
> </project>
>
>
> Thanks.
>
> mp
>
> -- 
> Michael Powe		michael@trollope.org		Naugatuck CT USA
>
>
>  If you can't learn to do it well, learn to enjoy doing it badly.


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


Mime
View raw message