ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Vincent" <JVINC...@novell.com>
Subject help - uptodate task clarification needed please.
Date Fri, 22 Feb 2002 01:49:13 GMT
Could someone please help me clarify the usage of the uptodate task in
ANT (v1.4.1) ?

I have the following files:

./build.xml
./Lexer.g
./gensrc/Lexer.java
./gensrc/LexerTokenTypes.java
./gensrc/LexerTokenTypes.txt

The 'gensrc' directory is peer to both the Lexer.g file and my
build.xml file.  The files inside gensrc are generated by a tool that
processes the Lexer.g file (antlr.Tool if it matters).  I want
regenerate the files withing the gensrc directory ONLY if Lexer.g is
NEWER.  It seemed that the uptodate task would work for this purpose.  

Here is my task.  I think I only need to check the Lexer.g file against
the Lexer.java file to make things simpler.

<target name="isUpToDate">
         <uptodate property="buildLexer"
targetfile="gensrc/Lexer.java">
            <srcfiles dir="." includesfile="Lexer.g"/>
        </uptodate>
</target>

However, this ALWAYS sets buildLexer to true.  My understanding is that
the targetFile is the file that gets generated through some action on
the srcfiles.  I then tried:

<uptodate property="buildLexer">
	<srcfiles dir="." includesfile="Lexer.g"/>
	<mapper from="Lexer.g" to="gensrc/Lexer.java" type="glob"/>
</uptodate>

Same result, buildLexer is ALWAYS set to true.  What am I missing,
besides a bit more hair?  I tried switching the srcfile and targetfile
thinking I had them backwards and still it gets set to true.

Thanks much,

Jeff

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


Mime
View raw message