Podfile 5.2 KB

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