Created
January 18, 2012 19:38
-
-
Save rsebbe/1635096 to your computer and use it in GitHub Desktop.
Setting the CFBundleVersion in a build phase (Xcode >= 4.2). Voluntarily not using the info.plist prefix because of a dependency problem in Xcode build system.
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
#!/bin/sh | |
plbuddy="/usr/libexec/PlistBuddy" | |
toolsdir=$( dirname "${BASH_SOURCE[0]}" ) | |
plist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH" | |
vers=`$toolsdir/make_build_version.sh` | |
vers="$vers" | |
major=`$plbuddy -c "Print :CFBundleShortVersionString" "$plist"` | |
major=(`echo $major | tr '.' ' '`) | |
major=${major[0]} | |
vers="$major.$vers" | |
echo "Setting CFBundleVersion to $vers" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $vers" "$plist" | |
/usr/bin/plutil -convert binary1 "$plist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment