From faefe1cf5a3057bfad1bfdeaa0cb900316087eb4 Mon Sep 17 00:00:00 2001 From: Xuan Liu Date: Thu, 20 Apr 2017 10:06:57 +0800 Subject: [PATCH 1/3] 1. use xcode 8.3 image 2. use Apple TV 1080p (10.2) and iPhone 7 (10.3) device id in Travis CI --- .travis.yml | 2 +- Rakefile | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 006d1cc446..dc725456c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -osx_image: xcode8.2 +osx_image: xcode8.3 language: objective-c rvm: - 2.2 diff --git a/Rakefile b/Rakefile index 6865d65fb4..7617781e65 100644 --- a/Rakefile +++ b/Rakefile @@ -39,8 +39,8 @@ def devices { iOS: { sdk: 'iphonesimulator', - device: "id='22FA2149-1241-469C-BF6D-462D3837DB72'", - uuid: '22FA2149-1241-469C-BF6D-462D3837DB72' + device: "id='57E7D476-3A98-4107-A64D-98CA0EA13EC0'", + uuid: '57E7D476-3A98-4107-A64D-98CA0EA13EC0' }, macOS: { sdk: 'macosx', @@ -49,8 +49,8 @@ def devices }, tvOS: { sdk: 'appletvsimulator', - device: "id='5761D8AB-2838-4681-A528-D0949FF240C5'", - uuid: '5761D8AB-2838-4681-A528-D0949FF240C5' + device: "id='DA272ADF-D0A3-4F0A-8F81-32D1CB993197'", + uuid: 'DA272ADF-D0A3-4F0A-8F81-32D1CB993197' } } end @@ -142,4 +142,4 @@ end desc 'updated the podspec on cocoapods' task :update_pod do sh "bundle exec pod trunk push Charts.podspec --allow-warnings" -end \ No newline at end of file +end From f4d6b64527324c9f7b065df3a4f5394fd0c3cb61 Mon Sep 17 00:00:00 2001 From: Xuan Liu Date: Fri, 21 Apr 2017 13:32:26 +0800 Subject: [PATCH 2/3] use name instead of uuid, add run script for copying missing framework for ChartsTests --- .travis.yml | 2 +- Charts.xcodeproj/project.pbxproj | 15 +++++++++++++++ Rakefile | 8 ++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc725456c5..3f56fe5082 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: - brew update - brew upgrade carthage || true - carthage version -- travis_wait carthage bootstrap --platform $PLATFORM +- carthage bootstrap --platform $PLATFORM script: - bundle exec rake ci[$PLATFORM] after_success: diff --git a/Charts.xcodeproj/project.pbxproj b/Charts.xcodeproj/project.pbxproj index 5ae58cdbdd..e2bc9c99b6 100644 --- a/Charts.xcodeproj/project.pbxproj +++ b/Charts.xcodeproj/project.pbxproj @@ -703,6 +703,7 @@ 06165F2A1D8110E600722320 /* Sources */, 06165F2B1D8110E600722320 /* Frameworks */, 06165F2C1D8110E600722320 /* Resources */, + B6355D621EA9B71800B74B2E /* ShellScript */, ); buildRules = ( ); @@ -782,6 +783,20 @@ shellPath = /bin/sh; shellScript = "exec \"${SRCROOT}/scripts/build-dependencies.sh\"\n"; }; + B6355D621EA9B71800B74B2E /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/Carthage/Build/$(PLATFORM)/FBSnapshotTestCase.framework", + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "carthage copy-frameworks"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/Rakefile b/Rakefile index 7617781e65..daf8b1bcb7 100644 --- a/Rakefile +++ b/Rakefile @@ -39,8 +39,8 @@ def devices { iOS: { sdk: 'iphonesimulator', - device: "id='57E7D476-3A98-4107-A64D-98CA0EA13EC0'", - uuid: '57E7D476-3A98-4107-A64D-98CA0EA13EC0' + device: "name='iPhone 7'", + name: 'iPhone 7' }, macOS: { sdk: 'macosx', @@ -49,8 +49,8 @@ def devices }, tvOS: { sdk: 'appletvsimulator', - device: "id='DA272ADF-D0A3-4F0A-8F81-32D1CB993197'", - uuid: 'DA272ADF-D0A3-4F0A-8F81-32D1CB993197' + device: "name='Apple TV 1080p'", + name: 'Apple TV 1080p' } } end From aafc428118f61048437016e31fd59b0e29ec2c1f Mon Sep 17 00:00:00 2001 From: Pierre-Marc Airoldi Date: Sun, 23 Apr 2017 20:31:02 -0400 Subject: [PATCH 3/3] update schemes, move script to file like ChartsRealm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update the schemes so test and library are linked (⌘ + U). move coping dependencies to external script like ChartsRealm --- Charts.xcodeproj/project.pbxproj | 9 +++---- .../xcshareddata/xcschemes/Charts.xcscheme | 17 +++++++++++++ scripts/copy-carthage-frameworks.sh | 24 +++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100755 scripts/copy-carthage-frameworks.sh 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