-
-
Save bumaociyuan/3c49f9c6b9a5850ed7fa to your computer and use it in GitHub Desktop.
Xcode build number Git revision number
This file contains hidden or 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 GIT revision number | |
buildNumber=`git rev-list --count HEAD` | |
# write build number | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${buildNumber}" "${INFOPLIST_FILE}" | |
# if [ "$CONFIGURATION" == "Release" ]; then | |
# # version number like this V0.20160109.004 | |
# # read current version number | |
# versionNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") | |
# # split version number by delimiter | |
# IFS='.' read -a array <<< "$versionNumber" | |
# n0=${array[0]} | |
# n1=${array[1]} | |
# n2=${array[2]} | |
# archiveNumer=$((n2+1)) | |
# # write version number | |
# /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $n0.$n1.$archiveNumer" "${INFOPLIST_FILE}" | |
# fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment