How to most efficiently tie a git build version number, to an apk version with eclipse?
I use eclipse to build an android app, and git running locally for version control. Currently I have a value in strings.xml that represents the version number. If i change that number, the very next thing I do is a code commit in git using the same version number in the comment, so that I can tie a specific build to the matching code that generates it. Very manual process.
Larsks comment helped in pointing me in a direction of defining things better. I think what I want is some type of git hook. Something where, if I change a particular version variable, it will automatically add a corresponding tag. Or, if I issue a tag of a specific format “v3.1.4”, it will update the version number in code.
I think prior to reading about hooks, I was hoping for something where I could put “ReplaceWithVersion”, or some other special code, and on commit git would know automatically to replace that with the current tag/version.
Am I hoping for too much? Is there a feasible way to get that the versions/tags in sync?
One Solution collect form web for “How to most efficiently tie a git build version number, to an apk version with eclipse?”
This sounds like the precut use for git tags. After you update strings.xml and commit the change, tag the commit with the version number:
git tag 3.14.15
You can then use this tag in other git commands to refer to this specific commit. For example, too see any change you’ve made since a release:
git diff 3.14.15