Paul Beusterien 2 жил өмнө
parent
commit
2f32ce1007
35 өөрчлөгдсөн 1337 нэмэгдсэн , 1349 устгасан
  1. 16 17
      .github/workflows/auth.yml
  2. 8 11
      .github/workflows/spm.yml
  3. 25 25
      FirebaseAuth.podspec
  4. 6 1
      FirebaseAuth/Sources/Swift/Auth/Auth.swift
  5. 2 4
      FirebaseAuth/Sources/Swift/Auth/AuthComponent.swift
  6. 11 7
      FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift
  7. 2 1
      FirebaseAuth/Sources/Swift/Backend/AuthRequestConfiguration.swift
  8. 1 1
      FirebaseAuth/Sources/Swift/Storage/AuthKeychainServices.swift
  9. 1 1
      FirebaseAuth/Sources/Swift/SystemService/AuthAPNSTokenManager.swift
  10. 1 0
      FirebaseAuth/Sources/Swift/SystemService/AuthNotificationManager.swift
  11. 0 1
      FirebaseAuth/Sources/Swift/Utilities/AuthDefaultUIDelegate.swift
  12. 1 1
      FirebaseAuth/Sources/Swift/Utilities/AuthLog.swift
  13. 1 0
      FirebaseAuth/Sources/Swift/Utilities/AuthUIDelegate.swift
  14. 80 73
      FirebaseAuth/Tests/Unit/AuthBackendRPCImplentationTests.swift
  15. 3 1
      FirebaseAuth/Tests/Unit/AuthProviderIDTests.swift
  16. 11 9
      FirebaseAuth/Tests/Unit/SwiftAPI.swift
  17. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRAdditionalUserInfoTests.m
  18. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRApp+FIRAuthUnitTests.h
  19. 1 1
      FirebaseAuth/Tests/UnitObjC/FIRApp+FIRAuthUnitTests.m
  20. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRAuthAPNSTokenManagerTests.m
  21. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRAuthAPNSTokenTests.m
  22. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRAuthAppCredentialTests.m
  23. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRAuthDispatcherTests.m
  24. 1 1
      FirebaseAuth/Tests/UnitObjC/FIRAuthLifeCycleTests.m
  25. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRAuthUserDefaultsTests.m
  26. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRGitHubAuthProviderTests.m
  27. 1 1
      FirebaseAuth/Tests/UnitObjC/FIRIdentityToolkitRequestTests.m
  28. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRSecureTokenRequestTests.m
  29. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRTwitterAuthProviderTests.m
  30. 0 0
      FirebaseAuth/Tests/UnitObjC/FIRUserMetadataTests.m
  31. 1 0
      FirebaseCombineSwift/Sources/Auth/Auth+Combine.swift
  32. 1 1
      FirebaseCore/Extension/FIRHeartbeatLogger.h
  33. 1163 1188
      Package.swift
  34. 0 2
      SwiftPMTests/ClientApp/ClientApp/objc-header-import-test.m
  35. 0 2
      SwiftPMTests/objc-import-test/objc-header.m

+ 16 - 17
.github/workflows/auth.yml

@@ -78,23 +78,22 @@ jobs:
     - name: BuildAndTest # can be replaced with pod lib lint with CocoaPods 1.10
       run: ([ -z $plist_secret ] || scripts/third_party/travis/retry.sh scripts/build.sh Auth iOS)
 
-  # Disable until mixed language support is available or Auth is fully in Swift
-  # spm:
-  #   # Don't run on private repo unless it is a PR.
-  #   if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
-  #   runs-on: macos-12
-  #   strategy:
-  #     matrix:
-  #       target: [iOS, tvOS, macOS, catalyst, watchOS]
-  #   steps:
-  #   - uses: actions/checkout@v3
-  #   - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
-  #     with:
-  #       cache_key: ${{ matrix.os }}
-  #   - name: Initialize xcodebuild
-  #     run: scripts/setup_spm_tests.sh
-  #   - name: Unit Tests
-  #     run: scripts/third_party/travis/retry.sh ./scripts/build.sh AuthUnit ${{ matrix.target }} spm
+  spm:
+    # Don't run on private repo unless it is a PR.
+    if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
+    runs-on: macos-12
+    strategy:
+      matrix:
+        target: [iOS, tvOS, macOS, catalyst, watchOS]
+    steps:
+    - uses: actions/checkout@v3
+    - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
+      with:
+        cache_key: ${{ matrix.os }}
+    - name: Initialize xcodebuild
+      run: scripts/setup_spm_tests.sh
+    - name: Unit Tests
+      run: scripts/third_party/travis/retry.sh ./scripts/build.sh AuthUnit ${{ matrix.target }} spm
 
   catalyst:
     # Don't run on private repo unless it is a PR.

+ 8 - 11
.github/workflows/spm.yml

@@ -1,18 +1,15 @@
 name: spm
 
 on:
-  #TODO: restore
   pull_request:
-    branches:
-      - none
-    # paths:
-    # - '.github/workflows/spm.yml'
-    # - 'Package.swift'
-    # - '.swiftpm/*'
-    # - 'scripts/build.sh'
-    # - 'SwiftPMTests/*'
-    # - 'SwiftPM-PlatformExclude'
-    # - 'Gemfile*'
+    paths:
+    - '.github/workflows/spm.yml'
+    - 'Package.swift'
+    - '.swiftpm/*'
+    - 'scripts/build.sh'
+    - 'SwiftPMTests/*'
+    - 'SwiftPM-PlatformExclude'
+    - 'Gemfile*'
   schedule:
     # Run every day at 12am (PST) - cron uses UTC times
     - cron:  '0 8 * * *'

+ 25 - 25
FirebaseAuth.podspec

@@ -71,34 +71,34 @@ supports email and password accounts, as well as several 3rd party authenticatio
         :osx => osx_deployment_target,
         :tvos => tvos_deployment_target
       }
-      unit_tests.source_files = 'FirebaseAuth/Tests/Unit/**/*.{m,h,swift}'
+      unit_tests.source_files = 'FirebaseAuth/Tests/Unit*/**/*.{m,h,swift}'
       unit_tests.osx.exclude_files = [
-        'FirebaseAuth/Tests/Unit/FIRAuthAPNSTokenManagerTests.m',
-        'FirebaseAuth/Tests/Unit/FIRAuthAPNSTokenTests.m',
-        'FirebaseAuth/Tests/Unit/FIRAuthAppCredentialManagerTests.m',
-        'FirebaseAuth/Tests/Unit/FIRAuthNotificationManagerTests.m',
-        'FirebaseAuth/Tests/Unit/FIRAuthURLPresenterTests.m',
-        'FirebaseAuth/Tests/Unit/FIREmailLink*',
-        'FirebaseAuth/Tests/Unit/FIRPhoneAuthProviderTests.m',
-        'FirebaseAuth/Tests/Unit/FIRSendVerificationCode*',
-        'FirebaseAuth/Tests/Unit/FIRSignInWithGameCenterTests.m',
-        'FirebaseAuth/Tests/Unit/FIRVerifyClient*',
-        'FirebaseAuth/Tests/Unit/FIRVerifyPhoneNumber*',
-        'FirebaseAuth/Tests/Unit/FIROAuthProviderTests.m',
-        'FirebaseAuth/Tests/Unit/FIRMultiFactorResolverTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRAuthAPNSTokenManagerTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRAuthAPNSTokenTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRAuthAppCredentialManagerTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRAuthNotificationManagerTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRAuthURLPresenterTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIREmailLink*',
+        'FirebaseAuth/Tests/UnitObjC/FIRPhoneAuthProviderTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRSendVerificationCode*',
+        'FirebaseAuth/Tests/UnitObjC/FIRSignInWithGameCenterTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRVerifyClient*',
+        'FirebaseAuth/Tests/UnitObjC/FIRVerifyPhoneNumber*',
+        'FirebaseAuth/Tests/UnitObjC/FIROAuthProviderTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRMultiFactorResolverTests.m',
       ]
       unit_tests.tvos.exclude_files = [
-        'FirebaseAuth/Tests/Unit/FIRAuthAPNSTokenManagerTests.m',
-        'FirebaseAuth/Tests/Unit/FIRAuthNotificationManagerTests.m',
-        'FirebaseAuth/Tests/Unit/FIRAuthURLPresenterTests.m',
-        'FirebaseAuth/Tests/Unit/FIREmailLink*',
-        'FirebaseAuth/Tests/Unit/FIRPhoneAuthProviderTests.m',
-        'FirebaseAuth/Tests/Unit/FIRSendVerificationCode*',
-        'FirebaseAuth/Tests/Unit/FIRSignInWithGameCenterTests.m',
-        'FirebaseAuth/Tests/Unit/FIRVerifyClient*',
-        'FirebaseAuth/Tests/Unit/FIRVerifyPhoneNumber*',
-        'FirebaseAuth/Tests/Unit/FIROAuthProviderTests.m',
-        'FirebaseAuth/Tests/Unit/FIRMultiFactorResolverTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRAuthAPNSTokenManagerTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRAuthNotificationManagerTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRAuthURLPresenterTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIREmailLink*',
+        'FirebaseAuth/Tests/UnitObjC/FIRPhoneAuthProviderTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRSendVerificationCode*',
+        'FirebaseAuth/Tests/UnitObjC/FIRSignInWithGameCenterTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRVerifyClient*',
+        'FirebaseAuth/Tests/UnitObjC/FIRVerifyPhoneNumber*',
+        'FirebaseAuth/Tests/UnitObjC/FIROAuthProviderTests.m',
+        'FirebaseAuth/Tests/UnitObjC/FIRMultiFactorResolverTests.m',
       ]
       # app_host is needed for tests with keychain
       unit_tests.requires_app_host = true

+ 6 - 1
FirebaseAuth/Sources/Swift/Auth/Auth.swift

@@ -17,7 +17,12 @@ import Foundation
 import FirebaseCore
 import FirebaseCoreExtension
 import FirebaseAppCheckInterop
-@_implementationOnly import GoogleUtilities
+#if COCOAPODS
+  @_implementationOnly import GoogleUtilities
+#else
+  @_implementationOnly import GoogleUtilities_AppDelegateSwizzler
+  @_implementationOnly import GoogleUtilities_Environment
+#endif
 
 #if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
   import UIKit

+ 2 - 4
FirebaseAuth/Sources/Swift/Auth/AuthComponent.swift

@@ -13,11 +13,9 @@
 // limitations under the License.
 
 import Foundation
-@_implementationOnly import FirebaseAppCheckInterop
+import FirebaseAppCheckInterop
 import FirebaseCore
