I ended up with teh following script after many many attempts to
try to get something working. It's a bit of a hack now but I thought it
was working until today.

<target name="parser-uptodate-check">
   <dependset>
     <srcfileset dir="${grammar.dir}">
       <include name="*.grammar" />
     </srcfileset>
     <srcfileset dir="${lib.dir}">
       <include name="*.jar" />
     </srcfileset>
     <targetfileset dir="${generate.dir}" includes="**/*" />
   </dependset>

   <condition property="parser.isUptodate">
     <and>
       <available file="${generate.dir}/al/parser/Parser.java" />
       <available file="${generate.dir}/ae/parser/Parser.java" />
       <available file="${generate.dir}/ab/parser/Parser.java" />
       <available file="${generate.dir}/dse/parser/Parser.java" />
       <available file="${generate.dir}/lte/parser/Parser.java" />
     </and>
   </condition>
 </target>


The above doesn't work regardless of what I do, I've googled, I've tried all
sorts of combinations, I've looked at uptodate task but can't see if it will
do what I want.

My requirements are quite simple and from all the documentation I've read,
ant should
do it no problems.

What I want to do is:

If any file ending in .grammar in the directory grammar/ has been modified
after any file in the directory generate/ then set a property. In the above
I set the property only if it is up to date, I'm sure I can do the negation
also.

The one extra complication is that in the generate/ directory there will be
a
bunch of subdirectories that I may not know the names of and these too may
contain subdirectories. I want to check all files recursively down these
directories.

Any help appreciated.

Thanks

Lionel.

Reply via email to