-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
git rev-parse 2> /dev/null > /dev/null || { echo >&2 "Git repository required. Aborting build number update script."; exit 0; } | ||
|
||
# Create version | ||
count=`git log --oneline | wc -l | awk '{gsub(/^ +| +$/,"")} {print $0}'` | ||
date=$(((`date "+%s"` - 1514764800) / (15 * 60))) | ||
version="$count.$date" | ||
echo "Build number is $version" | ||
|
||
# Main app info.plist | ||
filepath="${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}" | ||
echo "Updating $filepath" | ||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${version}" "${filepath}" | ||
|
||
# Extensions info.plist | ||
echo "Searching in '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/*.app/Info.plist'" | ||
for subplist in "${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}"/*.app/Info.plist; do | ||
echo "Updating $subplist" | ||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${version}" "${subplist}" | ||
done | ||
|
||
echo "Searching in '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/PlugIns/*.appex/Info.plist'" | ||
for subplist in "${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}"/PlugIns/*.appex/Info.plist; do | ||
echo "Updating $subplist" | ||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${version}" "${subplist}" | ||
done | ||
|
||
# Dsym info.plist | ||
filepath="${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist" | ||
echo "Updating dSYM at ${filepath}" | ||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${version}" "${filepath}" |