-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔖 New system to manage build number & version
- Loading branch information
Showing
4 changed files
with
47 additions
and
46 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,12 @@ | ||
// | ||
// Config.xcconfig | ||
// Loop | ||
// | ||
// Created by Kai Azim on 2023-08-09. | ||
// | ||
|
||
// Using other tools to set Loop's build number and marketing version didn't work well, so I | ||
// resorted to using this config file to edit their values. There is a script in the resources | ||
// folder that will auto-update the build number based on the number of commits. | ||
VERSION = 1.0.0 | ||
BUILD_NUMBER = 0 |
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 |
---|---|---|
@@ -1,25 +1,11 @@ | ||
#!/bin/bash | ||
|
||
echo "Settings build number!" | ||
echo "--- Setting build number! ---" | ||
|
||
git=$(sh /etc/profile; which git) | ||
number_of_commits=$("$git" rev-list HEAD --count) | ||
cd "$SRCROOT" | ||
|
||
target_plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH" | ||
dsym_plist="$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist" | ||
sed -i -e "/BUILD_NUMBER =/ s/= .*/= $(git rev-list --count HEAD)/" Loop/Config.xcconfig | ||
|
||
for plist in "$target_plist" "$dsym_plist"; do | ||
if [ -f "$plist" ]; then | ||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${number_of_commits}" "$plist" | ||
fi | ||
done | ||
rm Loop/Config.xcconfig-e | ||
|
||
settings_root_plist="$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Settings.bundle/Root.plist" | ||
|
||
if [ -f "$settings_root_plist" ]; then | ||
settingsVersion="$APP_MARKETING_VERSION (${number_of_commits})" | ||
/usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:1:DefaultValue $settingsVersion" "$settings_root_plist" | ||
else | ||
echo "Could not find: $settings_root_plist" | ||
exit 0 | ||
fi | ||
echo "--- Done! ---" |