diff --git a/Scripts/increment_build_number.sh b/Scripts/increment_build_number.sh new file mode 100755 index 0000000..cbf13d8 --- /dev/null +++ b/Scripts/increment_build_number.sh @@ -0,0 +1,18 @@ +#!/bin/sh +PROJECT_DIR=$(pwd)/Xcodes/Resources +INFOPLIST_FILE="Info.plist" +buildString=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") +buildDate=$(echo $buildString | cut -c 1-8) +buildNumber=$(echo $buildString | cut -c 9-11) +today=$(date +'%Y%m%d') + +if [[ $buildDate = $today ]] +then +buildNumber=$(($buildNumber + 1)) +else +buildNumber=1 +fi + +buildString=$(printf '%s%03u' $today $buildNumber) + +/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildString" "${PROJECT_DIR}/${INFOPLIST_FILE}" diff --git a/Xcodes/Resources/Info.plist b/Xcodes/Resources/Info.plist index 0d3bfc9..2f5badf 100644 --- a/Xcodes/Resources/Info.plist +++ b/Xcodes/Resources/Info.plist @@ -19,7 +19,9 @@ CFBundleShortVersionString 1.0.0 CFBundleVersion - 1 + 20210103001 + CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT + $(CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT) LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright @@ -33,9 +35,7 @@ SMPrivilegedExecutables com.robotsandpencils.XcodesApp.Helper - identifier "com.robotsandpencils.XcodesApp.Helper" and info [CFBundleShortVersionString] >= "1.0.0" and anchor apple generic and certificate leaf[subject.OU] = "$(CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT)" + identifier "com.robotsandpencils.XcodesApp.Helper" and info [CFBundleShortVersionString] >= "1.0.0" and anchor apple generic and certificate leaf[subject.OU] = "$(CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT)" - CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT - $(CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT)