Podfile 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. require 'pathname'
  2. # Uncomment the next two lines for pre-release testing on internal repo
  3. #source 'sso://cpdc-internal/firebase'
  4. #source 'https://cdn.cocoapods.org/'
  5. source 'https://github.com/firebase/SpecsStaging.git'
  6. source 'https://cdn.cocoapods.org/'
  7. use_frameworks!
  8. install! 'cocoapods',
  9. :generate_multiple_pod_projects => true,
  10. :incremental_installation => true,
  11. # Disable input/output path checking for generated frameworks to make
  12. # incremental builds work properly. Without this, changes to the framework
  13. # may not be picked up in between test runs.
  14. #
  15. # See:
  16. # https://github.com/CocoaPods/CocoaPods/issues/8073
  17. # https://www.ralfebert.de/ios/blog/cocoapods-clean-input-output-files/
  18. :disable_input_output_paths => true
  19. post_install do |installer|
  20. sync = Pathname.new(__FILE__).dirname.join('../../scripts/sync_project.rb')
  21. system('ruby', sync.to_s)
  22. if !$?.success?
  23. raise "sync_project.rb failed with status #{$?.exitstatus}"
  24. end
  25. end
  26. # Returns true if the user has explicitly requested local sources or if this is
  27. # a non-PR Travis build.
  28. def use_local_sources()
  29. return ENV.has_key?('USE_LOCAL_SOURCES') || ENV['TRAVIS_PULL_REQUEST'] == 'false'
  30. end
  31. # Adds a `pod name, :path => ../..` declaration to use local sources if the
  32. # Podfile has been configured to operate that way.
  33. def maybe_local_pod(name)
  34. if use_local_sources()
  35. pod name, :path => '../..'
  36. end
  37. end
  38. # Adds local pod declarations for all Firestore's transitive dependencies if
  39. # required.
  40. def configure_local_pods()
  41. # Firestore is always local; that's what's under development here.
  42. pod 'FirebaseFirestore', :path => '../..'
  43. pod 'GoogleUtilities', :path => '../..'
  44. # FirebaseCore must always be a local pod so that CI builds that make changes
  45. # to its podspec can still function. See Firestore-*-xcodebuild in
  46. # scripts/install_prereqs.sh for more details.
  47. pod 'FirebaseCore', :path => '../..'
  48. pod 'FirebaseCoreDiagnostics', :path => '../..'
  49. pod 'GoogleDataTransport', :path => '../..'
  50. pod 'GoogleDataTransportCCTSupport', :path => '../..'
  51. # Pull in local sources conditionally.
  52. maybe_local_pod 'FirebaseAuth'
  53. maybe_local_pod 'FirebaseCoreDiagnostics'
  54. maybe_local_pod 'GoogleDataTransport'
  55. maybe_local_pod 'GoogleDataTransportCCTSupport'
  56. end
  57. # Reads the value of the PLATFORM environment variable, converts it to the
  58. # equivalent symbol (e.g. 'iOS' => :ios, 'macOS' => :osx) and returns true if
  59. # the argument matches.
  60. def is_platform(symbol)
  61. platform = ENV['PLATFORM'] || 'all'
  62. platform = platform.downcase # If set, will be frozen.
  63. if platform == 'macos'
  64. # CocoaPods calls this osx
  65. platform = 'osx'
  66. end
  67. platform = platform.to_sym
  68. if symbol == platform || platform == :all
  69. puts "Adding #{symbol} targets to the project"
  70. return true
  71. else
  72. return false
  73. end
  74. end
  75. if is_platform(:ios)
  76. target 'Firestore_Example_iOS' do
  77. platform :ios, '8.0'
  78. configure_local_pods()
  79. target 'Firestore_Tests_iOS' do
  80. inherit! :search_paths
  81. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  82. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  83. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  84. pod 'leveldb-library'
  85. end
  86. target 'Firestore_Benchmarks_iOS' do
  87. inherit! :search_paths
  88. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  89. end
  90. target 'Firestore_IntegrationTests_iOS' do
  91. inherit! :search_paths
  92. pod 'FirebaseFirestoreSwift', :path => '../../'
  93. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  94. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  95. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  96. pod 'leveldb-library'
  97. end
  98. target 'Firestore_FuzzTests_iOS' do
  99. inherit! :search_paths
  100. platform :ios, '9.0'
  101. pod 'LibFuzzer', :podspec => 'LibFuzzer.podspec', :inhibit_warnings => true
  102. end
  103. end
  104. end
  105. if is_platform(:osx)
  106. target 'Firestore_Example_macOS' do
  107. platform :osx, '10.11'
  108. configure_local_pods()
  109. target 'Firestore_Tests_macOS' do
  110. inherit! :search_paths
  111. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  112. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  113. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  114. pod 'leveldb-library'
  115. end
  116. target 'Firestore_IntegrationTests_macOS' do
  117. inherit! :search_paths
  118. pod 'FirebaseFirestoreSwift', :path => '../../'
  119. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  120. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  121. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  122. pod 'leveldb-library'
  123. end
  124. end
  125. end
  126. if is_platform(:tvos)
  127. target 'Firestore_Example_tvOS' do
  128. platform :tvos, '10.0'
  129. configure_local_pods()
  130. target 'Firestore_Tests_tvOS' do
  131. inherit! :search_paths
  132. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  133. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  134. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  135. pod 'leveldb-library'
  136. end
  137. target 'Firestore_IntegrationTests_tvOS' do
  138. inherit! :search_paths
  139. pod 'FirebaseFirestoreSwift', :path => '../../'
  140. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  141. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  142. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  143. pod 'leveldb-library'
  144. end
  145. end
  146. end