Podfile 5.2 KB

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