This commit is contained in:
2025-08-08 21:09:11 -04:00
parent 2f044c3d9c
commit 7bcc5d656c
38 changed files with 776 additions and 159 deletions

33
Scripts/update_build_number.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
## IMPORTANT ##
# Add the following files to Input Files configuraiton of the build phase
# $(TARGET_BUILD_DIR)/$(INFOPLIST_PATH)
# $(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Info.plist
update_plist_key() {
local plist=$1
local key=$2
local value=$3
if /usr/libexec/PlistBuddy -c "Print :$key" "$plist" > /dev/null 2>&1; then
/usr/libexec/PlistBuddy -c "Set :$key string $value" "$plist"
else
/usr/libexec/PlistBuddy -c "Add :$key string $value" "$plist"
fi
}
git=$(sh /etc/profile; which git)
commit_hash=$("$git" rev-parse --short HEAD)
build_time=$(date "+%-d/%b/%Y")
target_plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH"
dsym_plist="$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist"
for plist in "$target_plist" "$dsym_plist"; do
if [ -f "$plist" ]; then
echo "updating $plist"
update_plist_key "$plist" "BuildTime" "$build_time"
update_plist_key "$plist" "CommitHash" "$commit_hash"
fi
done