Last active
August 29, 2015 13:57
-
-
Save lanephillips/9787452 to your computer and use it in GitHub Desktop.
Xcode Run Script build phase to copy Subversion revision info into a string constant.
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
VERSION=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/MyProject/MyProject-Info.plist"` | |
BUILD=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/MyProject/MyProject-Info.plist"` | |
REV=`svnversion -n` | |
DATE=`date "+%Y-%m-%d %H:%M:%S %Z"` | |
VS="Version: $VERSION Build: $BUILD\nRevision: $REV\nDate: $DATE" | |
echo "// This file is generated at build time." > ${PROJECT_DIR}/Revision.h | |
echo "// Do not edit it or add it to version control." >> ${PROJECT_DIR}/Revision.h | |
echo "#define kSOSRevision @\"$VS\"" >> ${PROJECT_DIR}/Revision.h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment