Skip to content

Instantly share code, notes, and snippets.

@dombarnes
Created December 7, 2015 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dombarnes/70cff031c1dee03b064f to your computer and use it in GitHub Desktop.
Save dombarnes/70cff031c1dee03b064f to your computer and use it in GitHub Desktop.
Xcode Build Stage for incrementing build number based on git commits From http://blog.soff.es/automated-bundle-version
git = `sh /etc/profile; which git`.chomp
app_build = `#{git} rev-list --all | wc -l`.chomp.to_i
`/usr/libexec/PlistBuddy -c "Set :CFBundleVersion #{app_build}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"`
puts "Updated #{ENV['TARGET_BUILD_DIR']}/#{ENV['INFOPLIST_PATH']}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment