2019-07-08 12:30:13 -05:00
|
|
|
|
|
|
|
|
require 'pathname'
|
|
|
|
|
|
2019-01-14 11:19:52 -08:00
|
|
|
# Uncomment the next two lines for pre-release testing on internal repo
|
2018-10-25 15:02:23 -04:00
|
|
|
#source 'sso://cpdc-internal/firebase'
|
2019-06-27 10:08:24 -07:00
|
|
|
#source 'https://cdn.cocoapods.org/'
|
2018-04-19 14:06:08 -07:00
|
|
|
|
2020-04-27 17:09:59 -07:00
|
|
|
source 'https://github.com/firebase/SpecsStaging.git'
|
2019-06-27 10:08:24 -07:00
|
|
|
source 'https://cdn.cocoapods.org/'
|
2019-01-14 11:19:52 -08:00
|
|
|
|
2017-10-03 08:55:22 -07:00
|
|
|
use_frameworks!
|
2018-04-19 16:10:36 -07:00
|
|
|
|
2019-07-13 08:24:05 -07:00
|
|
|
install! 'cocoapods',
|
|
|
|
|
:generate_multiple_pod_projects => true,
|
2019-08-01 16:05:18 -07:00
|
|
|
:incremental_installation => true,
|
2019-07-13 08:24:05 -07:00
|
|
|
# Disable input/output path checking for generated frameworks to make
|
|
|
|
|
# incremental builds work properly. Without this, changes to the framework
|
|
|
|
|
# may not be picked up in between test runs.
|
|
|
|
|
#
|
|
|
|
|
# See:
|
|
|
|
|
# https://github.com/CocoaPods/CocoaPods/issues/8073
|
|
|
|
|
# https://www.ralfebert.de/ios/blog/cocoapods-clean-input-output-files/
|
|
|
|
|
:disable_input_output_paths => true
|
2019-07-08 12:30:13 -05:00
|
|
|
|
|
|
|
|
post_install do |installer|
|
|
|
|
|
sync = Pathname.new(__FILE__).dirname.join('../../scripts/sync_project.rb')
|
2019-07-31 17:20:51 -07:00
|
|
|
system('ruby', sync.to_s)
|
|
|
|
|
if !$?.success?
|
|
|
|
|
raise "sync_project.rb failed with status #{$?.exitstatus}"
|
|
|
|
|
end
|
2019-07-08 12:30:13 -05:00
|
|
|
end
|
|
|
|
|
|
2019-08-23 12:08:20 -07:00
|
|
|
# Returns true if the user has explicitly requested local sources or if this is
|
|
|
|
|
# a non-PR Travis build.
|
|
|
|
|
def use_local_sources()
|
|
|
|
|
return ENV.has_key?('USE_LOCAL_SOURCES') || ENV['TRAVIS_PULL_REQUEST'] == 'false'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# Adds a `pod name, :path => ../..` declaration to use local sources if the
|
|
|
|
|
# Podfile has been configured to operate that way.
|
|
|
|
|
def maybe_local_pod(name)
|
|
|
|
|
if use_local_sources()
|
|
|
|
|
pod name, :path => '../..'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# Adds local pod declarations for all Firestore's transitive dependencies if
|
|
|
|
|
# required.
|
|
|
|
|
def configure_local_pods()
|
|
|
|
|
# Firestore is always local; that's what's under development here.
|
2020-02-06 16:41:53 -08:00
|
|
|
pod 'FirebaseFirestore', :path => '../..'
|
2019-11-14 15:22:20 -05:00
|
|
|
pod 'GoogleUtilities', :path => '../..'
|
2019-08-23 12:08:20 -07:00
|
|
|
|
|
|
|
|
# FirebaseCore must always be a local pod so that CI builds that make changes
|
|
|
|
|
# to its podspec can still function. See Firestore-*-xcodebuild in
|
|
|
|
|
# scripts/install_prereqs.sh for more details.
|
|
|
|
|
pod 'FirebaseCore', :path => '../..'
|
2020-04-27 17:09:59 -07:00
|
|
|
pod 'FirebaseCoreDiagnostics', :path => '../..'
|
2020-04-28 16:49:53 -07:00
|
|
|
pod 'GoogleDataTransport', :path => '../..'
|
2019-08-23 12:08:20 -07:00
|
|
|
|
|
|
|
|
# Pull in local sources conditionally.
|
|
|
|
|
maybe_local_pod 'FirebaseAuth'
|
2019-08-26 19:35:45 -07:00
|
|
|
|
2020-02-06 17:37:16 -08:00
|
|
|
maybe_local_pod 'FirebaseCoreDiagnostics'
|
|
|
|
|
maybe_local_pod 'GoogleDataTransport'
|
2019-08-23 12:08:20 -07:00
|
|
|
end
|
2019-07-08 12:30:13 -05:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
# Reads the value of the PLATFORM environment variable, converts it to the
|
|
|
|
|
# equivalent symbol (e.g. 'iOS' => :ios, 'macOS' => :osx) and returns true if
|
|
|
|
|
# the argument matches.
|
|
|
|
|
def is_platform(symbol)
|
|
|
|
|
platform = ENV['PLATFORM'] || 'all'
|
|
|
|
|
platform = platform.downcase # If set, will be frozen.
|
2017-10-03 08:55:22 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
if platform == 'macos'
|
|
|
|
|
# CocoaPods calls this osx
|
|
|
|
|
platform = 'osx'
|
2018-05-03 13:34:13 -07:00
|
|
|
end
|
2019-10-07 08:46:06 -07:00
|
|
|
platform = platform.to_sym
|
2018-05-13 19:10:35 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
if symbol == platform || platform == :all
|
|
|
|
|
puts "Adding #{symbol} targets to the project"
|
|
|
|
|
return true
|
|
|
|
|
else
|
|
|
|
|
return false
|
2018-06-04 14:36:55 -04:00
|
|
|
end
|
2018-05-03 13:34:13 -07:00
|
|
|
end
|
2019-01-17 20:37:42 +00:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
if is_platform(:ios)
|
|
|
|
|
target 'Firestore_Example_iOS' do
|
2020-09-22 15:11:35 -07:00
|
|
|
platform :ios, '10.0'
|
2019-01-17 20:37:42 +00:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
configure_local_pods()
|
2019-03-26 14:51:57 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
target 'Firestore_Tests_iOS' do
|
|
|
|
|
inherit! :search_paths
|
2019-03-26 14:51:57 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
|
|
|
|
|
pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
|
|
|
|
|
pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
|
2019-03-27 16:05:55 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
pod 'leveldb-library'
|
|
|
|
|
end
|
2019-03-27 16:05:55 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
target 'Firestore_Benchmarks_iOS' do
|
|
|
|
|
inherit! :search_paths
|
2019-03-27 16:05:55 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
target 'Firestore_IntegrationTests_iOS' do
|
|
|
|
|
inherit! :search_paths
|
|
|
|
|
|
|
|
|
|
pod 'FirebaseFirestoreSwift', :path => '../../'
|
|
|
|
|
pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
|
|
|
|
|
pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
|
|
|
|
|
pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
|
|
|
|
|
|
|
|
|
|
pod 'leveldb-library'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
target 'Firestore_FuzzTests_iOS' do
|
|
|
|
|
inherit! :search_paths
|
2020-09-22 15:11:35 -07:00
|
|
|
platform :ios, '10.0'
|
2019-10-07 08:46:06 -07:00
|
|
|
|
|
|
|
|
pod 'LibFuzzer', :podspec => 'LibFuzzer.podspec', :inhibit_warnings => true
|
|
|
|
|
end
|
2019-03-27 16:05:55 -07:00
|
|
|
end
|
2019-01-17 20:37:42 +00:00
|
|
|
end
|
2019-03-28 11:43:43 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
if is_platform(:osx)
|
|
|
|
|
target 'Firestore_Example_macOS' do
|
2020-09-22 15:11:35 -07:00
|
|
|
platform :osx, '10.12'
|
2019-03-28 11:43:43 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
configure_local_pods()
|
2019-03-28 11:43:43 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
target 'Firestore_Tests_macOS' do
|
|
|
|
|
inherit! :search_paths
|
2019-03-28 11:43:43 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
|
|
|
|
|
pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
|
|
|
|
|
pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
|
2019-03-28 11:43:43 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
pod 'leveldb-library'
|
|
|
|
|
end
|
2019-03-28 11:43:43 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
target 'Firestore_IntegrationTests_macOS' do
|
|
|
|
|
inherit! :search_paths
|
2019-03-28 11:43:43 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
pod 'FirebaseFirestoreSwift', :path => '../../'
|
|
|
|
|
pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
|
|
|
|
|
pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
|
|
|
|
|
pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
|
2019-03-28 11:43:43 -07:00
|
|
|
|
2019-10-07 08:46:06 -07:00
|
|
|
pod 'leveldb-library'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if is_platform(:tvos)
|
|
|
|
|
target 'Firestore_Example_tvOS' do
|
|
|
|
|
platform :tvos, '10.0'
|
|
|
|
|
|
|
|
|
|
configure_local_pods()
|
|
|
|
|
|
|
|
|
|
target 'Firestore_Tests_tvOS' do
|
|
|
|
|
inherit! :search_paths
|
|
|
|
|
|
|
|
|
|
pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
|
|
|
|
|
pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
|
|
|
|
|
pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
|
|
|
|
|
|
|
|
|
|
pod 'leveldb-library'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
target 'Firestore_IntegrationTests_tvOS' do
|
|
|
|
|
inherit! :search_paths
|
|
|
|
|
|
|
|
|
|
pod 'FirebaseFirestoreSwift', :path => '../../'
|
|
|
|
|
pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
|
|
|
|
|
pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
|
|
|
|
|
pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
|
|
|
|
|
|
|
|
|
|
pod 'leveldb-library'
|
|
|
|
|
end
|
2019-03-28 11:43:43 -07:00
|
|
|
end
|
|
|
|
|
end
|