diff --git a/AppwiseCore.podspec b/AppwiseCore.podspec index 66aab6d..eb7c17c 100755 --- a/AppwiseCore.podspec +++ b/AppwiseCore.podspec @@ -23,6 +23,7 @@ Pod::Spec.new do |s| :git => 'https://github.com/appwise-labs/AppwiseCore.git', :tag => s.version } + s.preserve_paths = ['Scripts/*'] s.default_subspec = 'Core', 'Behaviours', 'UI' # core spec diff --git a/CHANGELOG.md b/CHANGELOG.md index 12445dc..bb7d5d0 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. ## [Master](https://github.com//AppwiseCore) +### New Features + +* Added build number updater script (`Scripts/update_build_number.sh`). + ## [0.7.0](https://github.com/appwise-labs/AppwiseCore/releases/tag/0.7.0) ### New Features diff --git a/Scripts/update_build_number.sh b/Scripts/update_build_number.sh new file mode 100755 index 0000000..f171523 --- /dev/null +++ b/Scripts/update_build_number.sh @@ -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}"