Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes messaging issues with charts needing carthage #1525

Merged
merged 2 commits into from
Sep 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 57 additions & 6 deletions Charts.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 06165F3B1D8110E700722320 /* Build configuration list for PBXNativeTarget "ChartsTests" */;
buildPhases = (
064DBAE11D93813D002584CD /* Build Dependencies */,
06165F2A1D8110E600722320 /* Sources */,
06165F2B1D8110E600722320 /* Frameworks */,
06165F2C1D8110E600722320 /* Resources */,
Expand All @@ -829,6 +830,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 06B120DA1D811E6200D14B02 /* Build configuration list for PBXNativeTarget "ChartsRealm" */;
buildPhases = (
061DF29D1D93774D0002B03B /* Build Dependencies */,
06B120D01D811E6200D14B02 /* Sources */,
06B120D11D811E6200D14B02 /* Frameworks */,
06B120D21D811E6200D14B02 /* Headers */,
Expand All @@ -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 = (
);
Expand Down Expand Up @@ -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;
Expand All @@ -950,21 +996,22 @@
);
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 = (
);
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 */

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1219,7 +1265,6 @@
};
06165F371D8110E700722320 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -1306,6 +1351,7 @@
};
06165F3C1D8110E700722320 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
Expand All @@ -1320,6 +1366,7 @@
};
06165F3D1D8110E700722320 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
Expand All @@ -1333,6 +1380,7 @@
};
06B120DB1D811E6200D14B02 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
Expand All @@ -1352,6 +1400,7 @@
};
06B120DC1D811E6200D14B02 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
Expand All @@ -1371,6 +1420,7 @@
};
06B121081D811F1600D14B02 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "-";
Expand All @@ -1386,6 +1436,7 @@
};
06B121091D811F1600D14B02 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 063FF0401D8CC9940094A042 /* Carthage.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "-";
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions scripts/build-dependencies.sh
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions scripts/copy-carthage-frameworks.sh
Original file line number Diff line number Diff line change
@@ -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