ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KC Baltz <>
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."


At 11:00 AM 1/29/02, you wrote:
>I want to do something like this:
><prop name="file" value="file.xml"/>
><target name="build">
>   <condition ifexists="${file}">
>      <ant buildfile="${file}" .../>
>   </condition>
>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.
>Laurent Duperval <>
>We'll get along fine as soon as you realize I'm God.
>To unsubscribe, e-mail:   <>
>For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message