From 52e42c0fe77fab956603a3159a626bee5506af9b Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Mon, 3 Jun 2019 10:09:26 -0700 Subject: [PATCH] Use CocoaPods CDN (#3124) --- .travis.yml | 2 +- Example/Podfile | 5 ++--- Firestore/Example/Podfile | 5 ++--- InAppMessaging/Example/Podfile | 5 ++--- InAppMessagingDisplay/Example/Podfile | 5 ++--- SymbolCollisionTest/Podfile | 3 +++ scripts/build.sh | 10 ++++----- scripts/install_prereqs.sh | 29 ++++++++++----------------- scripts/pod_lib_lint.rb | 2 +- 9 files changed, 29 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7241dec3ca..8d79772621 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,7 +66,7 @@ jobs: - travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseDatabase.podspec --use-modular-headers --skip-tests env: - - PROJECT=DynamicLinks PLATFORM=all METHOD=xcodebuild + - PROJECT=DynamicLinks PLATFORM=all METHOD=pod-lib-lint before_install: - ./scripts/if_changed.sh ./scripts/install_prereqs.sh script: diff --git a/Example/Podfile b/Example/Podfile index ec868bab50..0ea4940a13 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -2,9 +2,8 @@ #source 'sso://cpdc-internal/firebase' #source 'https://github.com/CocoaPods/Specs.git' -# Uncomment the next two lines for pre-release testing on public repo -source 'https://github.com/Firebase/SpecsStaging.git' -source 'https://github.com/CocoaPods/Specs.git' +# Comment the following line to use the CocoaPods master repo instead. +source 'https://cdn.jsdelivr.net/cocoa/' use_frameworks! diff --git a/Firestore/Example/Podfile b/Firestore/Example/Podfile index 497017491e..83dc93d340 100644 --- a/Firestore/Example/Podfile +++ b/Firestore/Example/Podfile @@ -2,9 +2,8 @@ #source 'sso://cpdc-internal/firebase' #source 'https://github.com/CocoaPods/Specs.git' -# Uncomment the next two lines for pre-release testing on public repo -#source 'https://github.com/Firebase/SpecsStaging.git' -#source 'https://github.com/CocoaPods/Specs.git' +# Comment the following line to use the CocoaPods master repo instead. +source 'https://cdn.jsdelivr.net/cocoa/' use_frameworks! diff --git a/InAppMessaging/Example/Podfile b/InAppMessaging/Example/Podfile index b60deb2c8d..3d8f089fd0 100644 --- a/InAppMessaging/Example/Podfile +++ b/InAppMessaging/Example/Podfile @@ -1,8 +1,7 @@ use_frameworks! -# Uncomment the next two lines for pre-release testing on public repo -source 'https://github.com/Firebase/SpecsStaging.git' -source 'https://github.com/CocoaPods/Specs.git' +# Comment the following line to use the CocoaPods master repo instead. +source 'https://cdn.jsdelivr.net/cocoa/' pod 'FirebaseAnalytics' pod 'FirebaseCore', :path => '../..' diff --git a/InAppMessagingDisplay/Example/Podfile b/InAppMessagingDisplay/Example/Podfile index 6ee7a4020e..70d63d7f61 100644 --- a/InAppMessagingDisplay/Example/Podfile +++ b/InAppMessagingDisplay/Example/Podfile @@ -1,6 +1,5 @@ -# Uncomment the next two lines for pre-release testing on public repo -source 'https://github.com/Firebase/SpecsStaging.git' -source 'https://github.com/CocoaPods/Specs.git' +# Comment the following line to use the CocoaPods master repo instead. +source 'https://cdn.jsdelivr.net/cocoa/' use_frameworks! diff --git a/SymbolCollisionTest/Podfile b/SymbolCollisionTest/Podfile index 792a7df877..b1a3edd8df 100644 --- a/SymbolCollisionTest/Podfile +++ b/SymbolCollisionTest/Podfile @@ -1,6 +1,9 @@ # Uncomment the next line to define a global platform for your project # platform :ios, '9.0' +# Comment the following line to use the CocoaPods master repo instead. +source 'https://cdn.jsdelivr.net/cocoa/' + target 'SymbolCollisionTest' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! diff --git a/scripts/build.sh b/scripts/build.sh index 32d10cd61f..5507fa16a8 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -332,14 +332,14 @@ case "$product-$method-$platform" in GoogleDataTransport-xcodebuild-*) RunXcodebuild \ - -workspace 'GoogleDataTransport/gen/GoogleDataTransport/GoogleDataTransport.xcworkspace' \ + -workspace 'gen/GoogleDataTransport/GoogleDataTransport.xcworkspace' \ -scheme "GoogleDataTransport-$platform-Unit-Tests-Unit" \ "${xcb_flags[@]}" \ build \ test RunXcodebuild \ - -workspace 'GoogleDataTransport/gen/GoogleDataTransport/GoogleDataTransport.xcworkspace' \ + -workspace 'gen/GoogleDataTransport/GoogleDataTransport.xcworkspace' \ -scheme "GoogleDataTransport-$platform-Unit-Tests-Lifecycle" \ "${xcb_flags[@]}" \ build \ @@ -348,7 +348,7 @@ case "$product-$method-$platform" in GoogleDataTransportIntegrationTest-xcodebuild-*) RunXcodebuild \ - -workspace 'GoogleDataTransport/gen/GoogleDataTransport/GoogleDataTransport.xcworkspace' \ + -workspace 'gen/GoogleDataTransport/GoogleDataTransport.xcworkspace' \ -scheme "GoogleDataTransport-$platform-Unit-Tests-Integration" \ "${xcb_flags[@]}" \ build \ @@ -357,14 +357,14 @@ case "$product-$method-$platform" in GoogleDataTransportCCTSupport-xcodebuild-*) RunXcodebuild \ - -workspace 'GoogleDataTransportCCTSupport/gen/GoogleDataTransportCCTSupport/GoogleDataTransportCCTSupport.xcworkspace' \ + -workspace 'gen/GoogleDataTransportCCTSupport/GoogleDataTransportCCTSupport.xcworkspace' \ -scheme "GoogleDataTransportCCTSupport-$platform-Unit-Tests-Unit" \ "${xcb_flags[@]}" \ build \ test RunXcodebuild \ - -workspace 'GoogleDataTransportCCTSupport/gen/GoogleDataTransportCCTSupport/GoogleDataTransportCCTSupport.xcworkspace' \ + -workspace 'gen/GoogleDataTransportCCTSupport/GoogleDataTransportCCTSupport.xcworkspace' \ -scheme "GoogleDataTransportCCTSupport-$platform-Unit-Tests-Integration" \ "${xcb_flags[@]}" \ build \ diff --git a/scripts/install_prereqs.sh b/scripts/install_prereqs.sh index 5b65778032..852ccef6df 100755 --- a/scripts/install_prereqs.sh +++ b/scripts/install_prereqs.sh @@ -46,6 +46,11 @@ function install_secrets() { fi } +function pod_gen() { + # Call pod gen with a podspec and additonal optional arguments. + bundle exec pod gen --local-sources=./ --sources=https://cdn.jsdelivr.net/cocoa/ "$@" +} + case "$PROJECT-$PLATFORM-$METHOD" in Firebase-iOS-xcodebuild) gem install xcpretty @@ -64,33 +69,25 @@ case "$PROJECT-$PLATFORM-$METHOD" in Database-*) # Install the workspace to have better control over test runs than # pod lib lint, since the integration tests can be flaky. - bundle exec pod repo update - bundle exec pod gen FirebaseDatabase.podspec --local-sources=./ + pod_gen FirebaseDatabase.podspec install_secrets ;; - DynamicLinks-*) - bundle exec pod repo update - ;; - Functions-*) # Start server for Functions integration tests. - bundle exec pod repo update ./Functions/Backend/start.sh synchronous ;; Messaging-*) # Install the workspace to have better control over test runs than # pod lib lint, since the integration tests can be flaky. - bundle exec pod repo update - bundle exec pod gen FirebaseMessaging.podspec --local-sources=./ + pod_gen FirebaseMessaging.podspec ;; Storage-*) # Install the workspace to have better control over test runs than # pod lib lint, since the integration tests can be flaky. - bundle exec pod repo update - bundle exec pod gen FirebaseStorage.podspec --local-sources=./ + pod_gen FirebaseStorage.podspec install_secrets ;; @@ -106,7 +103,6 @@ case "$PROJECT-$PLATFORM-$METHOD" in ;; *-pod-lib-lint) - bundle exec pod repo update ;; Firestore-*-cmake) @@ -124,20 +120,17 @@ case "$PROJECT-$PLATFORM-$METHOD" in GoogleDataTransport-*-xcodebuild) gem install xcpretty - bundle exec pod gen GoogleDataTransport.podspec --gen-directory=GoogleDataTransport/gen + pod_gen GoogleDataTransport.podspec ;; GoogleDataTransportIntegrationTest-*-xcodebuild) gem install xcpretty - bundle exec pod gen GoogleDataTransport.podspec --gen-directory=GoogleDataTransport/gen + pod_gen GoogleDataTransport.podspec ;; GoogleDataTransportCCTSupport-*-xcodebuild) gem install xcpretty - # TODO(mikehaney24): Remove the SpecsStaging repo once GDT is published. - bundle exec pod gen GoogleDataTransportCCTSupport.podspec \ ---gen-directory=GoogleDataTransportCCTSupport/gen \ ---sources=https://github.com/Firebase/SpecsStaging.git,https://github.com/CocoaPods/Specs.git + pod_gen GoogleDataTransportCCTSupport.podspec ;; *) echo "Unknown project-platform-method combo" 1>&2 diff --git a/scripts/pod_lib_lint.rb b/scripts/pod_lib_lint.rb index 8c5875d250..b87a4c7419 100755 --- a/scripts/pod_lib_lint.rb +++ b/scripts/pod_lib_lint.rb @@ -38,7 +38,7 @@ def main(args) exit(1) end - command = %w(bundle exec pod lib lint) + command = %w(bundle exec pod lib lint --sources=https://cdn.jsdelivr.net/cocoa/) # Figure out which dependencies are local podspec_file = args[0]