Last active
October 12, 2015 16:27
-
-
Save rsobik/4054574 to your computer and use it in GitHub Desktop.
Update CFBundleVersion
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
# Update the CFBundleVersion in the generated Info.plist using the count of all commits | |
# Use Xcode's copy of the Git binary | |
GIT=`xcrun -find git` | |
# Use the commit count as CFBundleVersion | |
GIT_COMMIT_COUNT=`${GIT} rev-list --all | wc -l | tr -d ' '` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${GIT_COMMIT_COUNT}" "${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${GIT_COMMIT_COUNT}" "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Append a "Run Script" build phase to the application's target. The script shall contain the shell script shown above.