You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Marius Scurtescu <ma...@multiactive.com> on 2000/06/23 18:26:05 UTC

ANT feature

Hi all,

I have a basic ANT question. 

Is it possible to execute a target only if it is 
outdated? That is only if one of the files it depends 
on is newer than the target file (assuming the target 
is a file). How would I do that in ANT?

You don't have to worry about this if you compile
Java source code, the compiler will take care of
it, but there are other Java and non-Java tools
out there that are not that smart.

I am using JavaCC and JJTree, parser generators, and
these tools will not compare the time stamps of the
input grammar and existing output files.

I know, I can write my own task to handle this, but
this is an elementary feature of makefiles. In my
opinion the presence of this feature will influence
the general acceptance of ANT as a replacement for
make.

Thanks,
Marius

-- 
------------------
Marius Scurtescu, Software Engineer
Tel: (604) 899-2835 Fax: (604) 899-2899
mailto:marius@multiactive.com
Multiactive Software Inc. http://www.multiactive.com
------------------
Attract and retain customers with Multiactive Software --
proud winners of PC WEEK's "Best of COMDEX" award.
------------------

Re: ANT feature

Posted by Peter Donald <do...@mad.scientist.com>.
At 09:26  23/6/00 -0700, you wrote:
>Hi all,
>
>I have a basic ANT question. 
>
>Is it possible to execute a target only if it is 
>outdated? That is only if one of the files it depends 
>on is newer than the target file (assuming the target 
>is a file). How would I do that in ANT?

at the moment you would have to code it into a task.

>I am using JavaCC and JJTree, parser generators, and
>these tools will not compare the time stamps of the
>input grammar and existing output files.

FWIW I believe someone on the list has already written tasks to do just that.

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*