ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Difficulty with filtering and javac task.
Date Mon, 09 Oct 2000 19:28:10 GMT
The <javac> task is no longer in the business of
copying/filtering-on-copy.

I'd recommend using the <replace> task, if you want to do the token
replacement within the same file; otherwise use <copyfile> w/filtering.
(Note: I need to do something similar, only I do it on a "state" boolean
(debug=true|false), but I have a template file that has the token in it,
then I create (ie., <copyfile>-with-filtering to) the .java file, because
if I just had the .java file already and tried to do a <replace> on a
token there, I'd be trying to do it to a source-controlled and therefore
read-only (in my client tree) file. I don't know if <replace> can write to
a read-only file (never tried it), but since it would be such a no-no to
mod a "un-open'd" file anyway, I prefer doing it the kosher way.

Hope this helps,
Diane
--- Daniel Rosner <drosner@interbind.com> wrote:
> 
> Specifically I have questions below about substitution to make a version
> number.
> 
> My project has a Version class which holds a set of public final static
> String's that I would like to replace at compile time. So in my
> Version.java
> I have, for example,
>     /** current build number */
>     public final static String build = "@BUILD@";
> 
> When I use the ant javac task, the substitution I expected is not
> happening.
> I am trying to follow what I think I should do as indicated in the
> c:/ant/docs/index.html file... which is something like this:
>         <javac
>             srcdir="${javaSourceDir}"
>             destdir="${classesTargetDir}"
>             classpath="${classpath}"
>             debug="on"
>             filtering="on"
>             >
> 
> Question: That index.html file doesn't say if I should do "on" or
> "true"- am
> I doing the right thing?
> 
> Question: When I look in the source of ...\taskdefs\Javac.java I can't
> see
> where it is doing the substitution. Is this supported? Am I doing the
> right
> thing?
> 
> As an aside, is this an appropriate forum for discussion about build
> 'best
> practices'? I'm wondering how you folks manage the build-release
> process, of
> which my questions are just a part. With regard to this specific
> problem,
> any examples of how you folks are doing version #
> substitution/management
> would be greatly appreciated.
> 
> Thanks
> -D


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

Mime
View raw message