Podfile 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. # Pull in local sources conditionally.
  51. maybe_local_pod 'FirebaseAuth'
  52. maybe_local_pod 'FirebaseCoreDiagnostics'
  53. maybe_local_pod 'GoogleDataTransport'
  54. end
  55. # Reads the value of the PLATFORM environment variable, converts it to the
  56. # equivalent symbol (e.g. 'iOS' => :ios, 'macOS' => :osx) and returns true if
  57. # the argument matches.
  58. def is_platform(symbol)
  59. platform = ENV['PLATFORM'] || 'all'
  60. platform = platform.downcase # If set, will be frozen.
  61. if platform == 'macos'
  62. # CocoaPods calls this osx
  63. platform = 'osx'
  64. end
  65. platform = platform.to_sym
  66. if symbol == platform || platform == :all
  67. puts "Adding #{symbol} targets to the project"
  68. return true
  69. else
  70. return false
  71. end
  72. end
  73. if is_platform(:ios)
  74. target 'Firestore_Example_iOS' do
  75. platform :ios, '10.0'
  76. configure_local_pods()
  77. target 'Firestore_Tests_iOS' do
  78. inherit! :search_paths
  79. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  80. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  81. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  82. pod 'leveldb-library'
  83. end
  84. target 'Firestore_Benchmarks_iOS' do
  85. inherit! :search_paths
  86. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  87. end
  88. target 'Firestore_IntegrationTests_iOS' do
  89. inherit! :search_paths
  90. pod 'FirebaseFirestoreSwift', :path => '../../'
  91. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  92. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  93. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  94. pod 'leveldb-library'
  95. end
  96. target 'Firestore_FuzzTests_iOS' do
  97. inherit! :search_paths
  98. platform :ios, '10.0'
  99. pod 'LibFuzzer', :podspec => 'LibFuzzer.podspec', :inhibit_warnings => true
  100. end
  101. end
  102. end
  103. if is_platform(:osx)
  104. target 'Firestore_Example_macOS' do
  105. platform :osx, '10.12'
  106. configure_local_pods()
  107. target 'Firestore_Tests_macOS' do
  108. inherit! :search_paths
  109. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  110. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  111. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  112. pod 'leveldb-library'
  113. end
  114. target 'Firestore_IntegrationTests_macOS' do
  115. inherit! :search_paths
  116. pod 'FirebaseFirestoreSwift', :path => '../../'
  117. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  118. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  119. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  120. pod 'leveldb-library'
  121. end
  122. end
  123. end
  124. if is_platform(:tvos)
  125. target 'Firestore_Example_tvOS' do
  126. platform :tvos, '10.0'
  127. configure_local_pods()
  128. target 'Firestore_Tests_tvOS' do
  129. inherit! :search_paths
  130. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  131. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  132. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  133. pod 'leveldb-library'
  134. end
  135. target 'Firestore_IntegrationTests_tvOS' do
  136. inherit! :search_paths
  137. pod 'FirebaseFirestoreSwift', :path => '../../'
  138. pod 'GoogleBenchmark', :podspec => 'GoogleBenchmark.podspec'
  139. pod 'GoogleTest', :podspec => 'GoogleTest.podspec'
  140. pod 'ProtobufCpp', :podspec => 'ProtobufCpp.podspec'
  141. pod 'leveldb-library'
  142. end
  143. end
  144. end