Podfile 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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://cdn.cocoapods.org/'
  6. use_frameworks!
  7. install! 'cocoapods',
  8. :generate_multiple_pod_projects => true,
  9. :incremental_installation => true,
  10. # Disable input/output path checking for generated frameworks to make
  11. # incremental builds work properly. Without this, changes to the framework
  12. # may not be picked up in between test runs.
  13. #
  14. # See:
  15. # https://github.com/CocoaPods/CocoaPods/issues/8073
  16. # https://www.ralfebert.de/ios/blog/cocoapods-clean-input-output-files/
  17. :disable_input_output_paths => true
  18. post_install do |installer|
  19. sync = Pathname.new(__FILE__).dirname.join('../../scripts/sync_project.rb')
  20. system('ruby', sync.to_s)
  21. if !$?.success?
  22. raise "sync_project.rb failed with status #{$?.exitstatus}"
  23. end
  24. end
  25. # Returns true if the user has explicitly requested local sources or if this is
  26. # a non-PR Travis build.
  27. def use_local_sources()
  28. return ENV.has_key?('USE_LOCAL_SOURCES') || ENV['TRAVIS_PULL_REQUEST'] == 'false'
  29. end
  30. def xcode_major_version()
  31. version = `xcodebuild -version`
  32. if version =~ /^Xcode\s*(\d+)\./
  33. return $1.to_i
  34. else
  35. raise "Could not find Xcode version in '$version'"
  36. end
  37. end
  38. # Adds a `pod name, :path => ../..` declaration to use local sources if the
  39. # Podfile has been configured to operate that way.
  40. def maybe_local_pod(name)
  41. if use_local_sources()
  42. pod name, :path => '../..'
  43. end
  44. end
  45. # Adds local pod declarations for all Firestore's transitive dependencies if
  46. # required.
  47. def configure_local_pods()
  48. # Firestore is always local; that's what's under development here.
  49. pod 'FirebaseFirestore', :path => '../../'
  50. # FirebaseCore must always be a local pod so that CI builds that make changes
  51. # to its podspec can still function. See Firestore-*-xcodebuild in
  52. # scripts/install_prereqs.sh for more details.
  53. pod 'FirebaseCore', :path => '../..'
  54. # Pull in local sources conditionally.
  55. maybe_local_pod 'FirebaseAuth'
  56. maybe_local_pod 'FirebaseAuthInterop'
  57. maybe_local_pod 'GoogleUtilities'
  58. if xcode_major_version() >= 9
  59. # Firestore still compiles with Xcode 8 to help verify general conformance
  60. # with C++11 by using an older compiler that doesn't have as many
  61. # extensions from later versions of the language. However, Firebase as a
  62. # whole does not support this environment and @available checks in
  63. # GoogleDataTransport would otherwise break this build.
  64. #
  65. # Firestore doesn't depend on GoogleDataTransport directly--it comes in as
  66. # a dependency of FirebaseCoreDiagnostics. Luckily, FirebaseCore does not
  67. # strongly depend on this, so we can edit the dependency out in the podspec
  68. # and then avoid adding those dependencies here to prevent CocoaPods from
  69. # importing it.
  70. #
  71. # This list should include the transitive closure of all dependencies of
  72. # FirebaseCoreDiagnostics, except GoogleUtilities which we otherwise need.
  73. maybe_local_pod 'FirebaseCoreDiagnostics'
  74. maybe_local_pod 'FirebaseCoreDiagnosticsInterop'
  75. maybe_local_pod 'GoogleDataTransport'
  76. maybe_local_pod 'GoogleDataTransportCCTSupport'
  77. end
  78. end
  79. target 'Firestore_Example_iOS' do
  80. platform :ios, '8.0'
  81. # The next line is the forcing function for the Firebase pod. The Firebase
  82. # version's subspecs should depend on the component versions in their
  83. # corresponding podspecs.
  84. pod 'Firebase/CoreOnly', '6.8.1'
  85. configure_local_pods()
  86. target 'Firestore_Tests_iOS' do
  87. inherit! :search_paths
  88. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  89. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  90. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  91. pod 'OCMock'
  92. pod 'leveldb-library'
  93. end
  94. target 'Firestore_Benchmarks_iOS' do
  95. inherit! :search_paths
  96. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  97. end
  98. target 'Firestore_IntegrationTests_iOS' do
  99. inherit! :search_paths
  100. pod 'FirebaseFirestoreSwift', :path => '../../'
  101. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  102. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  103. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  104. pod 'OCMock'
  105. pod 'leveldb-library'
  106. end
  107. target 'Firestore_SwiftTests_iOS' do
  108. pod 'FirebaseFirestoreSwift', :path => '../../'
  109. end
  110. target 'Firestore_FuzzTests_iOS' do
  111. inherit! :search_paths
  112. platform :ios, '9.0'
  113. pod 'LibFuzzer', :podspec => 'LibFuzzer.podspec', :inhibit_warnings => true
  114. pod '!ProtoCompiler'
  115. end
  116. end
  117. target 'Firestore_Example_macOS' do
  118. platform :osx, '10.11'
  119. configure_local_pods()
  120. target 'Firestore_Tests_macOS' do
  121. inherit! :search_paths
  122. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  123. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  124. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  125. pod 'OCMock'
  126. pod 'leveldb-library'
  127. end
  128. target 'Firestore_IntegrationTests_macOS' do
  129. inherit! :search_paths
  130. pod 'FirebaseFirestoreSwift', :path => '../../'
  131. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  132. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  133. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  134. pod 'OCMock'
  135. pod 'leveldb-library'
  136. end
  137. end
  138. target 'Firestore_Example_tvOS' do
  139. platform :tvos, '10.0'
  140. configure_local_pods()
  141. target 'Firestore_Tests_tvOS' do
  142. inherit! :search_paths
  143. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  144. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  145. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  146. pod 'OCMock'
  147. pod 'leveldb-library'
  148. end
  149. target 'Firestore_IntegrationTests_tvOS' do
  150. inherit! :search_paths
  151. pod 'FirebaseFirestoreSwift', :path => '../../'
  152. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  153. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  154. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  155. pod 'OCMock'
  156. pod 'leveldb-library'
  157. end
  158. end