ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
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

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,
--- Daniel Rosner <> 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
> 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\ 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


Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!

View raw message