ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Powe <mich...@trollope.org>
Subject Re: how to detect a file while looping thru a list of directories
Date Thu, 04 Mar 2010 11:09:41 GMT
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.

Mime
View raw message