Podfile 5.7 KB

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