ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KC Baltz <KBa...@responsenetworks.com>
Subject Re: Executing a target if a file exists
Date Tue, 29 Jan 2002 19:30:52 GMT
Take a look at the <available> task.  I know it can set a property to 
"true" if it finds a file, but I'm not sure if it's limited to looking for 
that file in the classpath or not.

 From the docs:
"Sets a property if a resource is available at runtime. This resource can 
be a file, a directory, a class in the classpath, or a JVM system resource."

K.C.

At 11:00 AM 1/29/02, you wrote:
>Hello,
>
>I want to do something like this:
>
><prop name="file" value="file.xml"/>
>
><target name="build">
>   <condition ifexists="${file}">
>      <ant buildfile="${file}" .../>
>   </condition>
></target>
>
>So basically, if file.xml exists, the build target tries to compile using it
>as the buildfile. Otherwise, nothing happens.
>
>It looks like it can be done, but I'm not sure how.
>
>Thanks,
>
>L
>
>--
>Laurent Duperval <mailto:lduperval@microcelli5.com>
>
>We'll get along fine as soon as you realize I'm God.
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

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


Mime
View raw message