You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by stephan beal <st...@einsurance.de> on 2002/04/24 10:33:17 UTC
help formulating an ?
Good morning!
i have a set of files with a dependency list which i just can't seem to
formulate in ant. It goes a little something like this...
Single dir contains:
foo.txt
foo.xml - generated from foo.txt
[many files].java - generated from foo.txt
generator.pl - processes foo.txt to make foo.xml & *.java.
*.tmpl - template code which goes into *.java.
In addition, the directory contains many non-auto-generated classes, but they
are only important in that the pattern *.java cannot be reliably used in that
directory to check dependencies between the auto-gen'd files.
The dependency chain goes something like this:
- if foo.txt is newer than foo.xml, rebuild.
- if *.tmpl are newer than foo.txt, rebuild.
- if generator.pl is newer than foo.txt, rebuild.
(Note that when i say "rebuild", i mean "sets a flag which will eventually
kick off the build.")
My instinct is to use several <uptodate> blocks to set a single flag, but i'm
really not sure how ant's "property immutability" applies there, so i
hesitate to do so. i've tried using a <condition> but was not successful in
correctly handling all cases.
Any suggestions?
----- stephan
stephan@einsurance.de - http://www.einsurance.de
Office: +49 (89) 552 92 862 Handy: +49 (179) 211 97 67
"I didn't give in to the Nazis and I won't give in to the bladder."
- The Queen Mum
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: help formulating an ?
Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 24 Apr 2002, stephan beal <st...@einsurance.de> wrote:
> The dependency chain goes something like this:
>
> - if foo.txt is newer than foo.xml, rebuild.
> - if *.tmpl are newer than foo.txt, rebuild.
> - if generator.pl is newer than foo.txt, rebuild.
>
> (Note that when i say "rebuild", i mean "sets a flag which will
> eventually kick off the build.")
>
> My instinct is to use several <uptodate> blocks to set a single
> flag,
Would work, you could also use dependset to delete foo.xml if either
foo.txt or *.tml or generator.pl is newer than it and then use
available to see if it still is there.
> but i'm really not sure how ant's "property immutability" applies
> there,
What you really want is to check for the opposite of uptodate, right?
<condition>
<not>
<and>
<uptodate ...> <!-- foo.xml is newer than foo.txt -->
<uptodate ...> <!-- foo.txt is newer than *.tmpl -->
<uptodate ...> <!-- foo.txt is newer than generator.pl -->
</and>
</not>
</condition>
may be better.
Stefan
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>