ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wascally Wabbit <wascallywab...@earthling.net>
Subject RE: testing for the existence of a file...
Date Sun, 25 Jul 2004 15:00:55 GMT
If you know the names of the .xyz files, you might try creating a
flag property using the <available> condition task and then using
the "if" w/ the appropriate target(s). Maybe something like (haven't
tried this...)

<target name="-xyz.check">
   <available property="xyz.exists" file="whatever.xyz"/>
   ...
<target>

<target name="subbuild" depends="-xyz.check" if="xyz.exists">
   ...
</target>



At 06:13 AM 7/25/2004, you wrote:

>Maybe I didn't explain my situation properly, or maybe I just couldn't
>see how uptodate helps me.
>
>I'm creating, during my build process, a tree of directories, the leaf
>nodes of which will have files of type .xyz.
>
>I wish to use subant to run a standard build file against all
>directories that contain .xyz files.  I'm therefore using the
>genericantfile attribute and the direst element to define the set of
>directories.  Currently I'm just setting the dir attribute of the direst
>element to 'root' so the subant task will run my generic buildfile
>against all directories under 'root'.
>
>Therefore, when running the sub build file I need to first see if there
>is a file of type .xyz.  If there isn't then the rest of the build
>process is aborted.
>
>I've used uptodate before and am familiar with it, but I don't see how
>it can help my situation as I am not comparing the last modified dates
>of a target and a source.
>
>
>alan
>
>
>
>-----Original Message-----
>From: Charles Daniels [mailto:cjd4@yahoo.com]
>
>Sent: Sunday, July 25, 2004 2:17 AM
>To: Ant Users List
>Subject: RE: testing for the existence of a file...
>
>Use the uptodate task.
>
> > -----Original Message-----
> > From: Alan Brown [mailto:abrown@symyx.com]
> > Sent: Sunday, July 25, 2004 9:37 AM
> > To: Ant Users List
> > Subject: testing for the existence of a file...
> >
>
> >
>
> >
>
> > I need a task to be dependent on the existence of any file of a given
> > type (.xyz).  However, the <available> task only seems to be able to
> > test the existence of a specifically named file ("wibble.xyz") rather
> > than a filename that contains wildcards ("*.xyz").
> >
>
> > What is the best way around this?
> >
>
> > alan
> >
>
> >
>
> >
>
> > =======
> > Notice: This e-mail message, together with any attachments,
>
> > contains information of Symyx Technologies, Inc. that may be
>
> > confidential, proprietary, copyrighted, privileged and/or
>
> > protected work product, and is meant solely for the intended
>
> > recipient. If you are not the intended recipient, and have
>
> > received this message in error, please contact the sender
>
> > immediately, permanently delete the original and any copies of
>
> > this email and any attachments thereto.
> >
>
> > ---------------------------------------------------------------------
> > 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
>
>
>=======
>Notice: This e-mail message, together with any attachments, contains
>
>information of Symyx Technologies, Inc. that may be confidential,
>
>proprietary, copyrighted, privileged and/or protected work product,
>
>and is meant solely for the intended recipient. If you are not the
>
>intended recipient, and have received this message in error, please
>
>contact the sender immediately, permanently delete the original and
>
>any copies of this email and any attachments thereto.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org

The Wabbit 



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


Mime
View raw message