ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Brown" <abr...@symyx.com>
Subject RE: testing for the existence of a file...
Date Sun, 25 Jul 2004 17:16:36 GMT

Thanks for the clarification.  That is indeed the answer for me. 

However, in the general case, the purpose of the uptodate task would be
to test whether a .xyz file exists and whether, therefore, the build
should take place.  So it couldn't be used as the target file wouldn't
be created unless the uptodate task had already completed so the
uptodate task wouldn't have a target file to test the 'uptodate'ness of.

But in my case, there is a workaround to that problem and I thank you
for lighting the right path.

alan

-----Original Message-----
From: Charles Daniels [mailto:cjd4@yahoo.com]
Sent: Sunday, July 25, 2004 9:10 AM
To: Ant Users List
Subject: RE: testing for the existence of a file...


> -----Original Message-----
> From: Alan Brown [mailto:abrown@symyx.com]
> Sent: Sunday, July 25, 2004 11:13 AM
> To: Ant Users List
> Subject: RE: testing for the existence of a file...
>
>
>
> 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.

I would assume that if a directory contains files of type .xyz that the
sub
build would end up creating some target file from those .xyz files,
correct?
If that's the case, then use the uptodate task as follows:

  <uptodate property="subBuild.notRequired" targetfile="${target.file}>
    <srcfiles dir="${subBuild.dir}" includes="*.xyz"/>
  </uptodate>

If I recall correctly, in the case where there are no files of type .xyz
then things will be considered up to date.

> 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
>


---------------------------------------------------------------------
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


Mime
View raw message