|
1 | 1 | platform :osx, '10.12'
|
| 2 | +$FirebaseSDKVersion = '7.4.0' |
| 3 | + |
| 4 | +require 'yaml' |
| 5 | + |
| 6 | +pubspec = YAML.load_file(File.join('..', File.join('..', 'pubspec.yaml'))) |
2 | 7 |
|
3 | 8 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
4 | 9 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
@@ -76,8 +81,22 @@ target 'Runner' do
|
76 | 81 | pod p[:name], :path => File.join(symlink, 'macos')
|
77 | 82 | end
|
78 | 83 | }
|
79 |
| - # not supported on MacOS |
80 |
| - # pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '6.26.0' |
| 84 | + |
| 85 | + if defined?($FirebaseSDKVersion) |
| 86 | + Pod::UI.puts "#{pubspec['name']}: Using user specified Firebase SDK version for FirebaseFirestore framework: '#{$FirebaseSDKVersion}'" |
| 87 | + firebase_sdk_version = $FirebaseSDKVersion |
| 88 | + else |
| 89 | + firebase_core_script = File.join(File.expand_path('..', File.expand_path('..', File.expand_path('..', File.expand_path('..', File.dirname(__FILE__))))), 'firebase_core/firebase_core/ios/firebase_sdk_version.rb') |
| 90 | + if File.exist?(firebase_core_script) |
| 91 | + require firebase_core_script |
| 92 | + firebase_sdk_version = firebase_sdk_version! |
| 93 | + Pod::UI.puts "#{pubspec['name']}: Using Firebase SDK version '#{firebase_sdk_version}' defined in 'firebase_core for FirebaseFirestore framework'" |
| 94 | + else |
| 95 | + raise "Error - unable to locate firebase_ios_sdk.rb script in firebase_core, and no FirebaseSDKVersion specified" |
| 96 | + end |
| 97 | + end |
| 98 | + |
| 99 | + pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => "#{firebase_sdk_version}" |
81 | 100 | end
|
82 | 101 |
|
83 | 102 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
|
|
0 commit comments