From 160bc57e38dfe3ef1438ccd8ec20dd45b128dc76 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Sun, 29 Jan 2017 01:45:06 -0500 Subject: [PATCH] [ios] Bring in upstream changes to strip-frameworks script Upstream commits: realm/realm-cocoa@cb8e3b6 and realm/realm-cocoa@453e0c1 --- platform/ios/framework/strip-frameworks.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/platform/ios/framework/strip-frameworks.sh b/platform/ios/framework/strip-frameworks.sh index 5e0dc0e17..895cc24d5 100755 --- a/platform/ios/framework/strip-frameworks.sh +++ b/platform/ios/framework/strip-frameworks.sh @@ -35,9 +35,19 @@ code_sign() { /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" } -echo "Stripping frameworks" +# Set working directory to product’s embedded frameworks cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}" +if [ "$ACTION" = "install" ]; then + echo "Copy .bcsymbolmap files to .xcarchive" + find . -name '*.bcsymbolmap' -type f -exec mv {} "${CONFIGURATION_BUILD_DIR}" \; +else + # Delete *.bcsymbolmap files from framework bundle unless archiving + find . -name '*.bcsymbolmap' -type f -exec rm -rf "{}" +\; +fi + +echo "Stripping frameworks" + for file in $(find . -type f -perm +111); do # Skip non-dynamic libraries if ! [[ "$(file "$file")" == *"dynamically linked shared library"* ]]; then @@ -61,14 +71,6 @@ for file in $(find . -type f -perm +111); do fi done -if [ "$ACTION" = "install" ]; then - echo "Copy .bcsymbolmap files to .xcarchive" - find . -name '*.bcsymbolmap' -type f -exec mv {} "${CONFIGURATION_BUILD_DIR}" \; -else - # Delete *.bcsymbolmap files from framework bundle unless archiving - find . -name '*.bcsymbolmap' -type f -exec rm -rf "{}" +\; -fi - # When this script finishes executing, delete itself from the built product function finish { if [[ $0 == "${BUILT_PRODUCTS_DIR}"* ]]; then