-
-// Avoids exposing internal FirebaseCore APIs to Swift users.
-@_implementationOnly import FirebaseCoreExtension
+import FirebaseCoreExtension
 
 @objc(FIRAuthProvider) public protocol AuthProvider {
   @objc func auth() -> Auth

+ 11 - 7
FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift

@@ -14,7 +14,8 @@
 
 import Foundation
 import FirebaseCore
-@_implementationOnly import FirebaseCoreExtension
+import FirebaseCoreExtension
+import FirebaseCoreInternal
 #if COCOAPODS
   import GTMSessionFetcher
 #else
@@ -121,12 +122,15 @@ public class AuthBackendRPCIssuerImplementation: NSObject, AuthBackendRPCIssuer
     request.setValue(clientVersion, forHTTPHeaderField: "X-Client-Version")
     request.setValue(Bundle.main.bundleIdentifier, forHTTPHeaderField: "X-Ios-Bundle-Identifier")
     request.setValue(requestConfiguration.appID, forHTTPHeaderField: "X-Firebase-GMPID")
-    if let heartbeatLogger = requestConfiguration.heartbeatLogger {
-      request.setValue(
-        FIRHeaderValueFromHeartbeatsPayload(heartbeatLogger.flushHeartbeatsIntoPayload()),
-        forHTTPHeaderField: "X-Firebase-Client"
-      )
-    }
+    // TODO: Enable for SPM. Can we directly call the Swift library?
+    #if COCOAPODS
+      if let heartbeatLogger = requestConfiguration.heartbeatLogger {
+        request.setValue(
+          FIRHeaderValueFromHeartbeatsPayload(heartbeatLogger.flushHeartbeatsIntoPayload()),
+          forHTTPHeaderField: "X-Firebase-Client"
+        )
+      }
+    #endif
     let preferredLocalizations = Bundle.main.preferredLocalizations
     if preferredLocalizations.count > 0 {
       request.setValue(preferredLocalizations.first, forHTTPHeaderField: "Accept-Language")

+ 2 - 1
FirebaseAuth/Sources/Swift/Backend/AuthRequestConfiguration.swift

@@ -14,7 +14,8 @@
 
 import Foundation
 
-// TODO: Prefix with `@_implementationOnly` after port.
+// TODO: Investigate how to directly depend on FIRHeartbeatLogger instead of using a protocol so
+// FirebaseCoreExtension can be an implementation only protocol.
 import FirebaseCoreExtension
 import FirebaseAppCheckInterop
 

+ 1 - 1
FirebaseAuth/Sources/Swift/Storage/AuthKeychainServices.swift

@@ -13,7 +13,7 @@
 // limitations under the License.
 
 import Foundation
-@_implementationOnly import FirebaseCoreExtension
+import FirebaseCoreExtension
 
 /** @var kAccountPrefix
     @brief The prefix string for keychain item account attribute before the key.

+ 1 - 1
FirebaseAuth/Sources/Swift/SystemService/AuthAPNSTokenManager.swift

@@ -16,7 +16,7 @@
   import Foundation
   import UIKit
 
-  @_implementationOnly import FirebaseCoreExtension
+  // @_implementationOnly import FirebaseCoreExtension
 
   #if SWIFT_PACKAGE
     @_implementationOnly import GoogleUtilities_Environment

+ 1 - 0
FirebaseAuth/Sources/Swift/SystemService/AuthNotificationManager.swift

@@ -14,6 +14,7 @@
 
 #if !os(macOS) && !os(watchOS)
   import Foundation
+  import UIKit
 
   /** @class FIRAuthAppCredential
       @brief A class represents a credential that proves the identity of the app.

+ 0 - 1
FirebaseAuth/Sources/Swift/Utilities/AuthDefaultUIDelegate.swift

@@ -16,7 +16,6 @@
 
   import Foundation
   import UIKit
-  @_implementationOnly import GoogleUtilities
 
   /** @class AuthDefaultUIDelegate
       @brief Class responsible for providing a default FIRAuthUIDelegate.

+ 1 - 1
FirebaseAuth/Sources/Swift/Utilities/AuthLog.swift

@@ -13,7 +13,7 @@
 // limitations under the License.
 
 import Foundation
-@_implementationOnly import FirebaseCoreExtension
+import FirebaseCoreExtension
 
 enum AuthLog {
   static func logInfo(code: String, message: String) {

+ 1 - 0
FirebaseAuth/Sources/Swift/Utilities/AuthUIDelegate.swift

@@ -15,6 +15,7 @@
 #if os(iOS) || os(tvOS)
 
   import Foundation
+  import UIKit
 
   /** @protocol AuthUIDelegate
       @brief A protocol to handle user interface interactions for Firebase Auth.

+ 80 - 73
FirebaseAuth/Tests/Unit/AuthBackendRPCImplentationTests.swift

@@ -17,6 +17,7 @@ import XCTest
 
 @testable import FirebaseAuth
 import FirebaseCoreExtension
+import FirebaseCoreInternal
 import HeartbeatLoggingTestUtils
 
 private let kFakeAPIKey = "kTestAPIKey"
@@ -594,62 +595,65 @@ class AuthBackendRPCImplementationTests: RPCBaseTests {
     XCTAssertEqual(try XCTUnwrap(rpcResponse?.receivedDictionary[kTestKey] as? String), kTestValue)
   }
 
-  private class FakeHeartbeatLogger: NSObject, FIRHeartbeatLoggerProtocol {
-    var onFlushHeartbeatsIntoPayloadHandler: (() -> _ObjC_HeartbeatsPayload)?
+  // TODO: enable heartbeat logger tests for SPM
+  #if COCOAPODS
+    private class FakeHeartbeatLogger: NSObject, FIRHeartbeatLoggerProtocol {
+      var onFlushHeartbeatsIntoPayloadHandler: (() -> _ObjC_HeartbeatsPayload)?
 
-    func log() {
-      // This API should not be used by the below tests because the Auth
-      // SDK does not log heartbeats in it's networking context.
-      fatalError("FakeHeartbeatLogger log should not be used in tests.")
-    }
+      func log() {
+        // This API should not be used by the below tests because the Auth
+        // SDK does not log heartbeats in it's networking context.
+        fatalError("FakeHeartbeatLogger log should not be used in tests.")
+      }
 
-    func flushHeartbeatsIntoPayload() -> FirebaseCoreInternal._ObjC_HeartbeatsPayload {
-      guard let handler = onFlushHeartbeatsIntoPayloadHandler else {
-        fatalError("Missing Handler")
+      func flushHeartbeatsIntoPayload() -> FirebaseCoreInternal._ObjC_HeartbeatsPayload {
+        guard let handler = onFlushHeartbeatsIntoPayloadHandler else {
+          fatalError("Missing Handler")
+        }
+        return handler()
       }
-      return handler()
-    }
 
-    func heartbeatCodeForToday() -> FIRDailyHeartbeatCode {
-      // This API should not be used by the below tests because the Auth
-      // SDK uses only the V2 heartbeat API (`flushHeartbeatsIntoPayload`) for
-      // getting heartbeats.
-      return FIRDailyHeartbeatCode.none
+      func heartbeatCodeForToday() -> FIRDailyHeartbeatCode {
+        // This API should not be used by the below tests because the Auth
+        // SDK uses only the V2 heartbeat API (`flushHeartbeatsIntoPayload`) for
+        // getting heartbeats.
+        return FIRDailyHeartbeatCode.none
+      }
     }
-  }
 
-  /** @fn testRequest_IncludesHeartbeatPayload_WhenHeartbeatsNeedSending
-      @brief This test checks the behavior of @c postWithRequest:response:callback:
-          to verify that a heartbeats payload is attached as a header to an
-          outgoing request when there are stored heartbeats that need sending.
-   */
-  func testRequest_IncludesHeartbeatPayload_WhenHeartbeatsNeedSending() throws {
-    // Given
-    let fakeHeartbeatLogger = FakeHeartbeatLogger()
-    let requestConfiguration = AuthRequestConfiguration(apiKey: kFakeAPIKey,
-                                                        appID: kFakeAppID,
-                                                        heartbeatLogger: fakeHeartbeatLogger)
-
-    let request = FakeRequest(withRequestBody: [:], requestConfiguration: requestConfiguration)
+    /** @fn testRequest_IncludesHeartbeatPayload_WhenHeartbeatsNeedSending
+        @brief This test checks the behavior of @c postWithRequest:response:callback:
+            to verify that a heartbeats payload is attached as a header to an
+            outgoing request when there are stored heartbeats that need sending.
+     */
+    func testRequest_IncludesHeartbeatPayload_WhenHeartbeatsNeedSending() throws {
+      // Given
+      let fakeHeartbeatLogger = FakeHeartbeatLogger()
+      let requestConfiguration = AuthRequestConfiguration(apiKey: kFakeAPIKey,
+                                                          appID: kFakeAppID,
+                                                          heartbeatLogger: fakeHeartbeatLogger)
+
+      let request = FakeRequest(withRequestBody: [:], requestConfiguration: requestConfiguration)
+
+      // When
+      let nonEmptyHeartbeatsPayload = HeartbeatLoggingTestUtils.nonEmptyHeartbeatsPayload
+      fakeHeartbeatLogger.onFlushHeartbeatsIntoPayloadHandler = {
+        nonEmptyHeartbeatsPayload
+      }
+      rpcImplementation?.post(withRequest: request) { response, error in
+        // The callback never happens and it's fine since we only need to verify the request.
+        XCTFail("Should not be a callback")
+      }
 
-    // When
-    let nonEmptyHeartbeatsPayload = HeartbeatLoggingTestUtils.nonEmptyHeartbeatsPayload
-    fakeHeartbeatLogger.onFlushHeartbeatsIntoPayloadHandler = {
-      nonEmptyHeartbeatsPayload
-    }
-    rpcImplementation?.post(withRequest: request) { response, error in
-      // The callback never happens and it's fine since we only need to verify the request.
-      XCTFail("Should not be a callback")
+      // Then
+      let expectedHeader = FIRHeaderValueFromHeartbeatsPayload(
+        HeartbeatLoggingTestUtils.nonEmptyHeartbeatsPayload
+      )
+      let completeRequest = try XCTUnwrap(rpcIssuer?.completeRequest)
+      let headerValue = completeRequest.value(forHTTPHeaderField: "X-Firebase-Client")
+      XCTAssertEqual(headerValue, expectedHeader)
     }
-
-    // Then
-    let expectedHeader = FIRHeaderValueFromHeartbeatsPayload(
-      HeartbeatLoggingTestUtils.nonEmptyHeartbeatsPayload
-    )
-    let completeRequest = try XCTUnwrap(rpcIssuer?.completeRequest)
-    let headerValue = completeRequest.value(forHTTPHeaderField: "X-Firebase-Client")
-    XCTAssertEqual(headerValue, expectedHeader)
-  }
+  #endif
 
   /** @fn testRequest_IncludesAppCheckHeader
       @brief This test checks the behavior of @c postWithRequest:response:callback:
@@ -674,33 +678,36 @@ class AuthBackendRPCImplementationTests: RPCBaseTests {
     XCTAssertEqual(headerValue, fakeAppCheck.fakeAppCheckToken)
   }
 
-  /** @fn testRequest_DoesNotIncludeAHeartbeatPayload_WhenNoHeartbeatsNeedSending
-      @brief This test checks the behavior of @c postWithRequest:response:callback:
-          to verify that a request header does not contain heartbeat data in the
-          case that there are no stored heartbeats that need sending.
-   */
-  func testRequest_DoesNotIncludeAHeartbeatPayload_WhenNoHeartbeatsNeedSending() throws {
-    // Given
-    let fakeHeartbeatLogger = FakeHeartbeatLogger()
-    let requestConfiguration = AuthRequestConfiguration(apiKey: kFakeAPIKey,
-                                                        appID: kFakeAppID,
-                                                        heartbeatLogger: fakeHeartbeatLogger)
-
-    let request = FakeRequest(withRequestBody: [:], requestConfiguration: requestConfiguration)
+  // TODO: enable for SPM
+  #if COCOAPODS
+    /** @fn testRequest_DoesNotIncludeAHeartbeatPayload_WhenNoHeartbeatsNeedSending
+        @brief This test checks the behavior of @c postWithRequest:response:callback:
+            to verify that a request header does not contain heartbeat data in the
+            case that there are no stored heartbeats that need sending.
+     */
+    func testRequest_DoesNotIncludeAHeartbeatPayload_WhenNoHeartbeatsNeedSending() throws {
+      // Given
+      let fakeHeartbeatLogger = FakeHeartbeatLogger()
+      let requestConfiguration = AuthRequestConfiguration(apiKey: kFakeAPIKey,
+                                                          appID: kFakeAppID,
+                                                          heartbeatLogger: fakeHeartbeatLogger)
+
+      let request = FakeRequest(withRequestBody: [:], requestConfiguration: requestConfiguration)
+
+      // When
+      let emptyHeartbeatsPayload = HeartbeatLoggingTestUtils.emptyHeartbeatsPayload
+      fakeHeartbeatLogger.onFlushHeartbeatsIntoPayloadHandler = {
+        emptyHeartbeatsPayload
+      }
+      rpcImplementation?.post(withRequest: request) { response, error in
+        // The callback never happens and it's fine since we only need to verify the request.
+      }
 
-    // When
-    let emptyHeartbeatsPayload = HeartbeatLoggingTestUtils.emptyHeartbeatsPayload
-    fakeHeartbeatLogger.onFlushHeartbeatsIntoPayloadHandler = {
-      emptyHeartbeatsPayload
+      // Then
+      let completeRequest = try XCTUnwrap(rpcIssuer?.completeRequest)
+      XCTAssertNil(completeRequest.value(forHTTPHeaderField: "X-Firebase-Client"))
     }
-    rpcImplementation?.post(withRequest: request) { response, error in
-      // The callback never happens and it's fine since we only need to verify the request.
-    }
-
-    // Then
-    let completeRequest = try XCTUnwrap(rpcIssuer?.completeRequest)
-    XCTAssertNil(completeRequest.value(forHTTPHeaderField: "X-Firebase-Client"))
-  }
+  #endif
 
   private class FakeRequest: NSObject, AuthRPCRequest {
     func requestConfiguration() -> AuthRequestConfiguration {

+ 3 - 1
FirebaseAuth/Tests/Unit/AuthProviderIDTests.swift

@@ -22,7 +22,9 @@ final class AuthProviderIDTests: XCTestCase {
     XCTAssertEqual(AuthProviderString.apple.rawValue, "apple.com")
     XCTAssertEqual(AuthProviderString.email.rawValue, EmailAuthProvider.id)
     XCTAssertEqual(AuthProviderString.facebook.rawValue, FacebookAuthProvider.id)
-    XCTAssertEqual(AuthProviderString.gameCenter.rawValue, GameCenterAuthProvider.id)
+    #if !os(watchOS)
+      XCTAssertEqual(AuthProviderString.gameCenter.rawValue, GameCenterAuthProvider.id)
+    #endif
     XCTAssertEqual(AuthProviderString.gitHub.rawValue, GitHubAuthProvider.id)
     XCTAssertEqual(AuthProviderString.google.rawValue, GoogleAuthProvider.id)
     XCTAssertEqual(AuthProviderString.phone.rawValue, PhoneAuthProvider.id)

+ 11 - 9
FirebaseAuth/Tests/Unit/SwiftAPI.swift

@@ -227,7 +227,7 @@ class AuthAPI_hOnlyTests: XCTestCase {
     _ = AuthErrorCode.malformedJWT
   }
 
-  #if !os(macOS)
+  #if !os(macOS) && !os(watchOS)
     func FIRAuthUIDelegate_h() {
       class AuthUIImpl: NSObject, AuthUIDelegate {
         func present(_ viewControllerToPresent: UIViewController, animated flag: Bool,
@@ -250,7 +250,7 @@ class AuthAPI_hOnlyTests: XCTestCase {
     _ = FacebookAuthProvider.credential(withAccessToken: "token")
   }
 
-  #if !os(macOS)
+  #if !os(macOS) && !os(watchOS)
     func FIRFedederatedAuthProvider_h() {
       class FederatedAuthImplementation: NSObject, FederatedAuthProvider {
         @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
@@ -273,15 +273,17 @@ class AuthAPI_hOnlyTests: XCTestCase {
     }
   #endif
 
-  func FIRGameCenterAuthProvider_h() {
-    GameCenterAuthProvider.getCredential { _, _ in
+  #if !os(watchOS)
+    func FIRGameCenterAuthProvider_h() {
+      GameCenterAuthProvider.getCredential { _, _ in
+      }
     }
-  }
 
-  @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
-  func FIRGameCenterAuthProvider_hAsync() async throws {
-    _ = try await GameCenterAuthProvider.getCredential()
-  }
+    @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
+    func FIRGameCenterAuthProvider_hAsync() async throws {
+      _ = try await GameCenterAuthProvider.getCredential()
+    }
+  #endif
 
   func FIRGitHubAuthProvider_h() {
     _ = GitHubAuthProvider.credential(withToken: "token")

+ 0 - 0
FirebaseAuth/Tests/Unit/FIRAdditionalUserInfoTests.m → FirebaseAuth/Tests/UnitObjC/FIRAdditionalUserInfoTests.m


+ 0 - 0
FirebaseAuth/Tests/Unit/FIRApp+FIRAuthUnitTests.h → FirebaseAuth/Tests/UnitObjC/FIRApp+FIRAuthUnitTests.h


+ 1 - 1
FirebaseAuth/Tests/Unit/FIRApp+FIRAuthUnitTests.m → FirebaseAuth/Tests/UnitObjC/FIRApp+FIRAuthUnitTests.m

@@ -16,7 +16,7 @@
 
 #import "FirebaseCore/Extension/FirebaseCoreInternal.h"
 
-#import "FirebaseAuth/Tests/Unit/FIRApp+FIRAuthUnitTests.h"
+#import "FirebaseAuth/Tests/UnitObjC/FIRApp+FIRAuthUnitTests.h"
 
 @implementation FIRApp (FIRAuthUnitTests)
 

+ 0 - 0
FirebaseAuth/Tests/Unit/FIRAuthAPNSTokenManagerTests.m → FirebaseAuth/Tests/UnitObjC/FIRAuthAPNSTokenManagerTests.m


+ 0 - 0
FirebaseAuth/Tests/Unit/FIRAuthAPNSTokenTests.m → FirebaseAuth/Tests/UnitObjC/FIRAuthAPNSTokenTests.m


+ 0 - 0
FirebaseAuth/Tests/Unit/FIRAuthAppCredentialTests.m → FirebaseAuth/Tests/UnitObjC/FIRAuthAppCredentialTests.m


+ 0 - 0
FirebaseAuth/Tests/Unit/FIRAuthDispatcherTests.m → FirebaseAuth/Tests/UnitObjC/FIRAuthDispatcherTests.m


+ 1 - 1
FirebaseAuth/Tests/Unit/FIRAuthLifeCycleTests.m → FirebaseAuth/Tests/UnitObjC/FIRAuthLifeCycleTests.m

@@ -20,7 +20,7 @@
 #import "FirebaseCore/Extension/FirebaseCoreInternal.h"
 
 @import FirebaseAuth;
-#import "FirebaseAuth/Tests/Unit/FIRApp+FIRAuthUnitTests.h"
+#import "FirebaseAuth/Tests/UnitObjC/FIRApp+FIRAuthUnitTests.h"
 
 /** @var kFirebaseAppName1
     @brief A fake Firebase app name.

+ 0 - 0
FirebaseAuth/Tests/Unit/FIRAuthUserDefaultsTests.m → FirebaseAuth/Tests/UnitObjC/FIRAuthUserDefaultsTests.m


+ 0 - 0
FirebaseAuth/Tests/Unit/FIRGitHubAuthProviderTests.m → FirebaseAuth/Tests/UnitObjC/FIRGitHubAuthProviderTests.m


+ 1 - 1
FirebaseAuth/Tests/Unit/FIRIdentityToolkitRequestTests.m → FirebaseAuth/Tests/UnitObjC/FIRIdentityToolkitRequestTests.m

@@ -15,7 +15,7 @@
  */
 
 #import <XCTest/XCTest.h>
-#import "FirebaseAuth/Tests/Unit/FIRApp+FIRAuthUnitTests.h"
+#import "FirebaseAuth/Tests/UnitObjC/FIRApp+FIRAuthUnitTests.h"
 
 @import FirebaseAuth;
 

+ 0 - 0
FirebaseAuth/Tests/Unit/FIRSecureTokenRequestTests.m → FirebaseAuth/Tests/UnitObjC/FIRSecureTokenRequestTests.m


+ 0 - 0
FirebaseAuth/Tests/Unit/FIRTwitterAuthProviderTests.m → FirebaseAuth/Tests/UnitObjC/FIRTwitterAuthProviderTests.m


+ 0 - 0
FirebaseAuth/Tests/Unit/FIRUserMetadataTests.m → FirebaseAuth/Tests/UnitObjC/FIRUserMetadataTests.m


+ 1 - 0
FirebaseCombineSwift/Sources/Auth/Auth+Combine.swift

@@ -14,6 +14,7 @@
 
 #if canImport(Combine) && swift(>=5.0)
 
+  import Foundation
   import Combine
   import FirebaseAuth
 

+ 1 - 1
FirebaseCore/Extension/FIRHeartbeatLogger.h

@@ -17,7 +17,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 #ifndef FIREBASE_BUILD_CMAKE
-@import FirebaseCoreInternal;
+@class FIRHeartbeatsPayload;
 #endif  // FIREBASE_BUILD_CMAKE
 
 /// Enum representing different daily heartbeat codes.

+ 1163 - 1188
Package.swift

@@ -25,137 +25,131 @@ let package = Package(
   name: "Firebase",
   platforms: [.iOS(.v11), .macCatalyst(.v13), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v7)],
   products: [
-    // .library(
-    //   name: "FirebaseAnalytics",
-    //   targets: ["FirebaseAnalyticsTarget"]
-    // ),
-    // .library(
-    //   name: "FirebaseAnalyticsWithoutAdIdSupport",
-    //   targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"]
-    // ),
-    // .library(
-    //   name: "FirebaseAnalyticsOnDeviceConversion",
-    //   targets: ["FirebaseAnalyticsOnDeviceConversionTarget"]
-    // ),
-    // .library(
-    //   name: "FirebaseAnalyticsSwift",
-    //   targets: ["FirebaseAnalyticsSwiftTarget"]
-    // ),
+    .library(
+      name: "FirebaseAnalytics",
+      targets: ["FirebaseAnalyticsTarget"]
+    ),
+    // This library is not designed to be imported into client source code.
+    .library(
+      name: "FirebaseAnalyticsWithoutAdIdSupport",
+      targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"]
+    ),
+    // This library is not designed to be imported into client source code.
+    .library(
+      name: "FirebaseAnalyticsOnDeviceConversion",
+      targets: ["FirebaseAnalyticsOnDeviceConversionTarget"]
+    ),
+    .library(
+      name: "FirebaseAnalyticsSwift",
+      targets: ["FirebaseAnalyticsSwiftTarget"]
+    ),
     .library(
       name: "FirebaseAuth",
       targets: ["FirebaseAuth"]
     ),
-    // .library(
-    //   name: "FirebaseAppCheck",
-    //   targets: ["FirebaseAppCheck"]
-    // ),
-    // .library(
-    //   name: "FirebaseAppDistribution-Beta",
-    //   targets: ["FirebaseAppDistributionTarget"]
-    // ),
-    // .library(
-    //   name: "FirebaseAuthCombine-Community",
-    //   targets: ["FirebaseAuthCombineSwift"]
-    // ),
-    // .library(
-    //   name: "FirebaseFirestoreCombine-Community",
-    //   targets: ["FirebaseFirestoreCombineSwift"]
-    // ),
-    // .library(
-    //   name: "FirebaseFunctionsCombine-Community",
-    //   targets: ["FirebaseFunctionsCombineSwift"]
-    // ),
-    // .library(
-    //   name: "FirebaseStorageCombine-Community",
-    //   targets: ["FirebaseStorageCombineSwift"]
-    // ),
-    // .library(
-    //   name: "FirebaseCrashlytics",
-    //   targets: ["FirebaseCrashlytics"]
-    // ),
-    // .library(
-    //   name: "FirebaseDatabase",
-    //   targets: ["FirebaseDatabase"]
-    // ),
-    // .library(
-    //   name: "FirebaseDatabaseSwift",
-    //   targets: ["FirebaseDatabaseSwift"]
-    // ),
-    // .library(
-    //   name: "FirebaseDynamicLinks",
-    //   targets: ["FirebaseDynamicLinksTarget"]
-    // ),
-    // .library(
-    //   name: "FirebaseFirestore",
-    //   targets: ["FirebaseFirestoreTarget"]
-    // ),
-    // .library(
-    //   name: "FirebaseFirestoreSwift",
-    //   targets: ["FirebaseFirestoreSwiftTarget"]
-    // ),
-    // .library(
-    //   name: "FirebaseFunctions",
-    //   targets: ["FirebaseFunctions"]
-    // ),
-    // .library(
-    //   name: "FirebaseInAppMessaging-Beta",
-    //   targets: ["FirebaseInAppMessagingTarget"]
-    // ),
-    // .library(
-    //   name: "FirebaseInAppMessagingSwift-Beta",
-    //   targets: ["FirebaseInAppMessagingSwift"]
-    // ),
-    // .library(
-    //   name: "FirebaseInstallations",
-    //   targets: ["FirebaseInstallations"]
-    // ),
-    // .library(
-    //   name: "FirebaseMessaging",
-    //   targets: ["FirebaseMessaging"]
-    // ),
-    // .library(
-    //   name: "FirebaseMLModelDownloader",
-    //   targets: ["FirebaseMLModelDownloader"]
-    // ),
-    // .library(
-    //   name: "FirebasePerformance",
-    //   targets: ["FirebasePerformanceTarget"]
-    // ),
-    // .library(
-    //   name: "FirebaseRemoteConfig",
-    //   targets: ["FirebaseRemoteConfig"]
-    // ),
-    // .library(
-    //   name: "FirebaseRemoteConfigSwift",
-    //   targets: ["FirebaseRemoteConfigSwift"]
-    // ),
-    // .library(
-    //   name: "FirebaseStorage",
-    //   targets: ["FirebaseStorage"]
-    // ),
+    .library(
+      name: "FirebaseAppCheck",
+      targets: ["FirebaseAppCheck"]
+    ),
+    .library(
+      name: "FirebaseAppDistribution-Beta",
+      targets: ["FirebaseAppDistributionTarget"]
+    ),
+    .library(
+      name: "FirebaseAuthCombine-Community",
+      targets: ["FirebaseAuthCombineSwift"]
+    ),
+    .library(
+      name: "FirebaseFirestoreCombine-Community",
+      targets: ["FirebaseFirestoreCombineSwift"]
+    ),
+    .library(
+      name: "FirebaseFunctionsCombine-Community",
+      targets: ["FirebaseFunctionsCombineSwift"]
+    ),
+    .library(
+      name: "FirebaseStorageCombine-Community",
+      targets: ["FirebaseStorageCombineSwift"]
+    ),
+    .library(
+      name: "FirebaseCrashlytics",
+      targets: ["FirebaseCrashlytics"]
+    ),
+    .library(
+      name: "FirebaseDatabase",
+      targets: ["FirebaseDatabase"]
+    ),
+    .library(
+      name: "FirebaseDatabaseSwift",
+      targets: ["FirebaseDatabaseSwift"]
+    ),
+    .library(
+      name: "FirebaseDynamicLinks",
+      targets: ["FirebaseDynamicLinksTarget"]
+    ),
+    .library(
+      name: "FirebaseFirestore",
+      targets: ["FirebaseFirestoreTarget"]
+    ),
+    .library(
+      name: "FirebaseFirestoreSwift",
+      targets: ["FirebaseFirestoreSwiftTarget"]
+    ),
+    .library(
+      name: "FirebaseFunctions",
+      targets: ["FirebaseFunctions"]
+    ),
+    .library(
+      name: "FirebaseInAppMessaging-Beta",
+      targets: ["FirebaseInAppMessagingTarget"]
+    ),
+    .library(
+      name: "FirebaseInAppMessagingSwift-Beta",
+      targets: ["FirebaseInAppMessagingSwift"]
+    ),
+    .library(
+      name: "FirebaseInstallations",
+      targets: ["FirebaseInstallations"]
+    ),
+    .library(
+      name: "FirebaseMessaging",
+      targets: ["FirebaseMessaging"]
+    ),
+    .library(
+      name: "FirebaseMLModelDownloader",
+      targets: ["FirebaseMLModelDownloader"]
+    ),
+    .library(
+      name: "FirebasePerformance",
+      targets: ["FirebasePerformanceTarget"]
+    ),
+    .library(
+      name: "FirebaseRemoteConfig",
+      targets: ["FirebaseRemoteConfig"]
+    ),
+    .library(
+      name: "FirebaseRemoteConfigSwift",
+      targets: ["FirebaseRemoteConfigSwift"]
+    ),
+    .library(
+      name: "FirebaseStorage",
+      targets: ["FirebaseStorage"]
+    ),
   ],
   dependencies: [
-    // .package(
-    //   name: "Promises",
-    //   url: "https://github.com/google/promises.git",
-    //   "2.1.0" ..< "3.0.0"
-    // ),
-    // .package(
-    //   name: "SwiftProtobuf",
-    //   url: "https://github.com/apple/swift-protobuf.git",
-    //   "1.19.0" ..< "2.0.0"
-    // ),
-    // .package(
-    //   name: "GoogleAppMeasurement",
-    //   url: "https://github.com/google/GoogleAppMeasurement.git",
-    //   // Note that CI changes the version to the head of main for CI.
-    //   // See scripts/setup_spm_tests.sh.
-    //   .branch("main")
-    // ),
-    // .package(
-    //   url: "https://github.com/google/GoogleDataTransport.git",
-    //   "9.2.0" ..< "10.0.0"
-    // ),
+    .package(
+      url: "https://github.com/google/promises.git",
+      "2.1.0" ..< "3.0.0"
+    ),
+    .package(
+      url: "https://github.com/apple/swift-protobuf.git",
+      "1.19.0" ..< "2.0.0"
+    ),
+    googleAppMeasurementDependency(),
+    .package(
+      url: "https://github.com/google/GoogleDataTransport.git",
+      "9.2.0" ..< "10.0.0"
+    ),
     .package(
       url: "https://github.com/google/GoogleUtilities.git",
       "7.11.0" ..< "8.0.0"
@@ -164,36 +158,30 @@ let package = Package(
       url: "https://github.com/google/gtm-session-fetcher.git",
       "2.1.0" ..< "4.0.0"
     ),
-    // .package(
-    //   name: "nanopb",
-    //   url: "https://github.com/firebase/nanopb.git",
-    //   "2.30909.0" ..< "2.30910.0"
-    // ),
-    // .package(
-    //   name: "abseil",
-    //   url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
-    //   "0.20220203.1" ..< "0.20220204.0"
-    // ),
-    // .package(
-    //   name: "gRPC",
-    //   url: "https://github.com/grpc/grpc-ios.git",
-    //   "1.44.0-grpc" ..< "1.45.0-grpc"
-    // ),
     .package(
-      name: "OCMock",
+      url: "https://github.com/firebase/nanopb.git",
+      "2.30909.0" ..< "2.30910.0"
+    ),
+    .package(
+      url: "https://github.com/google/abseil-cpp-binary.git",
+      "1.2022062300.0" ..< "1.2022062400.0"
+    ),
+    .package(
+      url: "https://github.com/google/grpc-binary.git",
+      "1.50.1" ..< "1.51.0"
+    ),
+    .package(
       url: "https://github.com/erikdoe/ocmock.git",
-      .revision("c5eeaa6dde7c308a5ce48ae4d4530462dd3a1110")
-    ),
-    // .package(
-    //   name: "leveldb",
-    //   url: "https://github.com/firebase/leveldb.git",
-    //   "1.22.2" ..< "1.23.0"
-    // ),
-    // .package(
-    //   name: "GCDWebServer",
-    //   url: "https://github.com/SlaunchaMan/GCDWebServer.git",
-    //   .revision("935e2736044e71e5341663c3cc9a335ba6867a2b")
-    // ),
+      revision: "c5eeaa6dde7c308a5ce48ae4d4530462dd3a1110"
+    ),
+    .package(
+      url: "https://github.com/firebase/leveldb.git",
+      "1.22.2" ..< "1.23.0"
+    ),
+    .package(
+      url: "https://github.com/SlaunchaMan/GCDWebServer.git",
+      revision: "935e2736044e71e5341663c3cc9a335ba6867a2b"
+    ),
   ],
   targets: [
     .target(
@@ -221,20 +209,20 @@ let package = Package(
         .linkedFramework("AppKit", .when(platforms: [.macOS])),
       ]
     ),
-    // .testTarget(
-    //   name: "CoreUnit",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "SharedTestUtilities",
-    //     "HeartbeatLoggingTestUtils",
-    //     .product(name: "OCMock", package: "OCMock"),
-    //   ],
-    //   path: "FirebaseCore/Tests/Unit",
-    //   exclude: ["Resources/GoogleService-Info.plist"],
-    //   cSettings: [
-    //     .headerSearchPath("../../.."),
-    //   ]
-    // ),
+    .testTarget(
+      name: "CoreUnit",
+      dependencies: [
+        "FirebaseCore",
+        "SharedTestUtilities",
+        "HeartbeatLoggingTestUtils",
+        .product(name: "OCMock", package: "ocmock"),
+      ],
+      path: "FirebaseCore/Tests/Unit",
+      exclude: ["Resources/GoogleService-Info.plist"],
+      cSettings: [
+        .headerSearchPath("../../.."),
+      ]
+    ),
 
     // MARK: - Firebase Core Extension
 
@@ -265,179 +253,191 @@ let package = Package(
       dependencies: ["FirebaseCoreInternal"],
       path: "HeartbeatLoggingTestUtils/Sources"
     ),
-    // .testTarget(
-    //   name: "FirebaseCoreInternalTests",
-    //   dependencies: [
-    //     "FirebaseCoreInternal",
-    //     "HeartbeatLoggingTestUtils",
-    //   ],
-    //   path: "FirebaseCore/Internal/Tests"
-    // ),
+    .testTarget(
+      name: "FirebaseCoreInternalTests",
+      dependencies: [
+        "FirebaseCoreInternal",
+        "HeartbeatLoggingTestUtils",
+      ],
+      path: "FirebaseCore/Internal/Tests"
+    ),
 
-    // .target(
-    //   name: "FirebaseABTesting",
-    //   dependencies: ["FirebaseCore"],
-    //   path: "FirebaseABTesting/Sources",
-    //   publicHeadersPath: "Public",
-    //   cSettings: [
-    //     .headerSearchPath("../../"),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "ABTestingUnit",
-    //   dependencies: ["FirebaseABTesting", .product(name: "OCMock", package: "OCMock")],
-    //   path: "FirebaseABTesting/Tests/Unit",
-    //   resources: [.process("Resources")],
-    //   cSettings: [
-    //     .headerSearchPath("../../.."),
-    //   ]
-    // ),
+    .target(
+      name: "FirebaseABTesting",
+      dependencies: ["FirebaseCore"],
+      path: "FirebaseABTesting/Sources",
+      publicHeadersPath: "Public",
+      cSettings: [
+        .headerSearchPath("../../"),
+      ]
+    ),
+    .testTarget(
+      name: "ABTestingUnit",
+      dependencies: ["FirebaseABTesting", .product(name: "OCMock", package: "ocmock")],
+      path: "FirebaseABTesting/Tests/Unit",
+      resources: [.process("Resources")],
+      cSettings: [
+        .headerSearchPath("../../.."),
+      ]
+    ),
 
-    // .target(
-    //   name: "FirebaseAnalyticsTarget",
-    //   dependencies: [.target(name: "FirebaseAnalyticsWrapper",
-    //                          condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
-    //   path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
-    // ),
+    .target(
+      name: "FirebaseAnalyticsTarget",
+      dependencies: [.target(name: "FirebaseAnalyticsWrapper",
+                             condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
+      path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
+    ),
 
-    // .target(
-    //   name: "FirebaseAnalyticsWrapper",
-    //   dependencies: [
-    //     .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
-    //     .product(name: "GoogleAppMeasurement",
-    //              package: "GoogleAppMeasurement",
-    //              condition: .when(platforms: [.iOS, .macOS, .tvOS])),
-    //     "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: "FirebaseAnalyticsWrapper",
-    //   linkerSettings: [
-    //     .linkedLibrary("sqlite3"),
-    //     .linkedLibrary("c++"),
-    //     .linkedLibrary("z"),
-    //     .linkedFramework("StoreKit"),
-    //   ]
-    // ),
-    // .binaryTarget(
-    //   name: "FirebaseAnalytics",
-    //   url: "https://dl.google.com/firebase/ios/swiftpm/10.1.0/FirebaseAnalytics.zip",
-    //   checksum: "c5429b2e293d7ab2ed2f291bd5edf13f7612b4b69c8261259f48a7b948fa824d"
-    // ),
-    // .target(
-    //   name: "FirebaseAnalyticsSwiftTarget",
-    //   dependencies: [.target(name: "FirebaseAnalyticsSwift",
-    //                          condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
-    //   path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
-    // ),
-    // .target(
-    //   name: "FirebaseAnalyticsSwift",
-    //   dependencies: ["FirebaseAnalyticsWrapper"],
-    //   path: "FirebaseAnalyticsSwift/Sources"
-    // ),
+    .target(
+      name: "FirebaseAnalyticsWrapper",
+      dependencies: [
+        .target(
+          name: "FirebaseAnalytics",
+          condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
+        ),
+        .product(name: "GoogleAppMeasurement",
+                 package: "GoogleAppMeasurement",
+                 condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
+        "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: "FirebaseAnalyticsWrapper",
+      linkerSettings: [
+        .linkedLibrary("sqlite3"),
+        .linkedLibrary("c++"),
+        .linkedLibrary("z"),
+        .linkedFramework("StoreKit"),
+      ]
+    ),
+    .binaryTarget(
+      name: "FirebaseAnalytics",
+      url: "https://dl.google.com/firebase/ios/swiftpm/10.9.0/FirebaseAnalytics.zip",
+      checksum: "b0a16eef8caf30eadc496ab24fef5216798c8ec360addb6af53806957950c300"
+    ),
+    .target(
+      name: "FirebaseAnalyticsSwiftTarget",
+      dependencies: [.target(name: "FirebaseAnalyticsSwift",
+                             condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
+      path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
+    ),
+    .target(
+      name: "FirebaseAnalyticsSwift",
+      dependencies: ["FirebaseAnalyticsWrapper"],
+      path: "FirebaseAnalyticsSwift/Sources"
+    ),
+    .testTarget(
+      name: "AnalyticsSwiftUnit",
+      dependencies: ["FirebaseAnalyticsSwift"],
+      path: "FirebaseAnalyticsSwift/Tests/SwiftUnit"
+    ),
+    .testTarget(
+      name: "AnalyticsObjCAPI",
+      dependencies: ["FirebaseAnalyticsSwift"],
+      path: "FirebaseAnalyticsSwift/Tests/ObjCAPI"
+    ),
 
-    // .target(
-    //   name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
-    //   dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
-    //                          condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
-    //   path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
-    // ),
-    // .target(
-    //   name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
-    //   dependencies: [
-    //     .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
-    //     .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: "FirebaseAnalyticsWithoutAdIdSupportTarget",
+      dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
+                             condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
+      path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
+    ),
+    .target(
+      name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
+      dependencies: [
+        .target(
+          name: "FirebaseAnalytics",
+          condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
+        ),
+        .product(name: "GoogleAppMeasurementWithoutAdIdSupport",
+                 package: "GoogleAppMeasurement",
+                 condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
+        "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: "FirebaseAnalyticsOnDeviceConversionTarget",
-    //   dependencies: [
-    //     .product(name: "GoogleAppMeasurementOnDeviceConversion",
-    //              package: "GoogleAppMeasurement",
-    //              condition: .when(platforms: [.iOS])),
-    //   ],
-    //   path: "FirebaseAnalyticsOnDeviceConversionWrapper",
-    //   linkerSettings: [
-    //     .linkedLibrary("c++"),
-    //   ]
-    // ),
+    .target(
+      name: "FirebaseAnalyticsOnDeviceConversionTarget",
+      dependencies: [
+        .product(name: "GoogleAppMeasurementOnDeviceConversion",
+                 package: "GoogleAppMeasurement",
+                 condition: .when(platforms: [.iOS])),
+      ],
+      path: "FirebaseAnalyticsOnDeviceConversionWrapper",
+      linkerSettings: [
+        .linkedLibrary("c++"),
+      ]
+    ),
 
-    // .target(
-    //   name: "FirebaseAppDistributionTarget",
-    //   dependencies: [.target(name: "FirebaseAppDistribution",
-    //                          condition: .when(platforms: [.iOS]))],
-    //   path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
-    // ),
-    // .target(
-    //   name: "FirebaseAppDistribution",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "FirebaseInstallations",
-    //     .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
-    //     .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
-    //     .product(name: "GULUserDefaults", package: "GoogleUtilities"),
-    //   ],
-    //   path: "FirebaseAppDistribution/Sources",
-    //   publicHeadersPath: "Public",
-    //   cSettings: [
-    //     .headerSearchPath("../../"),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "AppDistributionUnit",
-    //   dependencies: ["FirebaseAppDistribution", .product(name: "OCMock", package: "OCMock")],
-    //   path: "FirebaseAppDistribution/Tests/Unit",
-    //   exclude: ["Swift/"],
-    //   resources: [.process("Resources")],
-    //   cSettings: [
-    //     .headerSearchPath("../../.."),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "AppDistributionUnitSwift",
-    //   dependencies: ["FirebaseAppDistribution"],
-    //   path: "FirebaseAppDistribution/Tests/Unit/Swift",
-    //   cSettings: [
-    //     .headerSearchPath("../../../.."),
-    //   ]
-    // ),
+    .target(
+      name: "FirebaseAppDistributionTarget",
+      dependencies: [.target(name: "FirebaseAppDistribution",
+                             condition: .when(platforms: [.iOS]))],
+      path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
+    ),
+    .target(
+      name: "FirebaseAppDistribution",
+      dependencies: [
+        "FirebaseCore",
+        "FirebaseInstallations",
+        .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
+        .product(name: "GULUserDefaults", package: "GoogleUtilities"),
+      ],
+      path: "FirebaseAppDistribution/Sources",
+      publicHeadersPath: "Public",
+      cSettings: [
+        .headerSearchPath("../../"),
+      ]
+    ),
+    .testTarget(
+      name: "AppDistributionUnit",
+      dependencies: ["FirebaseAppDistribution", .product(name: "OCMock", package: "ocmock")],
+      path: "FirebaseAppDistribution/Tests/Unit",
+      exclude: ["Swift/"],
+      resources: [.process("Resources")],
+      cSettings: [
+        .headerSearchPath("../../.."),
+      ]
+    ),
+    .testTarget(
+      name: "AppDistributionUnitSwift",
+      dependencies: ["FirebaseAppDistribution"],
+      path: "FirebaseAppDistribution/Tests/Unit/Swift",
+      cSettings: [
+        .headerSearchPath("../../../.."),
+      ]
+    ),
 
     .target(
       name: "FirebaseAuth",
       dependencies: [
         "FirebaseAppCheckInterop",
+        "FirebaseAuthInterop",
         "FirebaseCore",
         "FirebaseCoreExtension",
         .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
         .product(name: "GULEnvironment", package: "GoogleUtilities"),
         .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
       ],
-      path: "FirebaseAuth/Sources",
-      publicHeadersPath: "Public",
-      cSettings: [
-        .headerSearchPath("../../"),
-      ],
+      path: "FirebaseAuth/Sources/Swift",
       linkerSettings: [
         .linkedFramework("Security"),
         .linkedFramework("SafariServices", .when(platforms: [.iOS])),
@@ -460,887 +460,862 @@ let package = Package(
       dependencies: [
         "FirebaseAuth",
         "HeartbeatLoggingTestUtils",
-        .product(name: "OCMock", package: "ocmock"),
       ],
       path: "FirebaseAuth/Tests/Unit",
       exclude: [
         "AuthKeychainServicesTests.swift", // TODO: figure out SPM keychain testing
-        //  "AuthTests.swift",
+        "AuthTests.swift",
+        "UserTests.swift",
+        "AuthUseUserAccessGroupTests.swift",
+      ]
+    ),
+    .target(
+      name: "FirebaseAuthCombineSwift",
+      dependencies: ["FirebaseAuth"],
+      path: "FirebaseCombineSwift/Sources/Auth"
+    ),
+    .target(
+      name: "FirebaseFirestoreCombineSwift",
+      dependencies: [
+        "FirebaseFirestoreTarget",
+        "FirebaseFirestoreSwift",
+      ],
+      path: "FirebaseCombineSwift/Sources/Firestore"
+    ),
+    .target(
+      name: "FirebaseStorageCombineSwift",
+      dependencies: [
+        "FirebaseStorage",
+      ],
+      path: "FirebaseCombineSwift/Sources/Storage"
+    ),
+    .target(
+      name: "FirebaseCrashlytics",
+      dependencies: ["FirebaseCore", "FirebaseInstallations", "FirebaseSessions",
+                     .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
+                     .product(name: "GULEnvironment", package: "GoogleUtilities"),
+                     .product(name: "FBLPromises", package: "Promises"),
+                     .product(name: "nanopb", package: "nanopb")],
+      path: "Crashlytics",
+      exclude: [
+        "run",
+        "CHANGELOG.md",
+        "LICENSE",
+        "README.md",
+        "ProtoSupport/",
+        "UnitTests/",
+        "generate_project.sh",
+        "upload-symbols",
+        "third_party/libunwind/LICENSE",
       ],
+      sources: [
+        "Crashlytics/",
+        "Protogen/",
+        "Shared/",
+        "third_party/libunwind/dwarf.h",
+      ],
+      publicHeadersPath: "Crashlytics/Public",
       cSettings: [
-        .headerSearchPath("../../.."),
+        .headerSearchPath(".."),
+        .define("DISPLAY_VERSION", to: firebaseVersion),
+        .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
+        .define(
+          "CLS_SDK_NAME",
+          to: "Crashlytics macOS SDK",
+          .when(platforms: [.macOS, .macCatalyst])
+        ),
+        .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
+        .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
+        .define("PB_FIELD_32BIT", to: "1"),
+        .define("PB_NO_PACKED_STRUCTS", to: "1"),
+        .define("PB_ENABLE_MALLOC", to: "1"),
+      ],
+      linkerSettings: [
+        .linkedFramework("Security"),
+        .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
+      ]
+    ),
+    .testTarget(
+      name: "FirebaseCrashlyticsUnit",
+      dependencies: ["FirebaseCrashlytics", .product(name: "OCMock", package: "ocmock")],
+      path: "Crashlytics/UnitTests",
+      resources: [
+        .copy("FIRCLSMachO/machO_data"),
+        .copy("Data"),
+      ],
+      cSettings: [
+        .headerSearchPath("../.."),
+        .define("DISPLAY_VERSION", to: firebaseVersion),
+        .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
+        .define(
+          "CLS_SDK_NAME",
+          to: "Crashlytics macOS SDK",
+          .when(platforms: [.macOS, .macCatalyst])
+        ),
+        .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
+        .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
       ]
     ),
-    // .target(
-    //   name: "FirebaseAuthCombineSwift",
-    //   dependencies: ["FirebaseAuth"],
-    //   path: "FirebaseCombineSwift/Sources/Auth"
-    // ),
-    // .target(
-    //   name: "FirebaseFirestoreCombineSwift",
-    //   dependencies: [
-    //     "FirebaseFirestore",
-    //     "FirebaseFirestoreSwift",
-    //   ],
-    //   path: "FirebaseCombineSwift/Sources/Firestore"
-    // ),
-    // .target(
-    //   name: "FirebaseStorageCombineSwift",
-    //   dependencies: [
-    //     "FirebaseStorage",
-    //   ],
-    //   path: "FirebaseCombineSwift/Sources/Storage"
-    // ),
-    // .target(
-    //   name: "FirebaseCrashlytics",
-    //   dependencies: ["FirebaseCore", "FirebaseInstallations",
-    //                  .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
-    //                  .product(name: "GULEnvironment", package: "GoogleUtilities"),
-    //                  .product(name: "FBLPromises", package: "Promises"),
-    //                  .product(name: "nanopb", package: "nanopb")],
-    //   path: "Crashlytics",
-    //   exclude: [
-    //     "run",
-    //     "CHANGELOG.md",
-    //     "LICENSE",
-    //     "README.md",
-    //     "ProtoSupport/",
-    //     "UnitTests/",
-    //     "generate_project.sh",
-    //     "upload-symbols",
-    //     "third_party/libunwind/LICENSE",
-    //   ],
-    //   sources: [
-    //     "Crashlytics/",
-    //     "Protogen/",
-    //     "Shared/",
-    //     "third_party/libunwind/dwarf.h",
-    //   ],
-    //   publicHeadersPath: "Crashlytics/Public",
-    //   cSettings: [
-    //     .headerSearchPath(".."),
-    //     .define("DISPLAY_VERSION", to: firebaseVersion),
-    //     .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
-    //     .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: [.macOS])),
-    //     .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
-    //     .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
-    //     .define("PB_FIELD_32BIT", to: "1"),
-    //     .define("PB_NO_PACKED_STRUCTS", to: "1"),
-    //     .define("PB_ENABLE_MALLOC", to: "1"),
-    //   ],
-    //   linkerSettings: [
-    //     .linkedFramework("Security"),
-    //     .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
-    //   ]
-    // ),
-    // // .testTarget(
-    // //   name: "FirebaseCrashlyticsUnit",
-    // //   dependencies: ["FirebaseCrashlytics", "OCMock"],
-    // //   path: "Crashlytics/UnitTests",
-    // //   resources: [
-    // //     .process("FIRCLSMachO/data"),
-    // //     .copy("Data"),
-    // //   ],
-    // //   cSettings: [
-    // //     .headerSearchPath("../.."),
-    // //     .define("DISPLAY_VERSION", to: firebaseVersion),
-    // //     .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
-    // //     .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: [.macOS])),
-    // //     .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
-    // //     .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
-    // //   ]
-    // // ),
-    // .target(
-    //   name: "FirebaseDatabase",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "leveldb",
-    //   ],
-    //   path: "FirebaseDatabase/Sources",
-    //   exclude: [
-    //     "third_party/Wrap-leveldb/LICENSE",
-    //     "third_party/SocketRocket/LICENSE",
-    //     "third_party/FImmutableSortedDictionary/LICENSE",
-    //     "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
-    //   ],
-    //   publicHeadersPath: "Public",
-    //   cSettings: [
-    //     .headerSearchPath("../../"),
-    //   ],
-    //   linkerSettings: [
-    //     .linkedFramework("CFNetwork"),
-    //     .linkedFramework("Security"),
-    //     .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
-    //     .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "DatabaseUnit",
-    //   dependencies: ["FirebaseDatabase", .product(name: "OCMock", package: "OCMock"), "SharedTestUtilities"],
-    //   path: "FirebaseDatabase/Tests/",
-    //   exclude: [
-    //     // Disable Swift tests as mixed targets are not supported (Xcode 12.4).
-    //     "Unit/Swift",
-    //     "Integration/",
-    //   ],
-    //   resources: [.process("Resources")],
-    //   cSettings: [
-    //     .headerSearchPath("../.."),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "DatabaseUnitSwift",
-    //   dependencies: ["FirebaseDatabase"],
-    //   path: "FirebaseDatabase/Tests/Unit/Swift",
-    //   cSettings: [
-    //     .headerSearchPath("../.."),
-    //   ]
-    // ),
-    // .target(
-    //   name: "FirebaseDatabaseSwift",
-    //   dependencies: ["FirebaseDatabase", "FirebaseSharedSwift"],
-    //   path: "FirebaseDatabaseSwift/Sources"
-    // ),
-    // .testTarget(
-    //   name: "FirebaseDatabaseSwiftTests",
-    //   dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
-    //   path: "FirebaseDatabaseSwift/Tests/"
-    // ),
-    // .target(
-    //   name: "FirebaseSharedSwift",
-    //   path: "FirebaseSharedSwift/Sources",
-    //   exclude: [
-    //     "third_party/FirebaseDataEncoder/LICENSE",
-    //     "third_party/FirebaseDataEncoder/METADATA",
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "FirebaseSharedSwiftTests",
-    //   dependencies: ["FirebaseSharedSwift"],
-    //   path: "FirebaseSharedSwift/Tests/"
-    // ),
-    // .target(
-    //   name: "FirebaseDynamicLinksTarget",
-    //   dependencies: [.target(name: "FirebaseDynamicLinks",
-    //                          condition: .when(platforms: [.iOS]))],
-    //   path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
-    // ),
-
-    // .target(
-    //   name: "FirebaseDynamicLinks",
-    //   dependencies: ["FirebaseCore"],
-    //   path: "FirebaseDynamicLinks/Sources",
-    //   publicHeadersPath: "Public",
-    //   cSettings: [
-    //     .headerSearchPath("../../"),
-    //     .define("FIRDynamicLinks3P", to: "1"),
-    //     .define("GIN_SCION_LOGGING", to: "1"),
-    //   ],
-    //   linkerSettings: [
-    //     .linkedFramework("QuartzCore"),
-    //   ]
-    // ),
-
-    // .target(
-    //   name: "FirebaseFirestoreTarget",
-    //   dependencies: [.target(name: "FirebaseFirestore",
-    //                          condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
-    //   path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
-    // ),
-
-    // .target(
-    //   name: "FirebaseFirestore",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "leveldb",
-    //     .product(name: "nanopb", package: "nanopb"),
-    //     .product(name: "abseil", package: "abseil"),
-    //     .product(name: "gRPC-cpp", package: "gRPC"),
-    //   ],
-    //   path: "Firestore",
-    //   exclude: [
-    //     "CHANGELOG.md",
-    //     "CMakeLists.txt",
-    //     "Example/",
-    //     "LICENSE",
-    //     "Protos/CMakeLists.txt",
-    //     "Protos/Podfile",
-    //     "Protos/README.md",
-    //     "Protos/build_protos.py",
-    //     "Protos/cpp/",
-    //     "Protos/lib/",
-    //     "Protos/nanopb_cpp_generator.py",
-    //     "Protos/protos/",
-    //     "README.md",
-    //     "Source/CMakeLists.txt",
-    //     "Swift/",
-    //     "core/CMakeLists.txt",
-    //     "core/src/util/config_detected.h.in",
-    //     "core/test/",
-    //     "fuzzing/",
-    //     "test.sh",
-    //     // Swift PM doesn't recognize hpp files, so we're relying on search paths
-    //     // to find third_party/nlohmann_json/json.hpp.
-    //     "third_party/",
-
-    //     // Exclude alternate implementations for other platforms
-    //     "core/src/remote/connectivity_monitor_noop.cc",
-    //     "core/src/util/filesystem_win.cc",
-    //     "core/src/util/log_stdio.cc",
-    //     "core/src/util/secure_random_openssl.cc",
-    //   ],
-    //   sources: [
-    //     "Source/",
-    //     "Protos/nanopb/",
-    //     "core/include/",
-    //     "core/src",
-    //   ],
-    //   publicHeadersPath: "Source/Public",
-    //   cSettings: [
-    //     .headerSearchPath("../"),
-    //     .headerSearchPath("Source/Public/FirebaseFirestore"),
-    //     .headerSearchPath("Protos/nanopb"),
-    //     .define("PB_FIELD_32BIT", to: "1"),
-    //     .define("PB_NO_PACKED_STRUCTS", to: "1"),
-    //     .define("PB_ENABLE_MALLOC", to: "1"),
-    //     .define("FIRFirestore_VERSION", to: firebaseVersion),
-    //   ],
-    //   linkerSettings: [
-    //     .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
-    //     .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
-    //     .linkedLibrary("c++"),
-    //   ]
-    // ),
-
-    // .target(
-    //   name: "FirebaseFirestoreSwiftTarget",
-    //   dependencies: [.target(name: "FirebaseFirestoreSwift",
-    //                          condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
-    //   path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
-    // ),
-
-    // .target(
-    //   name: "FirebaseFirestoreSwift",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "FirebaseCoreExtension",
-    //     "FirebaseFirestore",
-    //     "FirebaseSharedSwift",
-    //   ],
-    //   path: "Firestore",
-    //   exclude: [
-    //     "CHANGELOG.md",
-    //     "CMakeLists.txt",
-    //     "Example/",
-    //     "LICENSE",
-    //     "Protos/",
-    //     "README.md",
-    //     "Source/",
-    //     "core/",
-    //     "fuzzing/",
-    //     "test.sh",
-    //     "Swift/CHANGELOG.md",
-    //     "Swift/README.md",
-    //     "Swift/Tests/",
-    //     "third_party/nlohmann_json",
-    //   ],
-    //   sources: [
-    //     "Swift/Source/",
-    //   ]
-    // ),
-
-    // // MARK: - Firebase Functions
-
-    // .target(
-    //   name: "FirebaseFunctions",
-    //   dependencies: [
-    //     "FirebaseAppCheckInterop",
-    //     "FirebaseAuthInterop",
-    //     "FirebaseCore",
-    //     "FirebaseCoreExtension",
-    //     "FirebaseMessagingInterop",
-    //     "FirebaseSharedSwift",
-    //     .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
-    //   ],
-    //   path: "FirebaseFunctions/Sources"
-    // ),
-    // .testTarget(
-    //   name: "FirebaseFunctionsUnit",
-    //   dependencies: ["FirebaseFunctions",
-    //                  "FirebaseAppCheckInterop",
-    //                  "FirebaseAuthInterop",
-    //                  "FirebaseMessagingInterop",
-    //                  "SharedTestUtilities"],
-    //   path: "FirebaseFunctions/Tests/Unit",
-    //   cSettings: [
-    //     .headerSearchPath("../../../"),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "FirebaseFunctionsIntegration",
-    //   dependencies: ["FirebaseFunctions",
-    //                  "SharedTestUtilities"],
-    //   path: "FirebaseFunctions/Tests/Integration"
-    // ),
-    // .testTarget(
-    //   name: "FirebaseFunctionsObjCIntegration",
-    //   dependencies: ["FirebaseFunctions",
-    //                  "SharedTestUtilities"],
-    //   path: "FirebaseFunctions/Tests/ObjCIntegration",
-    //   // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
-    //   exclude: [
-    //     "ObjCPPAPITests.mm",
-    //   ],
-    //   cSettings: [
-    //     .headerSearchPath("../../.."),
-    //   ]
-    // ),
-    // .target(
-    //   name: "FirebaseFunctionsCombineSwift",
-    //   dependencies: ["FirebaseFunctions"],
-    //   path: "FirebaseCombineSwift/Sources/Functions"
-    // ),
-    // .testTarget(
-    //   name: "FunctionsCombineUnit",
-    //   dependencies: ["FirebaseFunctionsCombineSwift",
-    //                  "SharedTestUtilities"],
-    //   path: "FirebaseFunctions/Tests/CombineUnit"
-    // ),
-
-    // // MARK: - Firebase In App Messaging
-
-    // .target(
-    //   name: "FirebaseInAppMessagingTarget",
-    //   dependencies: [
-    //     .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
-    //   ],
-    //   path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
-    // ),
-
-    // .target(
-    //   name: "FirebaseInAppMessaging",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "FirebaseInstallations",
-    //     "FirebaseABTesting",
-    //     .product(name: "GULEnvironment", package: "GoogleUtilities"),
-    //     .product(name: "nanopb", package: "nanopb"),
-    //     .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
-    //   ],
-    //   path: "FirebaseInAppMessaging/Sources",
-    //   exclude: [
-    //     "DefaultUI/CHANGELOG.md",
-    //     "DefaultUI/README.md",
-    //   ],
-    //   publicHeadersPath: "Public",
-    //   cSettings: [
-    //     .headerSearchPath("../../"),
-    //     .define("PB_FIELD_32BIT", to: "1"),
-    //     .define("PB_NO_PACKED_STRUCTS", to: "1"),
-    //     .define("PB_ENABLE_MALLOC", to: "1"),
-    //   ]
-    // ),
-
-    // .target(
-    //   name: "FirebaseInAppMessaging_iOS",
-    //   path: "FirebaseInAppMessaging/iOS",
-    //   resources: [.process("Resources")]
-    // ),
-
-    // .target(
-    //   name: "FirebaseInAppMessagingSwift",
-    //   dependencies: ["FirebaseInAppMessaging"],
-    //   path: "FirebaseInAppMessaging/Swift/Source"
-    // ),
-
-    // .target(
-    //   name: "FirebaseInstallations",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     .product(name: "FBLPromises", package: "Promises"),
-    //     .product(name: "GULEnvironment", package: "GoogleUtilities"),
-    //     .product(name: "GULUserDefaults", package: "GoogleUtilities"),
-    //   ],
-    //   path: "FirebaseInstallations/Source/Library",
-    //   publicHeadersPath: "Public",
-    //   cSettings: [
-    //     .headerSearchPath("../../../"),
-    //   ],
-    //   linkerSettings: [
-    //     .linkedFramework("Security"),
-    //   ]
-    // ),
-
-    // .target(
-    //   name: "FirebaseMLModelDownloader",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "FirebaseInstallations",
-    //     .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
-    //     .product(name: "GULLogger", package: "GoogleUtilities"),
-    //     "SwiftProtobuf",
-    //   ],
-    //   path: "FirebaseMLModelDownloader/Sources",
-    //   exclude: [
-    //     "proto/firebase_ml_log_sdk.proto",
-    //   ],
-    //   cSettings: [
-    //     .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "FirebaseMLModelDownloaderUnit",
-    //   dependencies: ["FirebaseMLModelDownloader"],
-    //   path: "FirebaseMLModelDownloader/Tests/Unit"
-    // ),
-
-    // .target(
-    //   name: "FirebaseMessaging",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "FirebaseInstallations",
-    //     .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
-    //     .product(name: "GULEnvironment", package: "GoogleUtilities"),
-    //     .product(name: "GULReachability", package: "GoogleUtilities"),
-    //     .product(name: "GULUserDefaults", package: "GoogleUtilities"),
-    //     .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
-    //     .product(name: "nanopb", package: "nanopb"),
-    //   ],
-    //   path: "FirebaseMessaging/Sources",
-    //   publicHeadersPath: "Public",
-    //   cSettings: [
-    //     .headerSearchPath("../../"),
-    //     .define("PB_FIELD_32BIT", to: "1"),
-    //     .define("PB_NO_PACKED_STRUCTS", to: "1"),
-    //     .define("PB_ENABLE_MALLOC", to: "1"),
-    //   ],
-    //   linkerSettings: [
-    //     .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
-    //   ]
-    // ),
-    // // Internal headers only for consuming from Swift.
-    // .target(
-    //   name: "FirebaseMessagingInterop",
-    //   path: "FirebaseMessaging/Interop",
-    //   publicHeadersPath: ".",
-    //   cSettings: [
-    //     .headerSearchPath("../../"),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "MessagingUnit",
-    //   dependencies: ["FirebaseMessaging", "SharedTestUtilities", .product(name: "OCMock", package: "OCMock")],
-    //   path: "FirebaseMessaging/Tests/UnitTests",
-    //   exclude: [
-    //     "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
-    //   ],
-    //   cSettings: [
-    //     .headerSearchPath("../../.."),
-    //   ]
-    // ),
-
-    // .target(
-    //   name: "FirebasePerformanceTarget",
-    //   dependencies: [.target(name: "FirebasePerformance",
-    //                          condition: .when(platforms: [.iOS, .tvOS]))],
-    //   path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
-    // ),
-    // .target(
-    //   name: "FirebasePerformance",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "FirebaseInstallations",
-    //     "FirebaseRemoteConfig",
-    //     .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
-    //     .product(name: "GULEnvironment", package: "GoogleUtilities"),
-    //     .product(name: "GULISASwizzler", package: "GoogleUtilities"),
-    //     .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
-    //     .product(name: "GULUserDefaults", package: "GoogleUtilities"),
-    //     .product(name: "nanopb", package: "nanopb"),
-    //   ],
-    //   path: "FirebasePerformance/Sources",
-    //   publicHeadersPath: "Public",
-    //   cSettings: [
-    //     .headerSearchPath("../../"),
-    //     .define("PB_FIELD_32BIT", to: "1"),
-    //     .define("PB_NO_PACKED_STRUCTS", to: "1"),
-    //     .define("PB_ENABLE_MALLOC", to: "1"),
-    //     .define("FIRPerformance_LIB_VERSION", to: firebaseVersion),
-    //   ],
-    //   linkerSettings: [
-    //     .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .tvOS])),
-    //     .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .tvOS])),
-    //     .linkedFramework("QuartzCore", .when(platforms: [.iOS, .tvOS])),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "PerformanceUnit",
-    //   dependencies: [
-    //     "FirebasePerformanceTarget",
-    //     .product(name: "OCMock", package: "OCMock"),
-    //     "SharedTestUtilities",
-    //     .product(name: "GCDWebServer", package: "GCDWebServer"),
-    //   ],
-    //   path: "FirebasePerformance/Tests/Unit",
-    //   resources: [
-    //     .process("FPRURLFilterTests-Info.plist"),
-    //     .process("Server/smallDownloadFile"),
-    //     .process("Server/bigDownloadFile"),
-    //   ],
-    //   cSettings: [
-    //     .headerSearchPath("../../.."),
-    //     .define("PB_FIELD_32BIT", to: "1"),
-    //     .define("PB_NO_PACKED_STRUCTS", to: "1"),
-    //     .define("PB_ENABLE_MALLOC", to: "1"),
-    //   ]
-    // ),
-
-    // .target(
-    //   name: "SharedTestUtilities",
-    //   dependencies: ["FirebaseCore",
-    //                  "FirebaseAppCheckInterop",
-    //                  "FirebaseAuthInterop",
-    //                  "FirebaseMessagingInterop",
-    //                  .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
-    //                  .product(name: "OCMock", package: "OCMock"),
-    //                  ],
-    //   path: "SharedTestUtilities",
-    //   publicHeadersPath: "./",
-    //   cSettings: [
-    //     .headerSearchPath("../"),
-    //   ]
-    // ),
-
-    // // MARK: - Firebase Remote Config
-
-    // .target(
-    //   name: "FirebaseRemoteConfig",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "FirebaseABTesting",
-    //     "FirebaseInstallations",
-    //     .product(name: "GULNSData", package: "GoogleUtilities"),
-    //   ],
-    //   path: "FirebaseRemoteConfig/Sources",
-    //   publicHeadersPath: "Public",
-    //   cSettings: [
-    //     .headerSearchPath("../../"),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "RemoteConfigUnit",
-    //   dependencies: ["FirebaseRemoteConfig", .product(name: "OCMock", package: "OCMock")],
-    //   path: "FirebaseRemoteConfig/Tests/Unit",
-    //   exclude: [
-    //     // Need to be evaluated/ported to RC V2.
-    //     "RCNConfigAnalyticsTest.m",
-    //     "RCNConfigSettingsTest.m",
-    //     "RCNConfigTest.m",
-    //     "RCNRemoteConfig+FIRAppTest.m",
-    //     "RCNThrottlingTests.m",
-    //   ],
-    //   resources: [
-    //     .process("SecondApp-GoogleService-Info.plist"),
-    //     .process("Defaults-testInfo.plist"),
-    //     .process("TestABTPayload.txt"),
-    //   ],
-    //   cSettings: [
-    //     .headerSearchPath("../../.."),
-    //   ]
-    // ),
-    // .target(
-    //   name: "FirebaseRemoteConfigSwift",
-    //   dependencies: [
-    //     "FirebaseRemoteConfig",
-    //     "FirebaseSharedSwift",
-    //   ],
-    //   path: "FirebaseRemoteConfigSwift/Sources"
-    // ),
-    // .testTarget(
-    //   name: "RemoteConfigFakeConsole",
-    //   dependencies: ["FirebaseRemoteConfigSwift",
-    //                  "RemoteConfigFakeConsoleObjC"],
-    //   path: "FirebaseRemoteConfigSwift/Tests",
-    //   exclude: [
-    //     "AccessToken.json",
-    //     "README.md",
-    //     "ObjC/",
-    //   ],
-    //   resources: [
-    //     .process("Defaults-testInfo.plist"),
-    //   ],
-    //   cSettings: [
-    //     .headerSearchPath("../../"),
-    //   ]
-    // ),
-    // .target(
-    //   name: "RemoteConfigFakeConsoleObjC",
-    //   dependencies: [.product(name: "OCMock", package: "OCMock")],
-    //   path: "FirebaseRemoteConfigSwift/Tests/ObjC",
-    //   publicHeadersPath: ".",
-    //   cSettings: [
-    //     .headerSearchPath("../../../"),
-    //   ]
-    // ),
-
-    // // MARK: - Firebase Sessions
-
-    // .target(
-    //   name: "FirebaseSessions",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //     "FirebaseInstallations",
-    //     "FirebaseCoreExtension",
-    //     "FirebaseSessionsObjC",
-    //     .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
-    //     .product(name: "GULEnvironment", package: "GoogleUtilities"),
-    //   ],
-    //   path: "FirebaseSessions/Sources",
-    //   cSettings: [
-    //     .headerSearchPath(".."),
-    //     .define("DISPLAY_VERSION", to: firebaseVersion),
-    //     .define("PB_FIELD_32BIT", to: "1"),
-    //     .define("PB_NO_PACKED_STRUCTS", to: "1"),
-    //     .define("PB_ENABLE_MALLOC", to: "1"),
-    //   ],
-    //   linkerSettings: [
-    //     .linkedFramework("Security"),
-    //     .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
-    //   ]
-    // ),
-    // // The Sessions SDK is Swift-first with Objective-C code to support
-    // // nanopb. Because Swift Package Manager doesn't support mixed
-    // // language targets, the ObjC code has been extracted out into
-    // // a separate target.
-    // .target(
-    //   name: "FirebaseSessionsObjC",
-    //   dependencies: [
-    //     .product(name: "GULEnvironment", package: "GoogleUtilities"),
-    //     .product(name: "nanopb", package: "nanopb"),
-    //   ],
-    //   path: "FirebaseSessions",
-    //   exclude: [
-    //     "README.md",
-    //     "Sources/",
-    //     "Tests/",
-    //     "ProtoSupport/",
-    //     "generate_project.sh",
-    //     "generate_protos.sh",
-    //     "generate_testapp.sh",
-    //   ],
-    //   publicHeadersPath: "SourcesObjC",
-    //   cSettings: [
-    //     .headerSearchPath(".."),
-    //     .define("DISPLAY_VERSION", to: firebaseVersion),
-    //     .define("PB_FIELD_32BIT", to: "1"),
-    //     .define("PB_NO_PACKED_STRUCTS", to: "1"),
-    //     .define("PB_ENABLE_MALLOC", to: "1"),
-    //   ],
-    //   linkerSettings: [
-    //     .linkedFramework("Security"),
-    //     .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "FirebaseSessionsUnit",
-    //   dependencies: ["FirebaseSessions"],
-    //   path: "FirebaseSessions/Tests/Unit"
-    // ),
-
-    // // MARK: - Firebase Storage
-
-    // .target(
-    //   name: "FirebaseStorage",
-    //   dependencies: [
-    //     "FirebaseAppCheckInterop",
-    //     "FirebaseAuthInterop",
-    //     "FirebaseCore",
-    //     "FirebaseCoreExtension",
-    //     .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
-    //   ],
-    //   path: "FirebaseStorage/Sources"
-    // ),
-    // .testTarget(
-    //   name: "FirebaseStorageUnit",
-    //   dependencies: ["FirebaseStorage",
-    //                  "SharedTestUtilities"],
-    //   path: "FirebaseStorage/Tests/Unit",
-    //   cSettings: [
-    //     .headerSearchPath("../../../"),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "StorageObjCIntegration",
-    //   dependencies: ["FirebaseStorage"],
-    //   path: "FirebaseStorage/Tests/ObjCIntegration",
-    //   exclude: [
-    //     // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
-    //     "FIRStorageIntegrationTests.m",
-    //     "ObjCPPAPITests.mm",
-    //     "Credentials.h",
-    //   ],
-    //   cSettings: [
-    //     .headerSearchPath("../../.."),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "swift-test",
-    //   dependencies: [
-    //     "Firebase",
-    //     "FirebaseAuth",
-    //     "FirebaseAppCheck",
-    //     "FirebaseABTesting",
-    //     "FirebaseAnalytics",
-    //     "FirebaseAnalyticsSwift",
-    //     .target(name: "FirebaseAppDistribution",
-    //             condition: .when(platforms: [.iOS])),
-    //     "FirebaseAuthCombineSwift",
-    //     "FirebaseFirestoreCombineSwift",
-    //     "FirebaseFunctionsCombineSwift",
-    //     "FirebaseStorageCombineSwift",
-    //     "FirebaseCrashlytics",
-    //     "FirebaseCore",
-    //     "FirebaseDatabase",
-    //     "FirebaseDynamicLinks",
-    //     "FirebaseFirestore",
-    //     "FirebaseFirestoreSwift",
-    //     "FirebaseFunctions",
-    //     "FirebaseInAppMessaging",
-    //     .target(name: "FirebaseInAppMessagingSwift",
-    //             condition: .when(platforms: [.iOS, .tvOS])),
-    //     "FirebaseInstallations",
-    //     "FirebaseMessaging",
-    //     .target(name: "FirebasePerformance",
-    //             condition: .when(platforms: [.iOS, .tvOS])),
-    //     "FirebaseRemoteConfig",
-    //     "FirebaseSessions",
-    //     "FirebaseStorage",
-    //     .product(name: "nanopb", package: "nanopb"),
-    //   ],
-    //   path: "SwiftPMTests/swift-test"
-    // ),
-    // .testTarget(
-    //   name: "analytics-import-test",
-    //   dependencies: [
-    //     "FirebaseAnalyticsSwiftTarget",
-    //     "FirebaseAnalyticsWrapper",
-    //     "Firebase",
-    //   ],
-    //   path: "SwiftPMTests/analytics-import-test"
-    // ),
-    // .testTarget(
-    //   name: "objc-import-test",
-    //   dependencies: [
-    //     "Firebase",
-    //     "FirebaseAuth",
-    //     "FirebaseABTesting",
-    //     "FirebaseAppCheck",
-    //     .target(name: "FirebaseAppDistribution",
-    //             condition: .when(platforms: [.iOS])),
-    //     "FirebaseCrashlytics",
-    //     "FirebaseCore",
-    //     "FirebaseDatabase",
-    //     "FirebaseDynamicLinks",
-    //     "FirebaseFirestore",
-    //     "FirebaseFunctions",
-    //     "FirebaseInAppMessaging",
-    //     "FirebaseInstallations",
-    //     "FirebaseMessaging",
-    //     .target(name: "FirebasePerformance",
-    //             condition: .when(platforms: [.iOS, .tvOS])),
-    //     "FirebaseRemoteConfig",
-    //     "FirebaseStorage",
-    //   ],
-    //   path: "SwiftPMTests/objc-import-test"
-    // ),
-    // .testTarget(
-    //   name: "version-test",
-    //   dependencies: [
-    //     "FirebaseCore",
-    //   ],
-    //   path: "SwiftPMTests/version-test",
-    //   cSettings: [
-    //     .define("FIR_VERSION", to: firebaseVersion),
-    //   ]
-    // ),
-
-    // // MARK: - Firebase App Check
-
-    // .target(name: "FirebaseAppCheck",
-    //         dependencies: [
-    //           "FirebaseCore",
-    //           .product(name: "FBLPromises", package: "Promises"),
-    //           .product(name: "GULEnvironment", package: "GoogleUtilities"),
-    //         ],
-    //         path: "FirebaseAppCheck/Sources",
-    //         publicHeadersPath: "Public",
-    //         cSettings: [
-    //           .headerSearchPath("../.."),
-    //         ],
-    //         linkerSettings: [
-    //           .linkedFramework("DeviceCheck", .when(platforms: [.iOS, .macOS, .tvOS])),
-    //         ]),
-    // // Internal headers only for consuming from Swift.
     .target(
-      name: "FirebaseAppCheckInterop",
-      path: "FirebaseAppCheck/Interop",
+      name: "FirebaseDatabase",
+      dependencies: [
+        "FirebaseCore",
+        "leveldb",
+      ],
+      path: "FirebaseDatabase/Sources",
       exclude: [
-        "CMakeLists.txt",
+        "third_party/Wrap-leveldb/LICENSE",
+        "third_party/SocketRocket/LICENSE",
+        "third_party/FImmutableSortedDictionary/LICENSE",
+        "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
       ],
-      publicHeadersPath: ".",
+      publicHeadersPath: "Public",
       cSettings: [
         .headerSearchPath("../../"),
+      ],
+      linkerSettings: [
+        .linkedFramework("CFNetwork"),
+        .linkedFramework("Security"),
+        .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
+        .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
       ]
     ),
-    // .testTarget(
-    //   name: "AppCheckUnit",
-    //   dependencies: [
-    //     "FirebaseAppCheck",
-    //     .product(name: "OCMock", package: "OCMock"),
-    //     "SharedTestUtilities",
-    //     "HeartbeatLoggingTestUtils",
-    //   ],
-    //   path: "FirebaseAppCheck/Tests",
-    //   exclude: [
-    //     // Disable Swift tests as mixed targets are not supported (Xcode 12.3).
-    //     "Unit/Swift",
-    //   ],
-    //   resources: [
-    //     .process("Fixture"),
-    //   ],
-    //   cSettings: [
-    //     .headerSearchPath("../.."),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "AppCheckUnitSwift",
-    //   dependencies: ["FirebaseAppCheck"],
-    //   path: "FirebaseAppCheck/Tests/Unit/Swift",
-    //   cSettings: [
-    //     .headerSearchPath("../.."),
-    //   ]
-    // ),
-
-    // // MARK: Testing support
+    .testTarget(
+      name: "DatabaseUnit",
+      dependencies: [
+        "FirebaseDatabase",
+        "SharedTestUtilities",
+        .product(name: "OCMock", package: "ocmock"),
+      ],
+      path: "FirebaseDatabase/Tests/",
+      exclude: [
+        // Disable Swift tests as mixed targets are not supported (Xcode 12.4).
+        "Unit/Swift",
+        "Integration/",
+      ],
+      resources: [.process("Resources")],
+      cSettings: [
+        .headerSearchPath("../.."),
+      ]
+    ),
+    .testTarget(
+      name: "DatabaseUnitSwift",
+      dependencies: ["FirebaseDatabase"],
+      path: "FirebaseDatabase/Tests/Unit/Swift",
+      cSettings: [
+        .headerSearchPath("../.."),
+      ]
+    ),
+    .target(
+      name: "FirebaseDatabaseSwift",
+      dependencies: ["FirebaseDatabase", "FirebaseSharedSwift"],
+      path: "FirebaseDatabaseSwift/Sources"
+    ),
+    .testTarget(
+      name: "FirebaseDatabaseSwiftTests",
+      dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
+      path: "FirebaseDatabaseSwift/Tests/"
+    ),
+    .target(
+      name: "FirebaseSharedSwift",
+      path: "FirebaseSharedSwift/Sources",
+      exclude: [
+        "third_party/FirebaseDataEncoder/LICENSE",
+        "third_party/FirebaseDataEncoder/METADATA",
+      ]
+    ),
+    .testTarget(
+      name: "FirebaseSharedSwiftTests",
+      dependencies: ["FirebaseSharedSwift"],
+      path: "FirebaseSharedSwift/Tests/"
+    ),
+    .target(
+      name: "FirebaseDynamicLinksTarget",
+      dependencies: [.target(name: "FirebaseDynamicLinks",
+                             condition: .when(platforms: [.iOS]))],
+      path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
+    ),
 
-    // .target(
-    //   name: "FirebaseFirestoreTestingSupport",
-    //   dependencies: ["FirebaseFirestore"],
-    //   path: "FirebaseTestingSupport/Firestore/Sources",
-    //   publicHeadersPath: "./",
-    //   cSettings: [
-    //     .headerSearchPath("../../.."),
-    //     .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
-    //   ]
-    // ),
-    // .testTarget(
-    //   name: "FirestoreTestingSupportTests",
-    //   dependencies: ["FirebaseFirestoreTestingSupport"],
-    //   path: "FirebaseTestingSupport/Firestore/Tests",
-    //   cSettings: [
-    //     .headerSearchPath("../../.."),
-    //   ]
-    // ),
+    .target(
+      name: "FirebaseDynamicLinks",
+      dependencies: ["FirebaseCore"],
+      path: "FirebaseDynamicLinks/Sources",
+      publicHeadersPath: "Public",
+      cSettings: [
+        .headerSearchPath("../../"),
+        .define("FIRDynamicLinks3P", to: "1"),
+        .define("GIN_SCION_LOGGING", to: "1"),
+      ],
+      linkerSettings: [
+        .linkedFramework("QuartzCore"),
+      ]
+    ),
+
+    .target(
+      name: "FirebaseFirestoreTarget",
+      dependencies: [
+        .target(
+          name: "FirebaseFirestore",
+          condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
+        ),
+        .product(name: "abseil", package: "abseil-cpp-binary"),
+        .product(name: "gRPC-C++", package: "grpc-binary"),
+        .product(name: "nanopb", package: "nanopb"),
+        "FirebaseCore",
+        "leveldb",
+      ],
+      path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
+    ),
+
+    .binaryTarget(
+      name: "FirebaseFirestore",
+      url: "https://dl.google.com/firebase/ios/bin/firestore/10.10.0/FirebaseFirestore.zip",
+      checksum: "bb362e131fda776d6911e553516439fe7d3744a213c6720ee9d58ebc5b6de789"
+    ),
+
+    .target(
+      name: "FirebaseFirestoreSwiftTarget",
+      dependencies: [.target(name: "FirebaseFirestoreSwift",
+                             condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS]))],
+      path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
+    ),
+
+    .target(
+      name: "FirebaseFirestoreSwift",
+      dependencies: [
+        "FirebaseCore",
+        "FirebaseCoreExtension",
+        "FirebaseFirestoreTarget",
+        "FirebaseSharedSwift",
+      ],
+      path: "Firestore",
+      exclude: [
+        "CHANGELOG.md",
+        "CMakeLists.txt",
+        "Example/",
+        "LICENSE",
+        "Protos/",
+        "README.md",
+        "Source/",
+        "core/",
+        "fuzzing/",
+        "test.sh",
+        "Swift/CHANGELOG.md",
+        "Swift/README.md",
+        "Swift/Tests/",
+        "third_party/nlohmann_json",
+      ],
+      sources: [
+        "Swift/Source/",
+      ]
+    ),
+
+    // MARK: - Firebase Functions
+
+    .target(
+      name: "FirebaseFunctions",
+      dependencies: [
+        "FirebaseAppCheckInterop",
+        "FirebaseAuthInterop",
+        "FirebaseCore",
+        "FirebaseCoreExtension",
+        "FirebaseMessagingInterop",
+        "FirebaseSharedSwift",
+        .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
+      ],
+      path: "FirebaseFunctions/Sources"
+    ),
+    .testTarget(
+      name: "FirebaseFunctionsUnit",
+      dependencies: ["FirebaseFunctions",
+                     "FirebaseAppCheckInterop",
+                     "FirebaseAuthInterop",
+                     "FirebaseMessagingInterop",
+                     "SharedTestUtilities"],
+      path: "FirebaseFunctions/Tests/Unit",
+      cSettings: [
+        .headerSearchPath("../../../"),
+      ]
+    ),
+    .testTarget(
+      name: "FirebaseFunctionsIntegration",
+      dependencies: ["FirebaseFunctions",
+                     "SharedTestUtilities"],
+      path: "FirebaseFunctions/Tests/Integration"
+    ),
+    .testTarget(
+      name: "FirebaseFunctionsObjCIntegration",
+      dependencies: ["FirebaseFunctions",
+                     "SharedTestUtilities"],
+      path: "FirebaseFunctions/Tests/ObjCIntegration",
+      // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
+      exclude: [
+        "ObjCPPAPITests.mm",
+      ],
+      cSettings: [
+        .headerSearchPath("../../.."),
+      ]
+    ),
+    .target(
+      name: "FirebaseFunctionsCombineSwift",
+      dependencies: ["FirebaseFunctions"],
+      path: "FirebaseCombineSwift/Sources/Functions"
+    ),
+    .testTarget(
+      name: "FunctionsCombineUnit",
+      dependencies: ["FirebaseFunctionsCombineSwift",
+                     "SharedTestUtilities"],
+      path: "FirebaseFunctions/Tests/CombineUnit"
+    ),
+
+    // MARK: - Firebase In App Messaging
+
+    .target(
+      name: "FirebaseInAppMessagingTarget",
+      dependencies: [
+        .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
+      ],
+      path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
+    ),
+
+    .target(
+      name: "FirebaseInAppMessaging",
+      dependencies: [
+        "FirebaseCore",
+        "FirebaseInstallations",
+        "FirebaseABTesting",
+        .product(name: "GULEnvironment", package: "GoogleUtilities"),
+        .product(name: "nanopb", package: "nanopb"),
+        .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
+      ],
+      path: "FirebaseInAppMessaging/Sources",
+      exclude: [
+        "DefaultUI/CHANGELOG.md",
+        "DefaultUI/README.md",
+      ],
+      publicHeadersPath: "Public",
+      cSettings: [
+        .headerSearchPath("../../"),
+        .define("PB_FIELD_32BIT", to: "1"),
+        .define("PB_NO_PACKED_STRUCTS", to: "1"),
+        .define("PB_ENABLE_MALLOC", to: "1"),
+      ]
+    ),
+
+    .target(
+      name: "FirebaseInAppMessaging_iOS",
+      path: "FirebaseInAppMessaging/iOS",
+      resources: [.process("Resources")]
+    ),
+
+    .target(
+      name: "FirebaseInAppMessagingSwift",
+      dependencies: ["FirebaseInAppMessaging"],
+      path: "FirebaseInAppMessaging/Swift/Source"
+    ),
+
+    .target(
+      name: "FirebaseInstallations",
+      dependencies: [
+        "FirebaseCore",
+        .product(name: "FBLPromises", package: "Promises"),
+        .product(name: "GULEnvironment", package: "GoogleUtilities"),
+        .product(name: "GULUserDefaults", package: "GoogleUtilities"),
+      ],
+      path: "FirebaseInstallations/Source/Library",
+      publicHeadersPath: "Public",
+      cSettings: [
+        .headerSearchPath("../../../"),
+      ],
+      linkerSettings: [
+        .linkedFramework("Security"),
+      ]
+    ),
+
+    .target(
+      name: "FirebaseMLModelDownloader",
+      dependencies: [
+        "FirebaseCore",
+        "FirebaseInstallations",
+        .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
+        .product(name: "GULLogger", package: "GoogleUtilities"),
+        .product(name: "SwiftProtobuf", package: "swift-protobuf"),
+      ],
+      path: "FirebaseMLModelDownloader/Sources",
+      exclude: [
+        "proto/firebase_ml_log_sdk.proto",
+      ],
+      cSettings: [
+        .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
+      ]
+    ),
+    .testTarget(
+      name: "FirebaseMLModelDownloaderUnit",
+      dependencies: ["FirebaseMLModelDownloader"],
+      path: "FirebaseMLModelDownloader/Tests/Unit"
+    ),
+
+    .target(
+      name: "FirebaseMessaging",
+      dependencies: [
+        "FirebaseCore",
+        "FirebaseInstallations",
+        .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
+        .product(name: "GULEnvironment", package: "GoogleUtilities"),
+        .product(name: "GULReachability", package: "GoogleUtilities"),
+        .product(name: "GULUserDefaults", package: "GoogleUtilities"),
+        .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
+        .product(name: "nanopb", package: "nanopb"),
+      ],
+      path: "FirebaseMessaging/Sources",
+      publicHeadersPath: "Public",
+      cSettings: [
+        .headerSearchPath("../../"),
+        .define("PB_FIELD_32BIT", to: "1"),
+        .define("PB_NO_PACKED_STRUCTS", to: "1"),
+        .define("PB_ENABLE_MALLOC", to: "1"),
+      ],
+      linkerSettings: [
+        .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
+      ]
+    ),
+    // Internal headers only for consuming from Swift.
+    .target(
+      name: "FirebaseMessagingInterop",
+      path: "FirebaseMessaging/Interop",
+      publicHeadersPath: ".",
+      cSettings: [
+        .headerSearchPath("../../"),
+      ]
+    ),
+    .testTarget(
+      name: "MessagingUnit",
+      dependencies: [
+        "FirebaseMessaging",
+        "SharedTestUtilities",
+        .product(name: "OCMock", package: "ocmock"),
+      ],
+      path: "FirebaseMessaging/Tests/UnitTests",
+      exclude: [
+        "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
+      ],
+      cSettings: [
+        .headerSearchPath("../../.."),
+      ]
+    ),
+
+    .target(
+      name: "FirebasePerformanceTarget",
+      dependencies: [.target(name: "FirebasePerformance",
+                             condition: .when(platforms: [.iOS, .tvOS]))],
+      path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
+    ),
+    .target(
+      name: "FirebasePerformance",
+      dependencies: [
+        "FirebaseCore",
+        "FirebaseInstallations",
+        "FirebaseRemoteConfig",
+        "FirebaseSessions",
+        .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
+        .product(name: "GULEnvironment", package: "GoogleUtilities"),
+        .product(name: "GULISASwizzler", package: "GoogleUtilities"),
+        .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
+        .product(name: "GULUserDefaults", package: "GoogleUtilities"),
+        .product(name: "nanopb", package: "nanopb"),
+      ],
+      path: "FirebasePerformance/Sources",
+      publicHeadersPath: "Public",
+      cSettings: [
+        .headerSearchPath("../../"),
+        .define("PB_FIELD_32BIT", to: "1"),
+        .define("PB_NO_PACKED_STRUCTS", to: "1"),
+        .define("PB_ENABLE_MALLOC", to: "1"),
+        .define("FIRPerformance_LIB_VERSION", to: firebaseVersion),
+      ],
+      linkerSettings: [
+        .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .tvOS])),
+        .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .tvOS])),
+        .linkedFramework("QuartzCore", .when(platforms: [.iOS, .tvOS])),
+      ]
+    ),
+    .testTarget(
+      name: "PerformanceUnit",
+      dependencies: [
+        "FirebasePerformanceTarget",
+        "SharedTestUtilities",
+        "GCDWebServer",
+        .product(name: "OCMock", package: "ocmock"),
+      ],
+      path: "FirebasePerformance/Tests/Unit",
+      resources: [
+        .process("FPRURLFilterTests-Info.plist"),
+        .process("Server/smallDownloadFile"),
+        .process("Server/bigDownloadFile"),
+      ],
+      cSettings: [
+        .headerSearchPath("../../.."),
+        .define("PB_FIELD_32BIT", to: "1"),
+        .define("PB_NO_PACKED_STRUCTS", to: "1"),
+        .define("PB_ENABLE_MALLOC", to: "1"),
+      ]
+    ),
+
+    .target(
+      name: "SharedTestUtilities",
+      dependencies: ["FirebaseCore",
+                     "FirebaseAppCheckInterop",
+                     "FirebaseAuthInterop",
+                     "FirebaseMessagingInterop",
+                     "GoogleDataTransport",
+                     .product(name: "OCMock", package: "ocmock")],
+      path: "SharedTestUtilities",
+      publicHeadersPath: "./",
+      cSettings: [
+        .headerSearchPath("../"),
+      ]
+    ),
+
+    // MARK: - Firebase Remote Config
+
+    .target(
+      name: "FirebaseRemoteConfig",
+      dependencies: [
+        "FirebaseCore",
+        "FirebaseABTesting",
+        "FirebaseInstallations",
+        .product(name: "GULNSData", package: "GoogleUtilities"),
+      ],
+      path: "FirebaseRemoteConfig/Sources",
+      publicHeadersPath: "Public",
+      cSettings: [
+        .headerSearchPath("../../"),
+      ]
+    ),
+    .testTarget(
+      name: "RemoteConfigUnit",
+      dependencies: ["FirebaseRemoteConfig", .product(name: "OCMock", package: "ocmock")],
+      path: "FirebaseRemoteConfig/Tests/Unit",
+      exclude: [
+        // Need to be evaluated/ported to RC V2.
+        "RCNConfigAnalyticsTest.m",
+        "RCNConfigSettingsTest.m",
+        "RCNConfigTest.m",
+        "RCNRemoteConfig+FIRAppTest.m",
+        "RCNThrottlingTests.m",
+      ],
+      resources: [
+        .process("SecondApp-GoogleService-Info.plist"),
+        .process("Defaults-testInfo.plist"),
+        .process("TestABTPayload.txt"),
+      ],
+      cSettings: [
+        .headerSearchPath("../../.."),
+      ]
+    ),
+    .target(
+      name: "FirebaseRemoteConfigSwift",
+      dependencies: [
+        "FirebaseRemoteConfig",
+        "FirebaseSharedSwift",
+      ],
+      path: "FirebaseRemoteConfigSwift/Sources"
+    ),
+    .testTarget(
+      name: "RemoteConfigFakeConsole",
+      dependencies: ["FirebaseRemoteConfigSwift",
+                     "RemoteConfigFakeConsoleObjC"],
+      path: "FirebaseRemoteConfigSwift/Tests",
+      exclude: [
+        "AccessToken.json",
+        "README.md",
+        "ObjC/",
+      ],
+      resources: [
+        .process("Defaults-testInfo.plist"),
+      ],
+      cSettings: [
+        .headerSearchPath("../../"),
+      ]
+    ),
+    .target(
+      name: "RemoteConfigFakeConsoleObjC",
+      dependencies: [.product(name: "OCMock", package: "ocmock")],
+      path: "FirebaseRemoteConfigSwift/Tests/ObjC",
+      publicHeadersPath: ".",
+      cSettings: [
+        .headerSearchPath("../../../"),
+      ]
+    ),
+
+    // MARK: - Firebase Sessions
+
+    .target(
+      name: "FirebaseSessions",
+      dependencies: [
+        "FirebaseCore",
+        "FirebaseInstallations",
+        "FirebaseCoreExtension",
+        "FirebaseSessionsObjC",
+        .product(name: "Promises", package: "Promises"),
+        .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
+        .product(name: "GULEnvironment", package: "GoogleUtilities"),
+      ],
+      path: "FirebaseSessions/Sources",
+      cSettings: [
+        .headerSearchPath(".."),
+        .define("DISPLAY_VERSION", to: firebaseVersion),
+        .define("PB_FIELD_32BIT", to: "1"),
+        .define("PB_NO_PACKED_STRUCTS", to: "1"),
+        .define("PB_ENABLE_MALLOC", to: "1"),
+      ],
+      linkerSettings: [
+        .linkedFramework("Security"),
+        .linkedFramework(
+          "SystemConfiguration",
+          .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
+        ),
+      ]
+    ),
+    // The Sessions SDK is Swift-first with Objective-C code to support
+    // nanopb. Because Swift Package Manager doesn't support mixed
+    // language targets, the ObjC code has been extracted out into
+    // a separate target.
+    .target(
+      name: "FirebaseSessionsObjC",
+      dependencies: [
+        .product(name: "GULEnvironment", package: "GoogleUtilities"),
+        .product(name: "nanopb", package: "nanopb"),
+      ],
+      path: "FirebaseSessions",
+      exclude: [
+        "README.md",
+        "Sources/",
+        "Tests/",
+        "ProtoSupport/",
+        "generate_project.sh",
+        "generate_protos.sh",
+        "generate_testapp.sh",
+      ],
+      publicHeadersPath: "SourcesObjC",
+      cSettings: [
+        .headerSearchPath(".."),
+        .define("DISPLAY_VERSION", to: firebaseVersion),
+        .define("PB_FIELD_32BIT", to: "1"),
+        .define("PB_NO_PACKED_STRUCTS", to: "1"),
+        .define("PB_ENABLE_MALLOC", to: "1"),
+      ],
+      linkerSettings: [
+        .linkedFramework("Security"),
+        .linkedFramework(
+          "SystemConfiguration",
+          .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
+        ),
+      ]
+    ),
+    .testTarget(
+      name: "FirebaseSessionsUnit",
+      dependencies: ["FirebaseSessions"],
+      path: "FirebaseSessions/Tests/Unit"
+    ),
+
+    // MARK: - Firebase Storage
+
+    .target(
+      name: "FirebaseStorage",
+      dependencies: [
+        "FirebaseAppCheckInterop",
+        "FirebaseAuthInterop",
+        "FirebaseCore",
+        "FirebaseCoreExtension",
+        .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
+      ],
+      path: "FirebaseStorage/Sources"
+    ),
+    .testTarget(
+      name: "FirebaseStorageUnit",
+      dependencies: ["FirebaseStorage",
+                     "SharedTestUtilities"],
+      path: "FirebaseStorage/Tests/Unit",
+      cSettings: [
+        .headerSearchPath("../../../"),
+      ]
+    ),
+    .testTarget(
+      name: "StorageObjCIntegration",
+      dependencies: ["FirebaseStorage"],
+      path: "FirebaseStorage/Tests/ObjCIntegration",
+      exclude: [
+        // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
+        "FIRStorageIntegrationTests.m",
+        "ObjCPPAPITests.mm",
+        "Credentials.h",
+      ],
+      cSettings: [
+        .headerSearchPath("../../.."),
+      ]
+    ),
+    .testTarget(
+      name: "swift-test",
+      dependencies: [
+        "Firebase",
+        "FirebaseAuth",
+        "FirebaseAppCheck",
+        "FirebaseABTesting",
+        "FirebaseAnalytics",
+        "FirebaseAnalyticsSwift",
+        .target(name: "FirebaseAppDistribution",
+                condition: .when(platforms: [.iOS])),
+        "FirebaseAuthCombineSwift",
+        "FirebaseFirestoreCombineSwift",
+        "FirebaseFunctionsCombineSwift",
+        "FirebaseStorageCombineSwift",
+        "FirebaseCrashlytics",
+        "FirebaseCore",
+        "FirebaseDatabase",
+        "FirebaseDynamicLinks",
+        "FirebaseFirestoreTarget",
+        "FirebaseFirestoreSwift",
+        "FirebaseFunctions",
+        "FirebaseInAppMessaging",
+        .target(name: "FirebaseInAppMessagingSwift",
+                condition: .when(platforms: [.iOS, .tvOS])),
+        "FirebaseInstallations",
+        "FirebaseMessaging",
+        .target(name: "FirebasePerformance",
+                condition: .when(platforms: [.iOS, .tvOS])),
+        "FirebaseRemoteConfig",
+        "FirebaseSessions",
+        "FirebaseStorage",
+        .product(name: "nanopb", package: "nanopb"),
+      ],
+      path: "SwiftPMTests/swift-test"
+    ),
+    .testTarget(
+      name: "analytics-import-test",
+      dependencies: [
+        "FirebaseAnalyticsSwiftTarget",
+        "FirebaseAnalyticsWrapper",
+        "Firebase",
+      ],
+      path: "SwiftPMTests/analytics-import-test"
+    ),
+    .testTarget(
+      name: "objc-import-test",
+      dependencies: [
+        "Firebase",
+        "FirebaseAuth",
+        "FirebaseABTesting",
+        "FirebaseAppCheck",
+        .target(name: "FirebaseAppDistribution",
+                condition: .when(platforms: [.iOS])),
+        "FirebaseCrashlytics",
+        "FirebaseCore",
+        "FirebaseDatabase",
+        "FirebaseDynamicLinks",
+        "FirebaseFirestoreTarget",
+        "FirebaseFunctions",
+        "FirebaseInAppMessaging",
+        "FirebaseInstallations",
+        "FirebaseMessaging",
+        .target(name: "FirebasePerformance",
+                condition: .when(platforms: [.iOS, .tvOS])),
+        "FirebaseRemoteConfig",
+        "FirebaseStorage",
+      ],
+      path: "SwiftPMTests/objc-import-test"
+    ),
+    .testTarget(
+      name: "version-test",
+      dependencies: [
+        "FirebaseCore",
+      ],
+      path: "SwiftPMTests/version-test",
+      cSettings: [
+        .define("FIR_VERSION", to: firebaseVersion),
+      ]
+    ),
+
+    // MARK: - Firebase App Check
+
+    .target(name: "FirebaseAppCheck",
+            dependencies: [
+              "FirebaseCore",
+              .product(name: "FBLPromises", package: "Promises"),
+              .product(name: "GULEnvironment", package: "GoogleUtilities"),
+            ],
+            path: "FirebaseAppCheck/Sources",
+            publicHeadersPath: "Public",
+            cSettings: [
+              .headerSearchPath("../.."),
+            ],
+            linkerSettings: [
+              .linkedFramework(
+                "DeviceCheck",
+                .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
+              ),
+            ]),
+    // Internal headers only for consuming from Swift.
+    .target(
+      name: "FirebaseAppCheckInterop",
+      path: "FirebaseAppCheck/Interop",
+      exclude: [
+        "CMakeLists.txt",
+      ],
+      publicHeadersPath: ".",
+      cSettings: [
+        .headerSearchPath("../../"),
+      ]
+    ),
+    .testTarget(
+      name: "AppCheckUnit",
+      dependencies: [
+        "FirebaseAppCheck",
+        "SharedTestUtilities",
+        "HeartbeatLoggingTestUtils",
+        .product(name: "OCMock", package: "ocmock"),
+      ],
+      path: "FirebaseAppCheck/Tests",
+      exclude: [
+        // Disable Swift tests as mixed targets are not supported (Xcode 12.3).
+        "Unit/Swift",
+      ],
+      resources: [
+        .process("Fixture"),
+      ],
+      cSettings: [
+        .headerSearchPath("../.."),
+      ]
+    ),
+    .testTarget(
+      name: "AppCheckUnitSwift",
+      dependencies: ["FirebaseAppCheck"],
+      path: "FirebaseAppCheck/Tests/Unit/Swift",
+      cSettings: [
+        .headerSearchPath("../.."),
+      ]
+    ),
+
+    // MARK: Testing support
+
+    .target(
+      name: "FirebaseFirestoreTestingSupport",
+      dependencies: ["FirebaseFirestoreTarget"],
+      path: "FirebaseTestingSupport/Firestore/Sources",
+      publicHeadersPath: "./",
+      cSettings: [
+        .headerSearchPath("../../.."),
+        .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
+      ]
+    ),
+    .testTarget(
+      name: "FirestoreTestingSupportTests",
+      dependencies: ["FirebaseFirestoreTestingSupport"],
+      path: "FirebaseTestingSupport/Firestore/Tests",
+      cSettings: [
+        .headerSearchPath("../../.."),
+      ]
+    ),
 
   ],
   cLanguageStandard: .c99,

+ 0 - 2
SwiftPMTests/ClientApp/ClientApp/objc-header-import-test.m

@@ -29,11 +29,9 @@
 #import <FirebaseAppDistribution/FirebaseAppDistribution.h>
 #import "FirebaseAppDistribution/FirebaseAppDistribution.h"
 #endif
-#import <FirebaseAuth/FirebaseAuth.h>
 #import <FirebaseCore/FirebaseCore.h>
 #import <FirebaseCrashlytics/FirebaseCrashlytics.h>
 #import <FirebaseDatabase/FirebaseDatabase.h>
-#import "FirebaseAuth/FirebaseAuth.h"
 #import "FirebaseCore/FirebaseCore.h"
 #import "FirebaseCrashlytics/FirebaseCrashlytics.h"
 #import "FirebaseDatabase/FirebaseDatabase.h"

+ 0 - 2
SwiftPMTests/objc-import-test/objc-header.m

@@ -18,7 +18,6 @@
 #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
 #import "FirebaseAppDistribution/FirebaseAppDistribution.h"
 #endif
-#import "FirebaseAuth/FirebaseAuth.h"
 #import "FirebaseCore/FirebaseCore.h"
 #import "FirebaseCrashlytics/FirebaseCrashlytics.h"
 #import "FirebaseDatabase/FirebaseDatabase.h"
@@ -40,7 +39,6 @@
 #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
 #import <FirebaseAppDistribution/FirebaseAppDistribution.h>
 #endif
-#import <FirebaseAuth/FirebaseAuth.h>
 #import <FirebaseCore/FirebaseCore.h>
 #import <FirebaseCrashlytics/FirebaseCrashlytics.h>
 #import <FirebaseDatabase/FirebaseDatabase.h>