Browse Source

Fix Firestore builds under Xcode 8 (#3647)

* Fix Firestore builds under Xcode 8

* FirebaseCore must be a local pod

Otherwise pod install won't pick up local edits to that podspec
Gil 6 năm trước cách đây
mục cha
commit
c42bf815a5
2 tập tin đã thay đổi với 15 bổ sung0 xóa
  1. 3 0
      Firestore/Example/Podfile
  2. 12 0
      scripts/install_prereqs.sh

+ 3 - 0
Firestore/Example/Podfile

@@ -39,6 +39,7 @@ target 'Firestore_Example_iOS' do
   pod 'Firebase/CoreOnly', '6.7.0'
 
   pod 'FirebaseFirestore', :path => '../../'
+  pod 'FirebaseCore', :path => '../../'
 
   target 'Firestore_Tests_iOS' do
     inherit! :search_paths
@@ -86,6 +87,7 @@ target 'Firestore_Example_macOS' do
   platform :osx, '10.11'
 
   pod 'FirebaseFirestore', :path => '../../'
+  pod 'FirebaseCore', :path => '../../'
 
   target 'Firestore_Tests_macOS' do
     inherit! :search_paths
@@ -115,6 +117,7 @@ target 'Firestore_Example_tvOS' do
   platform :tvos, '10.0'
 
   pod 'FirebaseFirestore', :path => '../../'
+  pod 'FirebaseCore', :path => '../../'
 
   target 'Firestore_Tests_tvOS' do
     inherit! :search_paths

+ 12 - 0
scripts/install_prereqs.sh

@@ -105,6 +105,18 @@ case "$PROJECT-$PLATFORM-$METHOD" in
     ;;
 
   Firestore-*-xcodebuild | Firestore-*-fuzz)
+    if [[ $XCODE_VERSION == "8."* ]]; then
+      # Firestore still compiles with Xcode 8 to help verify general
+      # conformance with C++11 by using an older compiler that doesn't have as
+      # many extensions from later versions of the language. However, Firebase
+      # as a whole does not support this environment and @available checks in
+      # GoogleDataTransport would otherwise break this build.
+      #
+      # This drops the dependency that adds GoogleDataTransport into
+      # Firestore's dependencies.
+      sed -i.bak "/s.dependency 'FirebaseCoreDiagnostics'/d" FirebaseCore.podspec
+    fi
+
     gem install xcpretty
     bundle exec pod install --project-directory=Firestore/Example --repo-update
     ;;