Skip to content

Instantly share code, notes, and snippets.

@ryanmasondavies
Last active January 13, 2016 16:26
Show Gist options
  • Save ryanmasondavies/ff3c8e891a93e4ad249e to your computer and use it in GitHub Desktop.
Save ryanmasondavies/ff3c8e891a93e4ad249e to your computer and use it in GitHub Desktop.
Update build number from Subversion
# Needs to be placed after the usual versioning script in the WatchKit extension to copy the extension’s build number over to the app.
extension_plist="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
extension_build_path="${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}"
app_name=`cd "$extension_build_path"; ls -d *app`
app_plist="${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}/$app_name/Info.plist"
extension_build_number=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "$extension_plist")
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $extension_build_number" "$app_plist"
#!/bin/bash
echo -n ${PROJECT_DIR}/${INFOPLIST_PATH} \
| xargs -0 /usr/libexec/PlistBuddy -c "Set :CFBundleVersion `svnversion -n`"
#!/bin/bash
echo -n ${TARGET_BUILD_DIR}/${INFOPLIST_PATH} \
| xargs -0 /usr/libexec/PlistBuddy -c "Set :CFBundleVersion `svnversion -n`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment