ソースを参照

Analytics 7.11.0 (#7900) (#7903)

* Analytics 7.11.0 (#7900)

* Analytics 7.11.0 podspec.json files, SPM, and Firebase podspec additions

* Update: Analytics 7.11.0

* Update: Analytics 7.11.0

* Bump AnalyticsSwift dependency

* Revert "Bump AnalyticsSwift dependency"

This reverts commit 002de3c30054a001110c6f4867a64b5ec4eba1be.

Co-authored-by: Morgan McDowell <moemcd@google.com>
Ryan Wilson 5 年 前
コミット
05f796c8dc

+ 11 - 0
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.11.0'

+ 25 - 6
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"
 }

+ 17 - 0
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.

+ 18 - 0
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.

+ 17 - 5
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"
 }

+ 37 - 3
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",

+ 18 - 0
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 <TargetConditionals.h>
+#if !TARGET_OS_IOS
+#warning "Firebase Analytics only supports the iOS platform"
+#endif

+ 15 - 0
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.