mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Add a script to incrementing the project build number in a yyyymmddnnn format where the nnn is an auto incrementing number (i.e. 20210103001)
This commit is contained in:
parent
808dd022ed
commit
cec8fd884a
2 changed files with 22 additions and 4 deletions
18
Scripts/increment_build_number.sh
Executable file
18
Scripts/increment_build_number.sh
Executable file
|
|
@ -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}"
|
||||
|
|
@ -19,7 +19,9 @@
|
|||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>20210103001</string>
|
||||
<key>CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT</key>
|
||||
<string>$(CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT)</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
|
@ -33,9 +35,7 @@
|
|||
<key>SMPrivilegedExecutables</key>
|
||||
<dict>
|
||||
<key>com.robotsandpencils.XcodesApp.Helper</key>
|
||||
<string>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)"</string>
|
||||
<string>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)"</string>
|
||||
</dict>
|
||||
<key>CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT</key>
|
||||
<string>$(CODE_SIGNING_SUBJECT_ORGANIZATIONAL_UNIT)</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
|||
Loading…
Reference in a new issue