Created
July 14, 2015 05:55
-
-
Save skeeet/24b49944b08f3c4a08ca to your computer and use it in GitHub Desktop.
Update XCode build and version, based on git info
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
#!/bin/sh | |
# autoupdate-revision.sh | |
# | |
# Evgeny Aleksandrov | |
REV_FILE="${PROJECT_DIR}/Supporting-files/version.xcconfig" | |
. $REV_FILE | |
PROJECT_VERSION=${H_VERSION_NUMBER} | |
COMMITS_COUNT=`git rev-list develop | wc -l | tr -d ' '` | |
filepath="${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}" | |
echo "Updating ${filepath}" | |
echo "Current version ${PROJECT_VERSION}, build ${COMMITS_COUNT}" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${COMMITS_COUNT}" "${filepath}" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${H_VERSION_NUMBER}" "${filepath}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment