Build version?

Hey guys,

Is it possible to set Eclipse up in such a fashion that it can include some kind of build version to each build of my app? Such that the build version can be displayed in an “About” dialog and also so that it’s possible to track that build version to some point in a git repos? (e.g. a commit)

Dunno if the op is you but my incredible google-fu came up with this

EDIT: Oooh, I see what you did there. I figured out how it works. xD

How does that work when packing it into a Jar? Can I still use Eclipses export functions for that?

Dude, they should teach google-fu in schools!

Actually, no. I don’t get how this works. It worked with a rather simple test. But it doesn’t work at all with what I need it for xD

I have an ant build script that writes the SVN revision number to a file, then include that file in the jar (and have some code that reads the revision number and displays it for ‘About’ purposes).

It looks like the equivilant in git would be ‘git describe’ http://www.kernel.org/pub/software/scm/git/docs/v1.7.3/git-describe.html

Personally, I do this manually.

Depends what information you’re trying to capture really. I have a manually incremented number alongside the svn revision - the manual number is for users, the svn number is for me. Usually they both change at the same time, but not always.

I’m a big fan of one-button build systems - I think you should be able to go from scratch to a fully built/deployed app with no manual intervention other than ‘start’.

I’ve been sticking the project version in a file called VERSION in the root of the jar. It’s generated automatically so I can’t screw it up, but I do have to update the project version in the maven or sbt build definition by hand.

Really it’s supposed to go in MANIFEST.MF, but I’m too lazy to work with that properly. I need to start building proper OSGi bundles again…