I am starting up a new project that will have multiple developers working in Xcode using Git. I want to setup auto-incrementing build numbers, and I have found a few good answers on how to do this, but my concern is with the multiple developers and Git.
I know in Xcode there are some files, like the project file, that are very sensitive and hard to merge. The best techniques I have seen for auto-incrementing build numbers would be susceptible to the same multiple Git merge issue.
Is there any guidance here as to how I can use an auto-incrementing build technique and still keep the merging issues to a minimum? Maybe the answer is that there is no good answer, but I want to find out what others are doing.
While I don’t really see the point of having linearly incrementing build numbers trying to track a nonlinear development model like git, there’s ways to acheive it. It depends on what you’re after though. If you just want a build number for “official” builds, you can quite simply generate this by the build-scripts when building. Then have the build script tag the commit being built with the generated number. Something like this:
The responsibillity for generating a unique, incrementing build number is with the
generate_build_numscript, and you can always find back to the corresponding commit by using the tag.If on the other hand you want every commit in the git tree to correspond to a linear build number, you’re in for a lot more work.
In my opinion, there’s not much to gain in this compared to using the sha1 directly.