tember 20, 2005 8:26 PM
> >To: 'Ant Users List'
> >Subject: RE: Extracting application version from Java file
> >
> >Hello List,
> >
> >I was going to reply to Nicolas that, whilst i agree with the
> >other two replies (you should pass the version i
ADEMAKERS Tanguy
>Sent: Tuesday, September 20, 2005 8:26 PM
>To: 'Ant Users List'
>Subject: RE: Extracting application version from Java file
>
>Hello List,
>
>I was going to reply to Nicolas that, whilst i agree with the
>other two replies (you should pass the
Hello List,
I was going to reply to Nicolas that, whilst i agree with the other two
replies (you should pass the version in somehow and not read it from the
java source file), you *can* achieve what he is trying to do using the
task with a nested filterchain. But i
can't seem to get it to work.
We go one step further..
In the code base there is a build.properties file with
the
following data:
build.version=XX.YY.ZZ
build.date=2005-09-21
build.date.format=-mm-dd
Then instead of a static variable in Java class (say
called BuildInfo.java) we have static method called
getBuildVersion(
Hi Nicolas,
how about controlling the version number in the build?
then update the version in the source file on every build:
and then compile and use ${version} to name the jar?
Barry
Nicolas Vervelle wrote:
Hi,
In one of my Java source file, I have a line like this:
You're going to wrong way.
Pass into your Ant build the version number like so: ant
-Dversion=XX.YY.ZZ clean build test.
Then use the task to replace a token in your Java file. Even
better, you store that number in MANIFEST.MF and update it with the
task. Or, use a properties file. That way