GoogleDataTransport.podspec 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. Pod::Spec.new do |s|
  2. s.name = 'GoogleDataTransport'
  3. s.version = '8.1.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 'nanopb', '~> 2.30906.0'
  34. header_search_paths = {
  35. 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}/"'
  36. }
  37. s.pod_target_xcconfig = {
  38. 'GCC_C_LANGUAGE_STANDARD' => 'c99',
  39. 'CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY' => 'YES',
  40. 'GCC_PREPROCESSOR_DEFINITIONS' =>
  41. # The nanopb pod sets these defs, so we must too. (We *do* require 16bit
  42. # (or larger) fields, so we'd have to set at least PB_FIELD_16BIT
  43. # anyways.)
  44. 'PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 GDTCOR_VERSION=' + s.version.to_s,
  45. }.merge(header_search_paths)
  46. common_test_sources = ['GoogleDataTransport/GDTCORTests/Common/**/*.{h,m}']
  47. # Test app specs
  48. if ENV['GDT_DEV'] && ENV['GDT_DEV'] == '1' then
  49. s.app_spec 'TestApp' do |app_spec|
  50. app_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  51. app_spec.source_files = [
  52. 'GoogleDataTransport/GDTTestApp/*.swift',
  53. 'GoogleDataTransport/GDTCORLibrary/Internal/GDTCORRegistrar.h',
  54. 'GoogleDataTransport/GDTCORLibrary/Internal/GDTCORUploader.h',
  55. 'GoogleDataTransport/GDTCORTests/Common/Categories/GDTCORFlatFileStorage+Testing.h',
  56. 'GoogleDataTransport/GDTCORTests/Unit/Helpers/*.[hm]',
  57. 'GoogleDataTransport/GDTTestApp/Bridging-Header.h',
  58. ]
  59. app_spec.ios.resources = ['GoogleDataTransport/GDTTestApp/ios/*.storyboard']
  60. app_spec.macos.resources = ['GoogleDataTransport/GDTTestApp/macos/*.storyboard']
  61. app_spec.tvos.resources = ['GoogleDataTransport/GDTTestApp/tvos/*.storyboard']
  62. app_spec.info_plist = {
  63. 'UILaunchStoryboardName' => 'Main',
  64. 'UIMainStoryboardFile' => 'Main',
  65. 'NSMainStoryboardFile' => 'Main'
  66. }
  67. app_spec.pod_target_xcconfig = {
  68. 'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/GoogleDataTransport/GDTTestApp/Bridging-Header.h'
  69. }
  70. end
  71. end
  72. # Unit test specs
  73. s.test_spec 'Tests-Unit' do |test_spec|
  74. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  75. test_spec.requires_app_host = false
  76. test_spec.source_files = ['GoogleDataTransport/GDTCORTests/Unit/**/*.{h,m}'] + common_test_sources
  77. test_spec.pod_target_xcconfig = header_search_paths
  78. end
  79. s.test_spec 'Tests-Lifecycle' do |test_spec|
  80. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  81. test_spec.requires_app_host = false
  82. test_spec.source_files = ['GoogleDataTransport/GDTCORTests/Lifecycle/**/*.{h,m}'] + common_test_sources
  83. test_spec.pod_target_xcconfig = header_search_paths
  84. end
  85. # Integration test specs
  86. s.test_spec 'Tests-Integration' do |test_spec|
  87. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  88. test_spec.requires_app_host = false
  89. test_spec.source_files = ['GoogleDataTransport/GDTCORTests/Integration/**/*.{h,m}'] + common_test_sources
  90. test_spec.pod_target_xcconfig = header_search_paths
  91. test_spec.dependency 'GCDWebServer'
  92. end
  93. # Monkey test specs TODO(mikehaney24): Uncomment when travis is running >= cocoapods-1.8.0
  94. if ENV['GDT_DEV'] && ENV['GDT_DEV'] == '1' then
  95. s.test_spec 'Tests-Monkey' do |test_spec|
  96. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  97. test_spec.requires_app_host = true
  98. test_spec.app_host_name = 'GoogleDataTransport/TestApp'
  99. test_spec.dependency 'GoogleDataTransport/TestApp'
  100. test_spec.source_files = ['GoogleDataTransport/GDTCORTests/Monkey/**/*.{swift}']
  101. test_spec.info_plist = {
  102. 'GDT_MONKEYTEST' => '1'
  103. }
  104. end
  105. end
  106. # CCT Tests follow
  107. if ENV['GDT_DEV'] && ENV['GDT_DEV'] == '1' then
  108. s.app_spec 'CCTTestApp' do |app_spec|
  109. app_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  110. app_spec.source_files = 'GoogleDataTransport/GDTCCTTestApp/**/*.swift'
  111. app_spec.ios.resources = ['GoogleDataTransport/GDTCCTTestApp/ios/*.storyboard']
  112. app_spec.macos.resources = ['GoogleDataTransport/GDTCCTTestApp/macos/*.storyboard']
  113. app_spec.tvos.resources = ['GoogleDataTransport/GDTCCTTestApp/tvos/*.storyboard']
  114. app_spec.dependency 'SwiftProtobuf'
  115. app_spec.info_plist = {
  116. 'UILaunchStoryboardName' => 'Main',
  117. 'UIMainStoryboardFile' => 'Main',
  118. 'NSMainStoryboardFile' => 'Main'
  119. }
  120. end
  121. end
  122. common_cct_test_sources = ['GoogleDataTransport/GDTCCTTests/Common/**/*.{h,m}']
  123. # Test specs
  124. s.test_spec 'CCT-Tests-Unit' do |test_spec|
  125. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  126. test_spec.requires_app_host = false
  127. test_spec.source_files = ['GoogleDataTransport/GDTCCTTests/Unit/**/*.{h,m}'] + common_cct_test_sources + common_test_sources
  128. test_spec.resources = ['GoogleDataTransport/GDTCCTTests/Data/**/*']
  129. test_spec.pod_target_xcconfig = header_search_paths
  130. test_spec.dependency 'GCDWebServer'
  131. end
  132. s.test_spec 'CCT-Tests-Integration' do |test_spec|
  133. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  134. test_spec.requires_app_host = false
  135. test_spec.source_files = ['GoogleDataTransport/GDTCCTTests/Integration/**/*.{h,m}'] + common_cct_test_sources
  136. test_spec.resources = ['GoogleDataTransport/GDTCCTTests/Data/**/*']
  137. test_spec.pod_target_xcconfig = header_search_paths
  138. end
  139. # Monkey test specs, only enabled for development.
  140. if ENV['GDT_DEV'] && ENV['GDT_DEV'] == '1' then
  141. s.test_spec 'CCT-Tests-Monkey' do |test_spec|
  142. test_spec.platforms = {:ios => ios_deployment_target, :osx => osx_deployment_target, :tvos => tvos_deployment_target}
  143. test_spec.requires_app_host = true
  144. test_spec.app_host_name = 'GoogleDataTransport/CCTTestApp'
  145. test_spec.dependency 'GoogleDataTransport/CCTTestApp'
  146. test_spec.source_files = ['GoogleDataTransport/GDTCCTTests/Monkey/**/*.{swift}'] + common_cct_test_sources
  147. test_spec.info_plist = {
  148. 'GDT_MONKEYTEST' => '1'
  149. }
  150. end
  151. end
  152. end