diff --git a/Charts.xcodeproj/project.pbxproj b/Charts.xcodeproj/project.pbxproj index bfd88bc685..51a34ed5fb 100644 --- a/Charts.xcodeproj/project.pbxproj +++ b/Charts.xcodeproj/project.pbxproj @@ -810,6 +810,7 @@ isa = PBXNativeTarget; buildConfigurationList = 06165F3B1D8110E700722320 /* Build configuration list for PBXNativeTarget "ChartsTests" */; buildPhases = ( + 064DBAE11D93813D002584CD /* Build Dependencies */, 06165F2A1D8110E600722320 /* Sources */, 06165F2B1D8110E600722320 /* Frameworks */, 06165F2C1D8110E600722320 /* Resources */, @@ -829,6 +830,7 @@ isa = PBXNativeTarget; buildConfigurationList = 06B120DA1D811E6200D14B02 /* Build configuration list for PBXNativeTarget "ChartsRealm" */; buildPhases = ( + 061DF29D1D93774D0002B03B /* Build Dependencies */, 06B120D01D811E6200D14B02 /* Sources */, 06B120D11D811E6200D14B02 /* Frameworks */, 06B120D21D811E6200D14B02 /* Headers */, @@ -847,10 +849,11 @@ isa = PBXNativeTarget; buildConfigurationList = 06B121071D811F1600D14B02 /* Build configuration list for PBXNativeTarget "ChartsRealmTests" */; buildPhases = ( + 064DBAE21D938156002584CD /* Build Dependencies */, 06B120FB1D811F1600D14B02 /* Sources */, 06B120FC1D811F1600D14B02 /* Frameworks */, 06B120FD1D811F1600D14B02 /* Resources */, - 06B121161D81215D00D14B02 /* ShellScript */, + 06B121161D81215D00D14B02 /* Copy Carthage Frameworks */, ); buildRules = ( ); @@ -937,6 +940,49 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 061DF29D1D93774D0002B03B /* Build Dependencies */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "", + ); + name = "Build Dependencies"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "exec \"${SRCROOT}/scripts/build-dependencies.sh\"\n"; + }; + 064DBAE11D93813D002584CD /* Build Dependencies */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Build Dependencies"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "exec \"${SRCROOT}/scripts/build-dependencies.sh\"\n"; + }; + 064DBAE21D938156002584CD /* Build Dependencies */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Build Dependencies"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "exec \"${SRCROOT}/scripts/build-dependencies.sh\"\n"; + }; 06500E641D8116FC00156E8A /* Copy Carthage Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -950,9 +996,9 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + shellScript = "exec \"${SRCROOT}/scripts/copy-carthage-frameworks.sh\"\n"; }; - 06B121161D81215D00D14B02 /* ShellScript */ = { + 06B121161D81215D00D14B02 /* Copy Carthage Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -960,11 +1006,12 @@ inputPaths = ( FBSnapshotTestCase, ); + name = "Copy Carthage Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; + shellScript = "exec \"${SRCROOT}/scripts/copy-carthage-frameworks.sh\"\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -1162,7 +1209,6 @@ /* Begin XCBuildConfiguration section */ 06165F361D8110E700722320 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -1219,7 +1265,6 @@ }; 06165F371D8110E700722320 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -1306,6 +1351,7 @@ }; 06165F3C1D8110E700722320 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; @@ -1320,6 +1366,7 @@ }; 06165F3D1D8110E700722320 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; COMBINE_HIDPI_IMAGES = YES; @@ -1333,6 +1380,7 @@ }; 06B120DB1D811E6200D14B02 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */; buildSettings = { COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; @@ -1352,6 +1400,7 @@ }; 06B120DC1D811E6200D14B02 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */; buildSettings = { COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; @@ -1371,6 +1420,7 @@ }; 06B121081D811F1600D14B02 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "-"; @@ -1386,6 +1436,7 @@ }; 06B121091D811F1600D14B02 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */; buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "-"; diff --git a/Tests/Charts/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic.png b/Tests/Charts/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic.png index cc727dd250..1828726e4d 100644 Binary files a/Tests/Charts/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic.png and b/Tests/Charts/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic.png differ diff --git a/Tests/Charts/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic@2x.png b/Tests/Charts/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic@2x.png index 71e24c8bc7..5c6ef1a32c 100644 Binary files a/Tests/Charts/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic@2x.png and b/Tests/Charts/ReferenceImages_64/ChartsTests.LineChartTests/testIsCubic@2x.png differ diff --git a/scripts/build-dependencies.sh b/scripts/build-dependencies.sh new file mode 100755 index 0000000000..f33a526549 --- /dev/null +++ b/scripts/build-dependencies.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +function build_dependencies { + + has_dependencies=$(ls Carthage/Build/**/*.framework 2> /dev/null | wc -l) + + if [ $has_dependencies != 0 ] + then + echo "Depencies have already been built." + else + echo "Building dependencies..." + carthage bootstrap + fi +} + +function alert_to_install_carthage { + echo "error: Carthage was not found! In order to build Charts you need to use Carthage to build it's dependencies. Carthage can be downloaded from https://github.com/Carthage/Carthage." + exit 1 +} + +if hash carthage 2>/dev/null +then + build_dependencies +else + alert_to_install_carthage +fi \ No newline at end of file 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