Created
September 12, 2014 10:11
-
-
Save radianttap/804b57c4eb5e72191cc3 to your computer and use it in GitHub Desktop.
Xcode versioning based on git tags and number of builds
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
# Get the version number from the tag in git and the number of commits as the build number | |
# | |
appVersion=$(git describe --long | cut -f 1 -d "-") | |
appBuild=$(git describe --long | cut -f 2 -d "-") | |
#gitHash=$(git describe --long | cut -f 3 -d "-") | |
echo "From GIT Version = $appVersion Build = $appBuild" | |
# | |
# Set the version info in plist file | |
# | |
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $appVersion" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $appBuild" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
#/usr/libexec/PlistBuddy -c "Set :GITHash $gitHash" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
echo "Updated ${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's picked up from here: http://stackoverflow.com/a/16332406/108859