Created
August 3, 2010 14:11
-
-
Save simonwhitaker/506429 to your computer and use it in GitHub Desktop.
Append the current SVN revision to an iPhone app's version number at build time
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 location of unparsed Info.plist | |
GS_INFO_PLIST_INPUT=$(basename "$INFOPLIST_FILE" .plist) | |
# Get location of parsed Info.plist | |
GS_INFO_PLIST_PATH="$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/Info" | |
# Get version number from unparsed Info.plist | |
GS_VERSION=$(defaults read "$PROJECT_DIR/$GS_INFO_PLIST_INPUT" CFBundleVersion) | |
# Append local SVN revision number | |
export GS_NEW_VERSION=$GS_VERSION.$(svnversion) | |
echo Version is $GS_NEW_VERSION | |
# Write new version number to parsed Info.plist | |
defaults write "$GS_INFO_PLIST_PATH" CFBundleVersion $GS_NEW_VERSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See this blog post for further details