GoogleDataTransport.podspec 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. Pod::Spec.new do |s|
  2. s.name = 'GoogleDataTransport'
  3. s.version = '8.2.0'
  4. s.summary = 'Google iOS SDK data transport.'
  5. s.description = <<-DESC
  6. Shared library for iOS SDK data transport needs.
  7. DESC
  8. s.homepage = 'https://developers.google.com/'
  9. s.license = { :type => 'Apache', :file => 'LICENSE' }
  10. s.authors = 'Google, Inc.'
  11. s.source = {
  12. :git => 'https://github.com/firebase/firebase-ios-sdk.git',
  13. :tag => 'DataTransport-' + s.version.to_s
  14. }
  15. ios_deployment_target = '9.0'
  16. osx_deployment_target = '10.12'
  17. tvos_deployment_target = '10.0'
  18. watchos_deployment_target = '6.0'
  19. s.ios.deployment_target = ios_deployment_target
  20. s.osx.deployment_target = osx_deployment_target
  21. s.tvos.deployment_target = tvos_deployment_target
  22. s.watchos.deployment_target = watchos_deployment_target
  23. # To develop or run the tests, >= 1.8.0 must be installed.
  24. s.cocoapods_version = '>= 1.4.0'
  25. s.prefix_header_file = false
  26. s.source_files = ['GoogleDataTransport/GDTCORLibrary/**/*',
  27. 'GoogleDataTransport/GDTCCTLibrary/**/*']
  28. s.public_header_files = 'GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/*.h'
  29. s.ios.frameworks = 'SystemConfiguration', 'CoreTelephony'
  30. s.osx.frameworks = 'SystemConfiguration', 'CoreTelephony'
  31. s.tvos.frameworks = 'SystemConfiguration'
  32. s.libraries = ['z']
  33. s.dependency 'GoogleUtilities/Environment', '~> 7.1'
  34. s.dependency 'nanopb', '~> 2.30907.0'
  35. s.dependency 'PromisesObjC', '~> 1.2'
  36. header_search_paths = {
  37. 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}/"'
  38. }
  39. s.pod_target_xcconfig = {
  40. 'GCC_C_LANGUAGE_STANDARD' => 'c99',
  41. 'CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY' => 'YES',
  42. 'GCC_PREPROCESSOR_DEFINITIONS' =>
  43. # The nanopb pod sets these defs, so we must too. (We *do* require 16bit
  44. # (or larger) fields, so we'd have to set at least PB_FIELD_16BIT
  45. # anyways.)
  46. 'PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 GDTCOR_VERSION=' + s.version.to_s,
  47. }.merge(header_search_paths)
  48. common_test_sources = ['GoogleDataTransport/GDTCORTests/Common/**/*.{h,m}']
  49. # Test app specs
  50. if ENV['GDT_DEV'] && ENV['GDT_DEV'] == '1' then
  51. s.app_spec 'TestApp' do |app_spec|
  52. app_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  53. app_spec.source_files = [
  54. 'GoogleDataTransport/GDTTestApp/*.swift',
  55. 'GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.h',
  56. 'GoogleDataTransport/GDTCORLibrary/Internal/GDTCORUploader.h',
  57. 'GoogleDataTransport/GDTCORTests/Common/Categories/GDTCORFlatFileStorage+Testing.h',
  58. 'GoogleDataTransport/GDTCORTests/Unit/Helpers/*.[hm]',
  59. 'GoogleDataTransport/GDTTestApp/Bridging-Header.h',
  60. ]
  61. app_spec.ios.resources = ['GoogleDataTransport/GDTTestApp/ios/*.storyboard']
  62. app_spec.macos.resources = ['GoogleDataTransport/GDTTestApp/macos/*.storyboard']
  63. app_spec.tvos.resources = ['GoogleDataTransport/GDTTestApp/tvos/*.storyboard']
  64. app_spec.info_plist = {
  65. 'UILaunchStoryboardName' => 'Main',
  66. 'UIMainStoryboardFile' => 'Main',
  67. 'NSMainStoryboardFile' => 'Main'
  68. }
  69. app_spec.pod_target_xcconfig = {
  70. 'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/GoogleDataTransport/GDTTestApp/Bridging-Header.h'
  71. }
  72. end
  73. end
  74. # Unit test specs
  75. s.test_spec 'Tests-Unit' do |test_spec|
  76. test_spec.scheme = { :code_coverage => true }
  77. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  78. test_spec.requires_app_host = false
  79. test_spec.source_files = ['GoogleDataTransport/GDTCORTests/Unit/**/*.{h,m}'] + common_test_sources
  80. test_spec.pod_target_xcconfig = header_search_paths
  81. end
  82. s.test_spec 'Tests-Lifecycle' do |test_spec|
  83. test_spec.scheme = { :code_coverage => true }
  84. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  85. test_spec.requires_app_host = false
  86. test_spec.source_files = ['GoogleDataTransport/GDTCORTests/Lifecycle/**/*.{h,m}'] + common_test_sources
  87. test_spec.pod_target_xcconfig = header_search_paths
  88. end
  89. # Integration test specs
  90. s.test_spec 'Tests-Integration' do |test_spec|
  91. test_spec.scheme = { :code_coverage => true }
  92. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  93. test_spec.requires_app_host = false
  94. test_spec.source_files = ['GoogleDataTransport/GDTCORTests/Integration/**/*.{h,m}'] + common_test_sources
  95. test_spec.pod_target_xcconfig = header_search_paths
  96. test_spec.dependency 'GCDWebServer'
  97. end
  98. # Monkey test specs TODO(mikehaney24): Uncomment when travis is running >= cocoapods-1.8.0
  99. if ENV['GDT_DEV'] && ENV['GDT_DEV'] == '1' then
  100. s.test_spec 'Tests-Monkey' do |test_spec|
  101. test_spec.scheme = { :code_coverage => true }
  102. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  103. test_spec.requires_app_host = true
  104. test_spec.app_host_name = 'GoogleDataTransport/TestApp'
  105. test_spec.dependency 'GoogleDataTransport/TestApp'
  106. test_spec.source_files = ['GoogleDataTransport/GDTCORTests/Monkey/**/*.{swift}']
  107. test_spec.info_plist = {
  108. 'GDT_MONKEYTEST' => '1'
  109. }
  110. end
  111. end
  112. # CCT Tests follow
  113. if ENV['GDT_DEV'] && ENV['GDT_DEV'] == '1' then
  114. s.app_spec 'CCTTestApp' do |app_spec|
  115. app_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  116. app_spec.source_files = 'GoogleDataTransport/GDTCCTTestApp/**/*.swift'
  117. app_spec.ios.resources = ['GoogleDataTransport/GDTCCTTestApp/ios/*.storyboard']
  118. app_spec.macos.resources = ['GoogleDataTransport/GDTCCTTestApp/macos/*.storyboard']
  119. app_spec.tvos.resources = ['GoogleDataTransport/GDTCCTTestApp/tvos/*.storyboard']
  120. app_spec.dependency 'SwiftProtobuf'
  121. app_spec.info_plist = {
  122. 'UILaunchStoryboardName' => 'Main',
  123. 'UIMainStoryboardFile' => 'Main',
  124. 'NSMainStoryboardFile' => 'Main'
  125. }
  126. end
  127. end
  128. common_cct_test_sources = ['GoogleDataTransport/GDTCCTTests/Common/**/*.{h,m}']
  129. # Test specs
  130. s.test_spec 'CCT-Tests-Unit' do |test_spec|
  131. test_spec.scheme = { :code_coverage => true }
  132. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  133. test_spec.requires_app_host = false
  134. test_spec.source_files = ['GoogleDataTransport/GDTCCTTests/Unit/**/*.{h,m}'] + common_cct_test_sources + common_test_sources
  135. test_spec.resources = ['GoogleDataTransport/GDTCCTTests/Data/**/*']
  136. test_spec.pod_target_xcconfig = header_search_paths
  137. test_spec.dependency 'GCDWebServer'
  138. end
  139. s.test_spec 'CCT-Tests-Integration' do |test_spec|
  140. test_spec.scheme = { :code_coverage => true }
  141. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  142. test_spec.requires_app_host = false
  143. test_spec.source_files = [
  144. 'GoogleDataTransport/GDTCCTTests/Integration/**/*.{h,m}',
  145. 'GoogleDataTransport/GDTCCTTests/Unit/TestServer/GDTCCTTestServer.{h,m}'
  146. ] + common_cct_test_sources
  147. test_spec.resources = ['GoogleDataTransport/GDTCCTTests/Data/**/*']
  148. test_spec.pod_target_xcconfig = header_search_paths
  149. test_spec.dependency 'GCDWebServer'
  150. end
  151. # Monkey test specs, only enabled for development.
  152. if ENV['GDT_DEV'] && ENV['GDT_DEV'] == '1' then
  153. s.test_spec 'CCT-Tests-Monkey' do |test_spec|
  154. test_spec.scheme = { :code_coverage => true }
  155. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  156. test_spec.requires_app_host = true
  157. test_spec.app_host_name = 'GoogleDataTransport/CCTTestApp'
  158. test_spec.dependency 'GoogleDataTransport/CCTTestApp'
  159. test_spec.source_files = ['GoogleDataTransport/GDTCCTTests/Monkey/**/*.{swift}'] + common_cct_test_sources
  160. test_spec.info_plist = {
  161. 'GDT_MONKEYTEST' => '1'
  162. }
  163. end
  164. end
  165. end