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