Skip to content

Instantly share code, notes, and snippets.

@simonwhitaker
Created August 3, 2010 14:11
Show Gist options
  • Select an option

  • Save simonwhitaker/506429 to your computer and use it in GitHub Desktop.

Select an option

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
# 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
@simonwhitaker

Copy link
Copy Markdown
Author

See this blog post for further details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment