Created
December 7, 2015 22:10
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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