From a2c43653cf716c948b55cf4d6bf39c4d5c748c25 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Mon, 23 Mar 2020 04:52:35 -0700 Subject: [PATCH] Update podfile for Cocoapods 1.9 (#892) Summary: Updates the instructions to integrate iOS pods for the case with the usage of `use_frameworks!` for cocoapods 1.9. Also changed our podfile for Tutorial app and add travis test for the same, so that in future if there are any further changes with the API in new releases of cocoapods, we can catch it. ## Changelog - Added travis test for iOS Tutorial app - Updated the getting started guide for iOS Pull Request resolved: https://github.com/facebook/flipper/pull/892 Test Plan: Travis test passed and also tested that tutorial app builds with cocoapods 1.9 Reviewed By: mweststrate Differential Revision: D20587989 Pulled By: priteshrnandgaonkar fbshipit-source-id: b297e6b1298a20a9279ad6414e9d099917876fb1 --- .travis.yml | 25 ++++++++++++++++++- docs/getting-started.md | 8 +++--- iOS/Tutorial/Podfile | 2 +- .../Tutorial.xcodeproj/project.pbxproj | 18 +++++++++++++ 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e558c4cc..d74bd91e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -89,5 +89,28 @@ matrix: script: - cd iOS/SampleSwift - IPHONESIMULATOR=$(xcodebuild -showsdks | grep -o "iphonesimulator[0-9]\\+\\.[0-9]\\+$") - - travis_wait xcodebuild build -workspace SampleSwift.xcworkspace -scheme SampleSwift -sdk $IPHONESIMULATOR -quiet > ./build.log + - travis_wait 30 xcodebuild build -workspace SampleSwift.xcworkspace -scheme SampleSwift -sdk $IPHONESIMULATOR -quiet > ./build.log + - tail -100 ./build.log + + - language: objective-c + cache: + cocoapods: true + directories: + - $HOME/Library/Caches/CocoaPods/Pods/Release/ + + before_install: + - gem install cocoapods + - pod --version + - rm -f iOS/Tutorial/Podfile.lock + - rm -f iOS/Tutorial/build.log + - pod repo update --silent + + install: + - cd iOS/Tutorial + - travis_wait 30 pod install --silent + - cd ../../ + script: + - cd iOS/Tutorial + - IPHONESIMULATOR=$(xcodebuild -showsdks | grep -o "iphonesimulator[0-9]\\+\\.[0-9]\\+$") + - travis_wait 30 xcodebuild build -workspace Tutorial.xcworkspace -scheme Tutorial -sdk $IPHONESIMULATOR -quiet > ./build.log - tail -100 ./build.log diff --git a/docs/getting-started.md b/docs/getting-started.md index 55faeba73..fb5f54840 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -113,7 +113,7 @@ dependencies { ## Setup your iOS app -We support both Swift and Objective-C for Flipper with CocoaPods as build and distribution mechanism. For CocoaPods 1.7+ following is the configuration. +We support both Swift and Objective-C for Flipper with CocoaPods as build and distribution mechanism. For CocoaPods 1.9+ following is the configuration. ### CocoaPods @@ -147,7 +147,7 @@ target 'MyApp' do # installer.pod_targets.each do |pod| # if $static_framework.include?(pod.name) # def pod.build_type; - # Pod::Target::BuildType.static_library + # Pod::BuildType.static_library # end # end # end @@ -210,7 +210,7 @@ target 'MyApp' do # installer.pod_targets.each do |pod| # if $static_framework.include?(pod.name) # def pod.build_type; - # Pod::Target::BuildType.static_library + # Pod::BuildType.static_library # end # end # end @@ -547,7 +547,7 @@ Finally, open the Flipper desktop app, and run `yarn android` in your terminal. ### iOS -We support both Swift and Objective-C for Flipper with CocoaPods as build and distribution mechanism. For CocoaPods 1.7+, follow this configuration. +We support both Swift and Objective-C for Flipper with CocoaPods as build and distribution mechanism. For CocoaPods 1.9+, follow this configuration.
diff --git a/iOS/Tutorial/Podfile b/iOS/Tutorial/Podfile index 3204a660d..0551c5c0d 100644 --- a/iOS/Tutorial/Podfile +++ b/iOS/Tutorial/Podfile @@ -27,7 +27,7 @@ target 'Tutorial' do installer.pod_targets.each do |pod| if $static_framework.include?(pod.name) def pod.build_type; - Pod::Target::BuildType.static_library + Pod::BuildType.static_library end end end diff --git a/iOS/Tutorial/Tutorial.xcodeproj/project.pbxproj b/iOS/Tutorial/Tutorial.xcodeproj/project.pbxproj index a919ddf3c..79cf19d41 100644 --- a/iOS/Tutorial/Tutorial.xcodeproj/project.pbxproj +++ b/iOS/Tutorial/Tutorial.xcodeproj/project.pbxproj @@ -115,6 +115,7 @@ 533A253B227B37310071C64B /* Sources */, 533A253C227B37310071C64B /* Frameworks */, 533A253D227B37310071C64B /* Resources */, + 02B9FBC5809EF6A74307DC9A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -177,6 +178,23 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 02B9FBC5809EF6A74307DC9A /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Tutorial/Pods-Tutorial-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Tutorial/Pods-Tutorial-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Tutorial/Pods-Tutorial-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; BEED3735306EE52F8D24480B /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647;