From c626140ce65c3e9383d80e239562d54dc9f208e5 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Thu, 3 Jan 2013 19:05:02 +0000 Subject: Tidy up build scripts. --- Scripts/build.sh | 25 +++++++++++-------------- Scripts/trim-application.sh | 6 +++--- 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'Scripts') diff --git a/Scripts/build.sh b/Scripts/build.sh index 09bd09f6..d9d99d61 100755 --- a/Scripts/build.sh +++ b/Scripts/build.sh @@ -52,40 +52,37 @@ echo 'Updating build version...' # Remove the .ibplugin from within frameworks rm -rf "${BUILD_PRODUCT}/Contents/Frameworks/ShortcutRecorder.framework/Versions/A/Resources/ShortcutRecorder.ibplugin" -# Perform localisation updates for 'Release' or 'Distribution' builds +# Perform 'Release' or 'Distribution' build specific actions if [[ "$CONFIGURATION" == 'Release' || "$CONFIGURATION" == 'Distribution' ]] then "${SRCROOT}/Scripts/localize.sh" -fi -# Trim the application if this is a 'Release' or 'Distribution' build -if [[ "$CONFIGURATION" == 'Release' || "$CONFIGURATION" == 'Distribution' ]] -then - echo 'Running trim-application.sh to strip application resources for distribution...' + printf "Running trim-application.sh to strip application resources for distribution...\n\n" "${SRCROOT}/Scripts/trim-application.sh" -p "$BUILD_PRODUCT" -a fi +SHARED_SUPPORT_DIR="${BUILD_PRODUCT}/Contents/SharedSupport" + # Copy all Default Bundles to build product -rm -rf "${BUILD_PRODUCT}/Contents/SharedSupport/Default Bundles" +rm -rf "${SHARED_SUPPORT_DIR}/Default Bundles" -mkdir -p "${BUILD_PRODUCT}/Contents/SharedSupport/Default Bundles" +mkdir -p "${SHARED_SUPPORT_DIR}/Default Bundles" -cp -R "${SRCROOT}/SharedSupport/Default Bundles" "${BUILD_PRODUCT}/Contents/SharedSupport" +cp -R "${SRCROOT}/SharedSupport/Default Bundles" "${SHARED_SUPPORT_DIR}" # Copy all Default Themes to build product -rm -rf "${BUILD_PRODUCT}/Contents/SharedSupport/Default Themes" +rm -rf "${SHARED_SUPPORT_DIR}/Default Themes" -mkdir -p "${BUILD_PRODUCT}/Contents/SharedSupport/Default Themes" - -cp -R "${SRCROOT}/SharedSupport/Default Themes" "${BUILD_PRODUCT}/Contents/SharedSupport" +mkdir -p "${SHARED_SUPPORT_DIR}/Default Themes" +cp -R "${SRCROOT}/SharedSupport/Default Themes" "${SHARED_SUPPORT_DIR}" # Perform distribution specific tasks if this is a 'Distribution' build if [ "$CONFIGURATION" == 'Distribution' ] then - echo 'Checking for localizations to copy in, using the "ResourcesToCopy" directory...' + if [ -e "${SRCROOT}/ResourcesToCopy" ] then find "${SRCROOT}/ResourcesToCopy" \( -name "*.lproj" \) | while read FILE; do; printf "\tCopying localization: ${FILE}\n"; cp -R "$FILE" "${BUILD_PRODUCT}/Contents/Resources/"; done; diff --git a/Scripts/trim-application.sh b/Scripts/trim-application.sh index b1c0bfbb..f6096108 100755 --- a/Scripts/trim-application.sh +++ b/Scripts/trim-application.sh @@ -48,7 +48,7 @@ usage() { - echo "Usage: `basename $0` -p application_path [-d -n -s -t -f -r]" + echo "Usage: $(basename $0) -p application_path [-d -n -s -t -f -r]" exit 1 } @@ -96,7 +96,7 @@ then usage fi -printf "Trimming application bundle '`basename \"$APP_PATH\"`' at '${APP_PATH}'...\n\n" +printf "Trimming application bundle '$(basename \"$APP_PATH\")' at '${APP_PATH}'...\n\n" # Remove unnecessary files if [ $REMOVE_FILES ] @@ -151,6 +151,6 @@ then find "$APP_PATH" -type f | while read FILE; do if [ -s "${FILE}/rsrc" ]; then; printf "\tRemoving reource: ${FILE}/rsrc\n"; cp /dev/null "${FILE}/rsrc"; fi; done; fi -printf "\nTrimming application bundle '`basename \"$APP_PATH\"`' complete\n" +printf "\nTrimming application bundle '$(basename \"$APP_PATH\")' complete\n\n" exit 0 -- cgit v1.2.3