diff --git a/Firebase.podspec b/Firebase.podspec index 3a94282039..d48e95071f 100644 --- a/Firebase.podspec +++ b/Firebase.podspec @@ -62,6 +62,17 @@ Simplify your app development, grow your user base, and monetize more effectivel ss.dependency 'Firebase/Core' end + s.subspec 'AnalyticsWithAdIdSupport' do |ss| + ss.ios.deployment_target = '9.0' + ss.dependency 'Firebase/Core' + end + + s.subspec 'AnalyticsWithoutAdIdSupport' do |ss| + ss.ios.deployment_target = '9.0' + ss.ios.dependency 'FirebaseAnalytics/WithoutAdIdSupport', '~> 7.11.0' + ss.dependency 'Firebase/CoreOnly' + end + s.subspec 'ABTesting' do |ss| ss.dependency 'Firebase/CoreOnly' ss.dependency 'FirebaseABTesting', '~> 7.10.0' diff --git a/FirebaseAnalytics.podspec.json b/FirebaseAnalytics.podspec.json index d547817f64..106434d055 100644 --- a/FirebaseAnalytics.podspec.json +++ b/FirebaseAnalytics.podspec.json @@ -1,10 +1,10 @@ { "authors": "Google, Inc.", "cocoapods_version": ">= 1.10.0", + "default_subspecs": "AdIdSupport", "dependencies": { "FirebaseCore": "~> 7.0", "FirebaseInstallations": "~> 7.0", - "GoogleAppMeasurement": "7.10.0", "GoogleUtilities/AppDelegateSwizzler": "~> 7.0", "GoogleUtilities/MethodSwizzler": "~> 7.0", "GoogleUtilities/NSData+zlib": "~> 7.0", @@ -30,11 +30,30 @@ "ios": "9.0" }, "source": { - "http": "https://dl.google.com/firebase/ios/analytics/c224fb8e370c1cfd/FirebaseAnalytics-7.9.0.tar.gz" + "http": "https://dl.google.com/firebase/ios/analytics/b137db10f410cdb2/FirebaseAnalytics-7.11.0.tar.gz" }, - "summary": "Firebase Analytics for iOS", - "vendored_frameworks": [ - "Frameworks/FirebaseAnalytics.xcframework" + "subspecs": [ + { + "name": "AdIdSupport", + "dependencies": { + "FirebaseAnalytics/Base": "7.11.0", + "GoogleAppMeasurement/AdIdSupport": "7.11.0" + } + }, + { + "name": "WithoutAdIdSupport", + "dependencies": { + "FirebaseAnalytics/Base": "7.11.0", + "GoogleAppMeasurement/WithoutAdIdSupport": "7.11.0" + } + }, + { + "name": "Base", + "vendored_frameworks": [ + "Frameworks/FirebaseAnalytics.xcframework" + ] + } ], - "version": "7.10.0" + "summary": "Firebase Analytics for iOS", + "version": "7.11.0" } diff --git a/FirebaseAnalyticsWithoutAdIdSupportWrapper/dummy.m b/FirebaseAnalyticsWithoutAdIdSupportWrapper/dummy.m new file mode 100644 index 0000000000..f340cb75e0 --- /dev/null +++ b/FirebaseAnalyticsWithoutAdIdSupportWrapper/dummy.m @@ -0,0 +1,17 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Swift Package Manager needs at least one source file. diff --git a/FirebaseAnalyticsWithoutAdIdSupportWrapper/include/dummy.h b/FirebaseAnalyticsWithoutAdIdSupportWrapper/include/dummy.h new file mode 100644 index 0000000000..4fe40eb40c --- /dev/null +++ b/FirebaseAnalyticsWithoutAdIdSupportWrapper/include/dummy.h @@ -0,0 +1,18 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Swift Package Manager needs at least one header to prevent a warning. See +// https://github.com/firebase/firebase-ios-sdk/pull/6504. diff --git a/GoogleAppMeasurement.podspec.json b/GoogleAppMeasurement.podspec.json index 45d354dc79..00d5894204 100644 --- a/GoogleAppMeasurement.podspec.json +++ b/GoogleAppMeasurement.podspec.json @@ -1,6 +1,7 @@ { "authors": "Google, Inc.", "cocoapods_version": ">= 1.10.0", + "default_subspecs": "AdIdSupport", "dependencies": { "GoogleUtilities/AppDelegateSwizzler": "~> 7.0", "GoogleUtilities/MethodSwizzler": "~> 7.0", @@ -27,11 +28,22 @@ "ios": "9.0" }, "source": { - "http": "https://dl.google.com/firebase/ios/analytics/dd4bf2e43d43af9f/GoogleAppMeasurement-7.9.0.tar.gz" + "http": "https://dl.google.com/firebase/ios/analytics/2053f0bf92324be1/GoogleAppMeasurement-7.11.0.tar.gz" }, - "summary": "Shared measurement methods for Google libraries. Not intended for direct use.", - "vendored_frameworks": [ - "Frameworks/GoogleAppMeasurement.xcframework" + "subspecs": [ + { + "name": "AdIdSupport", + "vendored_frameworks": [ + "Frameworks/GoogleAppMeasurement.xcframework" + ] + }, + { + "name": "WithoutAdIdSupport", + "vendored_frameworks": [ + "Frameworks/GoogleAppMeasurementWithoutAdIdSupport.xcframework" + ] + } ], - "version": "7.10.0" + "summary": "Shared measurement methods for Google libraries. Not intended for direct use.", + "version": "7.11.0" } diff --git a/Package.swift b/Package.swift index b03e5ad85f..482889fd2b 100644 --- a/Package.swift +++ b/Package.swift @@ -27,6 +27,10 @@ let package = Package( name: "FirebaseAnalytics", targets: ["FirebaseAnalyticsTarget"] ), + .library( + name: "FirebaseAnalyticsWithoutAdIdSupport", + targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"] + ), .library( name: "FirebaseAnalyticsSwift-Beta", targets: ["FirebaseAnalyticsSwiftTarget"] @@ -115,7 +119,7 @@ let package = Package( .package( name: "GoogleAppMeasurement", url: "https://github.com/google/GoogleAppMeasurement.git", - .exact("7.10.0") + .exact("7.11.0") ), .package( name: "GoogleDataTransport", @@ -263,8 +267,8 @@ let package = Package( ), .binaryTarget( name: "FirebaseAnalytics", - url: "https://dl.google.com/firebase/ios/swiftpm/7.9.0/FirebaseAnalytics.zip", - checksum: "939cf0df51b97de5f53bfa3cb1e3d6fa83e875a9d3c47d1dff1ba67fdd9c7538" + url: "https://dl.google.com/firebase/ios/swiftpm/7.11.0/FirebaseAnalytics.zip", + checksum: "96fdd7d7e7812748b11ec2e8ca9c0cec186e1caa6037996b74410d89a4ddf6af" ), .target( name: "FirebaseAnalyticsSwiftTarget", @@ -278,6 +282,36 @@ let package = Package( path: "FirebaseAnalyticsSwift/Sources" ), + .target( + name: "FirebaseAnalyticsWithoutAdIdSupportTarget", + dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper", + condition: .when(platforms: [.iOS]))], + path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap" + ), + .target( + name: "FirebaseAnalyticsWithoutAdIdSupportWrapper", + dependencies: [ + .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS])), + .product(name: "GoogleAppMeasurementWithoutAdIdSupport", + package: "GoogleAppMeasurement", + condition: .when(platforms: [.iOS])), + "FirebaseCore", + "FirebaseInstallations", + .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"), + .product(name: "GULMethodSwizzler", package: "GoogleUtilities"), + .product(name: "GULNSData", package: "GoogleUtilities"), + .product(name: "GULNetwork", package: "GoogleUtilities"), + .product(name: "nanopb", package: "nanopb"), + ], + path: "FirebaseAnalyticsWithoutAdIdSupportWrapper", + linkerSettings: [ + .linkedLibrary("sqlite3"), + .linkedLibrary("c++"), + .linkedLibrary("z"), + .linkedFramework("StoreKit"), + ] + ), + .target( name: "FirebaseAppDistributionTarget", dependencies: [.target(name: "FirebaseAppDistribution", diff --git a/SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap/dummy.m b/SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap/dummy.m new file mode 100644 index 0000000000..5b26f9c067 --- /dev/null +++ b/SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap/dummy.m @@ -0,0 +1,18 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import +#if !TARGET_OS_IOS +#warning "Firebase Analytics only supports the iOS platform" +#endif diff --git a/SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap/include/dummy.h b/SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap/include/dummy.h new file mode 100644 index 0000000000..6a0a2f41a9 --- /dev/null +++ b/SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap/include/dummy.h @@ -0,0 +1,15 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Prevent a missing umbrella header warning.