ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taylor, Jeremy" <jtay...@lehman.com>
Subject RE: javac task filtering
Date Fri, 29 Sep 2000 10:35:56 GMT
Filtering only applies to tasks that perform file copying, like it says in
the ANT documentation under "Filter".

Last time I looked, the purpose of javac was to compile java files, not copy
them around the place.

Maybe you should use the replace task to do your version change?

> -----Original Message-----
> From:	patricka@exinet.co.za [SMTP:patricka@exinet.co.za]
> Sent:	29 September 2000 11:05
> To:	ant-user@jakarta.apache.org
> Subject:	javac task filtering
> 
> hi *,
> 
> (ant 1.1)
> 
> the javac task has a filtering attribute, which does
> not work as i expected.
> 
> in the example below, @version@ is not replaced before or
> after compliation, while Test.java is complied fine.
> 
> Test.java
> ---8<---
> // @version@
> 
> public class Test {
>   public static void main(String[] args) {
>   }
> }
> --->8---
> 
> Text.xml
> ---8<---
> <?xml version="1.0"?>
> 
> <project name="Filter Test" default="Test" basedir=".">
>   <target name="Test">
>     <tstamp />
>     <filter token="version" value="${TODAY}" />    
>     <javac srcdir="." destdir="." />
>   </target>
> </project>
> --->8---
> 
> i've resorted to:
> ---8<---
>     <filter token="version" value="${TODAY}" />    
> 
>     <copyfile filtering="on" src="Test.java" dest="Test2.java" />
>     <rename src="Test2.java" dest="Test.java" />
> --->8---
> 
> am i being stupid?
> 
> aside: is there version numbering support in ant 
> 1.2? something that could read a file, and auto increment a
> build number?
> 
> this list is wonderful,
> thanks,
> 
> - p

Mime
View raw message