Fog Creek Software
Discussion Board




Eclipse and build number

I'd like to have a build number incremented automatically in a Java application (built using Eclipse). I suppose I could do this by generating a file with a batch, in a pre-build step, but I was wondering if there was a 'classic' solution, or a plugin I've missed.
Does anyone know an elegant way of handling this ?

GP
Tuesday, December 16, 2003

If you aren't using Ant to make your builds, you should check it out: http://ant.apache.org/

You can use the <buildnumber/> tag to automatically generate your build numbers. I also create a build date, like this:

<buildnumber file="build.num"/>
<propertyfile file="build.date" comment="Build Date">
    <entry key="date" type="date" value="now"/>
</propertyfile>

Ant is fun for the entire family!

Sam
Tuesday, December 16, 2003

Thanks ! You're right, I'm not using Ant, and I should really give it a try, especially if it solves my problem.

GP
Tuesday, December 16, 2003

Use Ant to get your builds to one step so you can be cool like Joel!

Sam
Tuesday, December 16, 2003

Well, I must admit I've never been comfortable with makefiles, nor with xml-as-code, that's probably why I've stayed away from Ant until now - my one-click builds rely on plain old ".bat". But I know that's the best tool at the moment - am I wrong ?

GP
Wednesday, December 17, 2003

Once you have your build number, don't forget to have it auto-label your code.

Paul Vincent Craven
Thursday, December 18, 2003

Er, what do you mean exactly ?

GP
Thursday, December 18, 2003

Ant is now out of style.  The latest craze is  Maven. 

geek
Tuesday, December 23, 2003

*  Recent Topics

*  Fog Creek Home