Created
April 17, 2012 13:58
-
-
Save andrewgarn/2406138 to your computer and use it in GitHub Desktop.
Xcode 4 Build Version Scripts
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
# Run script to increase CFBundleVersion by 1 each time a build is archived under release or adhoc | |
#!/bin/sh | |
if [ "$CONFIGURATION" == Adhoc || "$CONFIGURATION" == Release ]; then | |
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE") | |
buildNumber=$(($buildNumber + 1)) | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" | |
fi | |
# Run script to set CFBundleVersion to local latest git commit hash | |
#!/bin/sh | |
buildNumber=`git rev-parse --short HEAD` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment