How to auto-increment build number of Android project in Eclipse (prefer portable solution)
android, eclipse
Solution
Have you tried to 'Maven-ise' your android project build ?
If you use the "maven-android-plugin", you can keep track of your project build with pom.xml's "version" tag.
In pom.xml you can increment the build version by using "versions-maven-plugin"
To reflect the incremented build number to to your AndroidManifest.xml you can use the Synchronizing Version technique within your pom file.
This way you can auto-increment the android project build number by running the "versions-maven-plugin" every time the app builds. The solution is also portable in the same way the Ant solution is.
I hope this can also solve the problem you have mentioned (and what I have understand). Please correct me if something is missing.
Problem
Getting an IDE to automatically increment build numbers is a long discussed issue - I'm always surprised that something that seems so basic (to me) is so much work. The highest scored question and answer (by quite a bit) for this topic are here: https://stackoverflow.com/a/8156809/150016 My problem is that the solution depends on .net and I'd prefer to avoid a .net dependency for Eclipse solution. I also want to avoid any dependency on VCS. So, I'm looking for a solution that is portable and 'Eclipse-ish'. I think the best candidates are an Ant solution (which I will post) or a Java app similar to the dotNet app in the linked answer above. (I didn't add my answer to that question because it has an accepted answer and is already a very long post. If the moderators prefer I will delete this question and add my answer to the question above.) I was hoping for something comparatively simple but I don't think any solution to this problem really is simple.