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=yyyy-mm-dd

Then instead of a static variable in Java class (say
called BuildInfo.java) we have static method called
getBuildVersion() (and getBuildDate()) which read the
build.properties file, cache the results and return
the value the callee.

Our build process (using CruiseControl) writes/updates
the build.properties file only... Build.java is not
modified.

Hope that helps,

Ninju

--- Barry White <[EMAIL PROTECTED]> wrote:

> Hi Nicolas,
> 
> how about controlling the version number in the
> build?
> 
>    <property name="version" value="XX.YY.ZZ"/>
> 
> then update the version in the source file on every
> build:
> 
>    <replaceregexp
> file="${source}/some/package/Class.java">
>      <regexp pattern="public final static String
> version = (.*)" />
>      <substitution expression='public final static
> String version = 
> "${version}";' />
>    </replaceregexp>
> 
> 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:
> > public final static String version = "XX.YY.ZZ";
> > 
> > I'd like to extract the XX.YY.ZZ from the Ant
> build to name the 
> > resulting jar file with it : Jmol.XX.YY.ZZ.jar
> > 
> > Can someone help me with how to extract the string
> from the file ?
> > 
> > Thanks in advance,
> > Nicolas
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 






                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to