diff --git a/Charts.xcodeproj/project.pbxproj b/Charts.xcodeproj/project.pbxproj index e2bc9c99b6..cd1b497477 100644 --- a/Charts.xcodeproj/project.pbxproj +++ b/Charts.xcodeproj/project.pbxproj @@ -703,7 +703,7 @@ 06165F2A1D8110E600722320 /* Sources */, 06165F2B1D8110E600722320 /* Frameworks */, 06165F2C1D8110E600722320 /* Resources */, - B6355D621EA9B71800B74B2E /* ShellScript */, + B6355D621EA9B71800B74B2E /* Copy Carthage Frameworks */, ); buildRules = ( ); @@ -783,19 +783,20 @@ shellPath = /bin/sh; shellScript = "exec \"${SRCROOT}/scripts/build-dependencies.sh\"\n"; }; - B6355D621EA9B71800B74B2E /* ShellScript */ = { + B6355D621EA9B71800B74B2E /* Copy Carthage Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "$(SRCROOT)/Carthage/Build/$(PLATFORM)/FBSnapshotTestCase.framework", + FBSnapshotTestCase, ); + name = "Copy Carthage Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "carthage copy-frameworks"; + shellScript = " exec \"${SRCROOT}/scripts/copy-carthage-frameworks.sh\""; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Charts.xcodeproj/xcshareddata/xcschemes/Charts.xcscheme b/Charts.xcodeproj/xcshareddata/xcschemes/Charts.xcscheme index 4bac55e801..4002aea0ad 100644 --- a/Charts.xcodeproj/xcshareddata/xcschemes/Charts.xcscheme +++ b/Charts.xcodeproj/xcshareddata/xcschemes/Charts.xcscheme @@ -29,6 +29,16 @@ shouldUseLaunchSchemeArgsEnv = "YES" codeCoverageEnabled = "YES"> + + + + + + + + diff --git a/scripts/copy-carthage-frameworks.sh b/scripts/copy-carthage-frameworks.sh new file mode 100755 index 0000000000..fe47804c64 --- /dev/null +++ b/scripts/copy-carthage-frameworks.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +case "$PLATFORM_NAME" in + macosx) plat=Mac;; + iphone*) plat=iOS;; + watch*) plat=watchOS;; + appletv*) plat=tvOS;; + *) echo "error: Unknown PLATFORM_NAME: $PLATFORM_NAME"; exit 1;; +esac + +for (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do + VAR=SCRIPT_INPUT_FILE_$n + framework=$(basename "${!VAR}") + export SCRIPT_INPUT_FILE_$n="$SRCROOT"/Carthage/Build/$plat/"$framework".framework +done + +/usr/local/bin/carthage copy-frameworks || exit + +for (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do + VAR=SCRIPT_INPUT_FILE_$n + source=${!VAR}.dSYM + dest=${BUILT_PRODUCTS_DIR}/$(basename "$source") + ditto "$source" "$dest" || exit +done \ No newline at end of file