вторник, 15 августа 2017 г.

Set the build number to the count of Git commits


Xcode: Set the build number to the count of Git commits
http://camopu.rhorse.ru/MSVXcodeBuildNumberToCountGitCommits.html
Set the build number to the count of Git commits
# Set the build number to the count of Git commits
# https://github.com/sergemoskalenko/MSVXcodeBuildNumberToCountGitCommits

buildNumber=$(git rev-list --count --first-parent HEAD)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${INFOPLIST_FILE}"
Synchronize build number and version on extensions and main application.
buildNumber=$(git rev-list --count --first-parent HEAD)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${INFOPLIST_FILE}"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${buildNumber}" "${PROJECT_DIR}/TodayExtension/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${buildNumber}" "${PROJECT_DIR}/Watch/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${buildNumber}" "${PROJECT_DIR}/Watch Extension/Info.plist"

buildVersion=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${INFOPLIST_FILE}")
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${buildVersion}" "${PROJECT_DIR}/TodayExtension/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${buildVersion}" "${PROJECT_DIR}/Watch/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${buildVersion}" "${PROJECT_DIR}/Watch Extension/Info.plist"




Add new script to build phase and paste it.

Комментариев нет:

Отправить комментарий