Created
April 9, 2015 01:28
-
-
Save parrots/d37f390d06114a4167c6 to your computer and use it in GitHub Desktop.
Watchkit versioning build phase
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
git=`sh /etc/profile; which git` | |
branch_name=`$git symbolic-ref HEAD | sed -e 's,.*/\\(.*\\),\\1,'` | |
git_count=`$git rev-list $branch_name |wc -l | sed 's/^ *//;s/ *$//'` | |
simple_branch_name=`$git rev-parse --abbrev-ref HEAD` | |
build_number="$git_count" | |
if [ $CONFIGURATION != "Release" ]; then | |
build_number+="-$simple_branch_name" | |
fi | |
plist="${SRCROOT}/WatchKit App/Info.plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $build_number" "$plist" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this as a build phase one your parent app. Update the plist variable to point to your watchkit app's info.plist.
Note this will modify the info.plist for the watchkit app every build, might want to
git update-index --assume-unchanged "Watchkit App/Info.plist"
that bad boy.This reuses the numbering strategy found in my versioning post