Skip to content

Commit 4f6c342

Browse files
authored
New and clearer FirebaseAnalytics subspecs (#14882)
The new subspecs: Default, Core, and IdentitySupport. The previous subspecs that are now deprecated: AdIdSupport (use IdentitySupport) and WithoutAdIdSupport (use Core).
1 parent f9b54b5 commit 4f6c342

File tree

11 files changed

+223
-7
lines changed

11 files changed

+223
-7
lines changed

FirebaseAnalytics.podspec

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,30 @@ Pod::Spec.new do |s|
3434
s.dependency 'GoogleUtilities/Network', '~> 8.1'
3535
s.dependency 'nanopb', '~> 3.30910.0'
3636

37-
s.default_subspecs = 'AdIdSupport'
37+
s.default_subspecs = 'Default'
3838

39+
s.subspec 'Default' do |ss|
40+
ss.dependency 'GoogleAppMeasurement/Default', '11.14.0'
41+
ss.vendored_frameworks = 'Frameworks/FirebaseAnalytics.xcframework'
42+
end
43+
44+
s.subspec 'Core' do |ss|
45+
ss.dependency 'GoogleAppMeasurement/Core', '11.14.0'
46+
ss.vendored_frameworks = 'Frameworks/FirebaseAnalytics.xcframework'
47+
end
48+
49+
s.subspec 'IdentitySupport' do |ss|
50+
ss.dependency 'GoogleAppMeasurement/IdentitySupport', '11.14.0'
51+
ss.vendored_frameworks = 'Frameworks/FirebaseAnalytics.xcframework'
52+
end
53+
54+
# Deprecated. Use IdentitySupport subspec instead.
3955
s.subspec 'AdIdSupport' do |ss|
40-
ss.dependency 'GoogleAppMeasurement', '11.14.0'
56+
ss.dependency 'GoogleAppMeasurement/AdIdSupport', '11.14.0'
4157
ss.vendored_frameworks = 'Frameworks/FirebaseAnalytics.xcframework'
4258
end
4359

60+
# Deprecated. Use Core subspec instead.
4461
s.subspec 'WithoutAdIdSupport' do |ss|
4562
ss.dependency 'GoogleAppMeasurement/WithoutAdIdSupport', '11.14.0'
4663
ss.vendored_frameworks = 'Frameworks/FirebaseAnalytics.xcframework'

FirebaseAnalyticsCoreWrapper/dummy.m

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Swift Package Manager needs at least one source file.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Swift Package Manager needs at least one header to prevent a warning. See
18+
// https://github.com/firebase/firebase-ios-sdk/pull/6504.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Swift Package Manager needs at least one source file.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2021 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Swift Package Manager needs at least one header to prevent a warning. See
18+
// https://github.com/firebase/firebase-ios-sdk/pull/6504.

FirebaseAnalyticsOnDeviceConversionWrapper/dummy.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515
*/
1616

1717
// Swift Package Manager needs at least one source file.
18+
19+
// #warning "FirebaseAnalyticsOnDeviceConversion is deprecated. Use GoogleAdsOnDeviceConversion from
20+
// https://github.com/googleads/google-ads-on-device-conversion-ios-sdk/ instead."

FirebaseAnalyticsWithoutAdIdSupportWrapper/dummy.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
*/
1616

1717
// Swift Package Manager needs at least one source file.
18+
19+
// #warning "FirebaseAnalyticsWithoutAdIdSupport is deprecated. Use FirebaseAnalyticsCore instead."

GoogleAppMeasurement.podspec

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,31 @@ Pod::Spec.new do |s|
3434
s.dependency 'GoogleUtilities/Network', '~> 8.1'
3535
s.dependency 'nanopb', '~> 3.30910.0'
3636

37-
s.default_subspecs = 'AdIdSupport'
37+
s.default_subspecs = 'Default'
3838

39-
s.subspec 'AdIdSupport' do |ss|
40-
ss.dependency 'GoogleAppMeasurement/WithoutAdIdSupport', '11.14.0'
41-
ss.vendored_frameworks = 'Frameworks/GoogleAppMeasurementIdentitySupport.xcframework'
39+
s.subspec 'Default' do |ss|
40+
ss.dependency 'GoogleAppMeasurement/Core', '11.14.0'
41+
ss.dependency 'GoogleAppMeasurement/IdentitySupport', '11.14.0'
42+
# TODO Update to 2.0.0
43+
ss.ios.dependency 'GoogleAdsOnDeviceConversion', '1.3.0'
4244
end
4345

44-
s.subspec 'WithoutAdIdSupport' do |ss|
46+
s.subspec 'Core' do |ss|
4547
ss.vendored_frameworks = 'Frameworks/GoogleAppMeasurement.xcframework'
4648
end
4749

50+
s.subspec 'IdentitySupport' do |ss|
51+
ss.dependency 'GoogleAppMeasurement/Core', '11.14.0'
52+
ss.vendored_frameworks = 'Frameworks/GoogleAppMeasurementIdentitySupport.xcframework'
53+
end
54+
55+
# Deprecated. Use IdentitySupport subspec instead.
56+
s.subspec 'AdIdSupport' do |ss|
57+
ss.dependency 'GoogleAppMeasurement/IdentitySupport', '11.14.0'
58+
end
59+
60+
# Deprecated. Use Core subspec instead.
61+
s.subspec 'WithoutAdIdSupport' do |ss|
62+
ss.dependency 'GoogleAppMeasurement/Core', '11.14.0'
63+
end
4864
end

Package.swift

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,25 @@ let package = Package(
4343
),
4444
// Adding this library to your project is enough for it to take effect. The module
4545
// does not need to be imported into any source files.
46+
.library(
47+
name: "FirebaseAnalyticsCore",
48+
targets: ["FirebaseAnalyticsCoreTarget"]
49+
),
50+
// Adding this library to your project is enough for it to take effect. The module
51+
// does not need to be imported into any source files.
52+
.library(
53+
name: "FirebaseAnalyticsIdentitySupport",
54+
targets: ["FirebaseAnalyticsIdentitySupportTarget"]
55+
),
56+
// Deprecated. Use FirebaseAnalyticsCore instead.
57+
// Adding this library to your project is enough for it to take effect. The module
58+
// does not need to be imported into any source files.
4659
.library(
4760
name: "FirebaseAnalyticsWithoutAdIdSupport",
4861
targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"]
4962
),
63+
// Deprecated. Use GoogleAdsOnDeviceConversion from
64+
// https://github.com/googleads/google-ads-on-device-conversion-ios-sdk/ instead.
5065
// Adding this library to your project is enough for it to take effect. The module
5166
// does not need to be imported into any source files.
5267
.library(
@@ -374,6 +389,66 @@ let package = Package(
374389
path: "FirebaseAnalytics/Tests/ObjCAPI"
375390
),
376391

392+
.target(
393+
name: "FirebaseAnalyticsCoreTarget",
394+
dependencies: [.target(name: "FirebaseAnalyticsCoreWrapper",
395+
condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
396+
path: "SwiftPM-PlatformExclude/FirebaseAnalyticsCoreWrap"
397+
),
398+
.target(
399+
name: "FirebaseAnalyticsCoreWrapper",
400+
dependencies: [
401+
.target(
402+
name: "FirebaseAnalytics",
403+
condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
404+
),
405+
.product(name: "GoogleAppMeasurementCore",
406+
package: "GoogleAppMeasurement",
407+
condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
408+
"FirebaseCore",
409+
"FirebaseInstallations",
410+
.product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
411+
.product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
412+
.product(name: "GULNSData", package: "GoogleUtilities"),
413+
.product(name: "GULNetwork", package: "GoogleUtilities"),
414+
.product(name: "nanopb", package: "nanopb"),
415+
],
416+
path: "FirebaseAnalyticsCoreWrapper",
417+
linkerSettings: [
418+
.linkedLibrary("sqlite3"),
419+
.linkedLibrary("c++"),
420+
.linkedLibrary("z"),
421+
.linkedFramework("StoreKit"),
422+
]
423+
),
424+
425+
.target(
426+
name: "FirebaseAnalyticsIdentitySupportTarget",
427+
dependencies: [
428+
.target(
429+
name: "FirebaseAnalytics",
430+
condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
431+
),
432+
.product(name: "GoogleAppMeasurementIdentitySupport",
433+
package: "GoogleAppMeasurement",
434+
condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
435+
"FirebaseCore",
436+
"FirebaseInstallations",
437+
.product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
438+
.product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
439+
.product(name: "GULNSData", package: "GoogleUtilities"),
440+
.product(name: "GULNetwork", package: "GoogleUtilities"),
441+
.product(name: "nanopb", package: "nanopb"),
442+
],
443+
path: "FirebaseAnalyticsIdentitySupportWrapper",
444+
linkerSettings: [
445+
.linkedLibrary("sqlite3"),
446+
.linkedLibrary("c++"),
447+
.linkedLibrary("z"),
448+
.linkedFramework("StoreKit"),
449+
]
450+
),
451+
377452
.target(
378453
name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
379454
dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#import <TargetConditionals.h>
16+
#if TARGET_OS_WATCH
17+
#warning "Firebase Analytics does not support the watchOS platform"
18+
#endif
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// Prevent a missing umbrella header warning.

0 commit comments

Comments
 (0)