| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641 |
- // swift-tools-version:6.0
- // The swift-tools-version declares the minimum version of Swift required to
- // build this package.
- // Copyright 2020 Google LLC
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- import PackageDescription
- let firebaseVersion = "12.6.0"
- let package = Package(
- name: "Firebase",
- platforms: [.iOS(.v15), .macCatalyst(.v15), .macOS(.v10_15), .tvOS(.v15), .watchOS(.v7)],
- products: [
- .library(
- name: "FirebaseAI",
- targets: [
- "FirebaseAI",
- "FirebaseAILogic",
- ]
- ),
- .library(
- name: "FirebaseAILogic",
- targets: [
- "FirebaseAILogic",
- ]
- ),
- .library(
- name: "FirebaseAnalytics",
- targets: ["FirebaseAnalyticsTarget"]
- ),
- // Adding this library to your project is enough for it to take effect. The module
- // does not need to be imported into any source files.
- .library(
- name: "FirebaseAnalyticsCore",
- targets: ["FirebaseAnalyticsCoreTarget"]
- ),
- // Adding this library to your project is enough for it to take effect. The module
- // does not need to be imported into any source files.
- .library(
- name: "FirebaseAnalyticsIdentitySupport",
- targets: ["FirebaseAnalyticsIdentitySupportTarget"]
- ),
- .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: "FirebaseCore",
- targets: ["FirebaseCore"]
- ),
- .library(
- name: "FirebaseCrashlytics",
- targets: ["FirebaseCrashlytics"]
- ),
- .library(
- name: "FirebaseDatabase",
- targets: ["FirebaseDatabase"]
- ),
- .library(
- name: "FirebaseFirestore",
- targets: ["FirebaseFirestoreTarget"]
- ),
- .library(
- name: "FirebaseFunctions",
- targets: ["FirebaseFunctions"]
- ),
- .library(
- name: "FirebaseInAppMessaging-Beta",
- targets: ["FirebaseInAppMessagingTarget"]
- ),
- .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: "FirebaseStorage",
- targets: ["FirebaseStorage"]
- ),
- ],
- dependencies: [
- .package(
- url: "https://github.com/google/promises.git",
- "2.4.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",
- "10.1.0" ..< "11.0.0"
- ),
- .package(
- url: "https://github.com/google/GoogleUtilities.git",
- "8.1.0" ..< "9.0.0"
- ),
- .package(
- url: "https://github.com/google/gtm-session-fetcher.git",
- "3.4.1" ..< "6.0.0"
- ),
- .package(
- url: "https://github.com/firebase/nanopb.git",
- "2.30910.0" ..< "2.30911.0"
- ),
- abseilDependency(),
- grpcDependency(),
- .package(
- url: "https://github.com/erikdoe/ocmock.git",
- revision: "2c0bfd373289f4a7716db5d6db471640f91a6507"
- ),
- .package(
- url: "https://github.com/firebase/leveldb.git",
- "1.22.2" ..< "1.23.0"
- ),
- .package(
- url: "https://github.com/SlaunchaMan/GCDWebServer.git",
- revision: "935e2736044e71e5341663c3cc9a335ba6867a2b"
- ),
- .package(
- url: "https://github.com/google/interop-ios-for-google-sdks.git",
- "101.0.0" ..< "102.0.0"
- ),
- .package(url: "https://github.com/google/app-check.git",
- "11.0.1" ..< "12.0.0"),
- ],
- targets: [
- .target(
- name: "Firebase",
- path: "CoreOnly/Sources",
- publicHeadersPath: "./"
- ),
- // MARK: - Firebase AI
- .target(
- name: "FirebaseAILogic",
- dependencies: [
- "FirebaseAppCheckInterop",
- "FirebaseAuthInterop",
- "FirebaseCore",
- "FirebaseCoreExtension",
- ],
- path: "FirebaseAI/Sources"
- ),
- .testTarget(
- name: "FirebaseAILogicUnit",
- dependencies: [
- "FirebaseAILogic",
- "FirebaseStorage",
- ],
- path: "FirebaseAI/Tests/Unit",
- resources: [
- .copy("vertexai-sdk-test-data/mock-responses"),
- .process("Resources"),
- ],
- cSettings: [
- .headerSearchPath("../../../"),
- ]
- ),
- .target(
- name: "FirebaseAI",
- dependencies: ["FirebaseAILogic"],
- path: "FirebaseAI/Wrapper/Sources"
- ),
- .testTarget(
- name: "FirebaseAIUnit",
- dependencies: ["FirebaseAI"],
- path: "FirebaseAI/Wrapper/Tests"
- ),
- // MARK: - Firebase Core
- .target(
- name: "FirebaseCore",
- dependencies: [
- "Firebase",
- "FirebaseCoreInternal",
- .product(name: "GULEnvironment", package: "GoogleUtilities"),
- .product(name: "GULLogger", package: "GoogleUtilities"),
- ],
- path: "FirebaseCore/Sources",
- resources: [.process("Resources/PrivacyInfo.xcprivacy")],
- publicHeadersPath: "Public",
- cSettings: [
- .headerSearchPath("../.."),
- .define("Firebase_VERSION", to: firebaseVersion),
- // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
- ],
- linkerSettings: [
- .linkedFramework("UIKit", .when(platforms: [.iOS, .macCatalyst, .tvOS])),
- .linkedFramework("AppKit", .when(platforms: [.macOS])),
- ]
- ),
- .testTarget(
- name: "CoreUnit",
- dependencies: [
- "FirebaseCore",
- "SharedTestUtilities",
- .product(name: "OCMock", package: "ocmock"),
- ],
- path: "FirebaseCore/Tests/Unit",
- exclude: ["Resources/GoogleService-Info.plist"],
- cSettings: [
- .headerSearchPath("../../.."),
- ]
- ),
- // MARK: - Firebase Core Extension
- // Extension of FirebaseCore for consuming by Swift product SDKs.
- // When depending on `FirebaseCoreExtension`, also depend on `FirebaseCore`
- // to avoid potential linker issues.
- .target(
- name: "FirebaseCoreExtension",
- path: "FirebaseCore/Extension",
- resources: [.process("Resources/PrivacyInfo.xcprivacy")],
- publicHeadersPath: ".",
- cSettings: [
- .headerSearchPath("../../"),
- ]
- ),
- // MARK: - Firebase Core Internal
- // Shared collection of APIs for internal FirebaseCore usage.
- .target(
- name: "FirebaseCoreInternal",
- dependencies: [
- .product(name: "GULNSData", package: "GoogleUtilities"),
- ],
- path: "FirebaseCore/Internal/Sources",
- resources: [.process("Resources/PrivacyInfo.xcprivacy")]
- ),
- .testTarget(
- name: "FirebaseCoreInternalTests",
- dependencies: [
- "FirebaseCoreInternal",
- ],
- path: "FirebaseCore/Internal/Tests"
- ),
- .target(
- name: "FirebaseABTesting",
- dependencies: ["FirebaseCore"],
- path: "FirebaseABTesting/Sources",
- resources: [.process("Resources/PrivacyInfo.xcprivacy")],
- 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, .macCatalyst, .macOS, .tvOS]))],
- path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
- ),
- .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/12.5.0/FirebaseAnalytics.zip",
- checksum: "7ff922682f5d47e6add687979b3126f391c7d2e8f367599d4ec8d2a58dce8cc9"
- ),
- .testTarget(
- name: "AnalyticsSwiftUnit",
- dependencies: ["FirebaseAnalyticsTarget"],
- path: "FirebaseAnalytics/Tests/SwiftUnit"
- ),
- .testTarget(
- name: "AnalyticsObjCAPI",
- dependencies: ["FirebaseAnalyticsTarget"],
- path: "FirebaseAnalytics/Tests/ObjCAPI"
- ),
- .target(
- name: "FirebaseAnalyticsCoreTarget",
- dependencies: [.target(name: "FirebaseAnalyticsCoreWrapper",
- condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
- path: "SwiftPM-PlatformExclude/FirebaseAnalyticsCoreWrap"
- ),
- .target(
- name: "FirebaseAnalyticsCoreWrapper",
- dependencies: [
- .target(
- name: "FirebaseAnalytics",
- condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
- ),
- .product(name: "GoogleAppMeasurementCore",
- 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: "FirebaseAnalyticsCoreWrapper",
- linkerSettings: [
- .linkedLibrary("sqlite3"),
- .linkedLibrary("c++"),
- .linkedLibrary("z"),
- .linkedFramework("StoreKit"),
- ]
- ),
- .target(
- name: "FirebaseAnalyticsIdentitySupportTarget",
- dependencies: [
- .target(
- name: "FirebaseAnalytics",
- condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
- ),
- .product(name: "GoogleAppMeasurementIdentitySupport",
- 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: "FirebaseAnalyticsIdentitySupportWrapper",
- linkerSettings: [
- .linkedLibrary("sqlite3"),
- .linkedLibrary("c++"),
- .linkedLibrary("z"),
- .linkedFramework("StoreKit"),
- ]
- ),
- .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("../../../.."),
- ],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .target(
- name: "FirebaseAuth",
- dependencies: [
- "FirebaseAppCheckInterop",
- "FirebaseAuthInterop",
- "FirebaseAuthInternal",
- "FirebaseCore",
- "FirebaseCoreExtension",
- .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
- .product(name: "GULEnvironment", package: "GoogleUtilities"),
- .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
- ],
- path: "FirebaseAuth/Sources",
- exclude: [
- "ObjC", "Public",
- ],
- resources: [.process("Resources/PrivacyInfo.xcprivacy")],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ],
- linkerSettings: [
- .linkedFramework("Security"),
- .linkedFramework("SafariServices", .when(platforms: [.iOS])),
- ]
- ),
- .target(
- name: "FirebaseAuthInternal",
- dependencies: [
- .product(name: "RecaptchaInterop", package: "interop-ios-for-google-sdks"),
- ],
- path: "FirebaseAuth/Sources",
- exclude: [
- "Swift", "Resources",
- ],
- publicHeadersPath: "Public",
- cSettings: [
- .headerSearchPath("../../"),
- ]
- ),
- // Internal headers only for consuming from Swift.
- .target(
- name: "FirebaseAuthInterop",
- path: "FirebaseAuth/Interop",
- exclude: [
- "CMakeLists.txt",
- ],
- publicHeadersPath: "Public",
- cSettings: [
- .headerSearchPath("../../"),
- ]
- ),
- .testTarget(
- name: "AuthUnit",
- dependencies: [
- "FirebaseAuth",
- ],
- path: "FirebaseAuth/Tests/Unit",
- exclude: [
- // TODO: these tests rely on a non-zero UIApplication.shared. They run from CocoaPods.
- "PhoneAuthProviderTests.swift",
- "AuthNotificationManagerTests.swift",
- // TODO: The following tests run in CocoaPods only, until mixed language or separate target.
- "ObjCAPITests.m",
- "ObjCGlobalTests.m",
- "FIROAuthProviderTests.m",
- ],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .target(
- name: "FirebaseAuthCombineSwift",
- dependencies: ["FirebaseAuth"],
- path: "FirebaseCombineSwift/Sources/Auth",
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .target(
- name: "FirebaseFirestoreCombineSwift",
- dependencies: [
- "FirebaseFirestoreTarget",
- ],
- path: "FirebaseCombineSwift/Sources/Firestore"
- ),
- .target(
- name: "FirebaseStorageCombineSwift",
- dependencies: [
- "FirebaseStorage",
- ],
- path: "FirebaseCombineSwift/Sources/Storage"
- ),
- .target(
- name: "FirebaseCrashlytics",
- dependencies: [
- "FirebaseCore",
- "FirebaseInstallations",
- "FirebaseSessions",
- "FirebaseRemoteConfigInterop",
- "FirebaseCrashlyticsSwift",
- .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",
- "CrashlyticsInputFiles.xcfilelist",
- "third_party/libunwind/LICENSE",
- "Crashlytics/Rollouts/",
- ],
- sources: [
- "Crashlytics/",
- "Protogen/",
- "Shared/",
- "third_party/libunwind/dwarf.h",
- ],
- resources: [.process("Resources/PrivacyInfo.xcprivacy")],
- 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, .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])),
- ]
- ),
- .target(
- name: "FirebaseCrashlyticsSwift",
- dependencies: ["FirebaseRemoteConfigInterop"],
- path: "Crashlytics",
- sources: [
- "Crashlytics/Rollouts/",
- ]
- ),
- .testTarget(
- name: "FirebaseCrashlyticsSwiftUnit",
- dependencies: ["FirebaseCrashlyticsSwift"],
- path: "Crashlytics/UnitTestsSwift/",
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .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: "FirebaseDatabaseInternal",
- dependencies: [
- "FirebaseAppCheckInterop",
- "FirebaseCore",
- "leveldb",
- .product(name: "GULUserDefaults", package: "GoogleUtilities"),
- ],
- 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",
- "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("../.."),
- ],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .testTarget(
- name: "DatabaseUnitSwift",
- dependencies: ["FirebaseDatabase"],
- path: "FirebaseDatabase/Tests/Unit/Swift",
- cSettings: [
- .headerSearchPath("../.."),
- ],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .target(
- name: "FirebaseDatabase",
- dependencies: ["FirebaseDatabaseInternal", "FirebaseSharedSwift"],
- path: "FirebaseDatabase/Swift/Sources"
- ),
- .target(
- name: "FirebaseSharedSwift",
- path: "FirebaseSharedSwift/Sources",
- exclude: [
- "third_party/FirebaseDataEncoder/LICENSE",
- "third_party/FirebaseDataEncoder/METADATA",
- ],
- // TODO(ncooke3): Can this be upgraded to Swift 6?
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .testTarget(
- name: "FirebaseSharedSwiftTests",
- dependencies: ["FirebaseSharedSwift"],
- path: "FirebaseSharedSwift/Tests/"
- ),
- firestoreWrapperTarget(),
- // 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("../../../"),
- ],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .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",
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .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: "FirebaseInAppMessagingInternal",
- dependencies: [
- "FirebaseCore",
- "FirebaseInstallations",
- "FirebaseABTesting",
- .product(name: "GULEnvironment", package: "GoogleUtilities"),
- .product(name: "GULUserDefaults", 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: "FirebaseInAppMessaging",
- dependencies: ["FirebaseInAppMessagingInternal"],
- path: "FirebaseInAppMessaging/Swift/Source",
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .target(
- name: "FirebaseInstallations",
- dependencies: [
- "FirebaseCore",
- .product(name: "FBLPromises", package: "Promises"),
- .product(name: "GULEnvironment", package: "GoogleUtilities"),
- .product(name: "GULUserDefaults", package: "GoogleUtilities"),
- ],
- path: "FirebaseInstallations/Source/Library",
- resources: [.process("Resources/PrivacyInfo.xcprivacy")],
- publicHeadersPath: "Public",
- cSettings: [
- .headerSearchPath("../../../"),
- ],
- linkerSettings: [
- .linkedFramework("Security"),
- ]
- ),
- .target(
- name: "FirebaseMLModelDownloader",
- dependencies: [
- "FirebaseCore",
- "FirebaseCoreExtension",
- "FirebaseInstallations",
- .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
- .product(name: "GULUserDefaults", package: "GoogleUtilities"),
- .product(name: "SwiftProtobuf", package: "swift-protobuf"),
- ],
- path: "FirebaseMLModelDownloader/Sources",
- exclude: [
- "proto/firebase_ml_log_sdk.proto",
- ],
- cSettings: [
- .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
- ],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .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",
- resources: [.process("Resources/PrivacyInfo.xcprivacy")],
- 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, .visionOS]))],
- path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
- ),
- .target(
- name: "FirebasePerformance",
- dependencies: [
- "FirebaseCore",
- "FirebaseInstallations",
- // Performance depends on the Obj-C target of FirebaseRemoteConfig to
- // avoid including Swift code from the `FirebaseRemoteConfig` target
- // that is unneeded.
- "FirebaseRemoteConfigInternal",
- "FirebaseSessions",
- .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
- .product(name: "GULEnvironment", 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("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: "FirebaseRemoteConfigInternal",
- dependencies: [
- "FirebaseCore",
- "FirebaseABTesting",
- "FirebaseInstallations",
- "FirebaseRemoteConfigInterop",
- .product(name: "GULEnvironment", package: "GoogleUtilities"),
- .product(name: "GULNSData", package: "GoogleUtilities"),
- ],
- path: "FirebaseRemoteConfig/Sources",
- publicHeadersPath: "Public",
- cSettings: [
- .headerSearchPath("../../"),
- ]
- ),
- .testTarget(
- name: "RemoteConfigUnit",
- dependencies: ["FirebaseRemoteConfigInternal", .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("../../.."),
- ]
- ),
- .testTarget(
- name: "RemoteConfigSwiftUnit",
- dependencies: ["FirebaseRemoteConfigInternal"],
- path: "FirebaseRemoteConfig/Tests/SwiftUnit",
- cSettings: [
- .headerSearchPath("../../.."),
- ]
- ),
- .target(
- name: "FirebaseRemoteConfig",
- dependencies: [
- "FirebaseRemoteConfigInternal",
- "FirebaseSharedSwift",
- ],
- path: "FirebaseRemoteConfig/Swift",
- resources: [.process("Resources/PrivacyInfo.xcprivacy")],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .testTarget(
- name: "RemoteConfigFakeConsole",
- dependencies: ["FirebaseRemoteConfig",
- "RemoteConfigFakeConsoleObjC"],
- path: "FirebaseRemoteConfig/Tests/Swift",
- exclude: [
- "AccessToken.json",
- "README.md",
- "ObjC/",
- ],
- resources: [
- .process("Defaults-testInfo.plist"),
- ],
- cSettings: [
- .headerSearchPath("../../../"),
- ],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .target(
- name: "RemoteConfigFakeConsoleObjC",
- dependencies: [.product(name: "OCMock", package: "ocmock")],
- path: "FirebaseRemoteConfig/Tests/Swift/ObjC",
- publicHeadersPath: ".",
- cSettings: [
- .headerSearchPath("../../../../"),
- ]
- ),
- // Internal headers only for consuming from other SDK.
- .target(
- name: "FirebaseRemoteConfigInterop",
- path: "FirebaseRemoteConfig/Interop",
- publicHeadersPath: ".",
- cSettings: [
- .headerSearchPath("../../"),
- ]
- ),
- // MARK: - Firebase Sessions
- .target(
- name: "FirebaseSessions",
- dependencies: [
- "FirebaseCore",
- "FirebaseInstallations",
- "FirebaseCoreExtension",
- "FirebaseSessionsObjC",
- // The `FirebaseSessions` target transitively depends on nanopb via the internal
- // `FirebaseSessionsObjC` target. Not explicitly depending on nanopb leads to
- // undefined symbol errors in Tuist based SPM builds.
- // See the conversations in
- // - https://github.com/firebase/firebase-ios-sdk/issues/15276
- // - https://github.com/firebase/firebase-ios-sdk/pull/15287
- .product(name: "nanopb", package: "nanopb"),
- .product(name: "Promises", package: "Promises"),
- .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
- .product(name: "GULEnvironment", package: "GoogleUtilities"),
- .product(name: "GULUserDefaults", 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: [
- "FirebaseCore",
- "FirebaseCoreExtension",
- .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"),
- .product(name: "GULEnvironment", package: "GoogleUtilities"),
- ],
- path: "FirebaseStorage/Sources",
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .testTarget(
- name: "FirebaseStorageUnit",
- dependencies: ["FirebaseStorage",
- "SharedTestUtilities"],
- path: "FirebaseStorage/Tests/Unit",
- cSettings: [
- .headerSearchPath("../../../"),
- ],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .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",
- .target(name: "FirebaseAppDistribution",
- condition: .when(platforms: [.iOS])),
- "FirebaseAuthCombineSwift",
- "FirebaseFirestoreCombineSwift",
- "FirebaseFunctionsCombineSwift",
- "FirebaseStorageCombineSwift",
- "FirebaseCrashlytics",
- "FirebaseCore",
- "FirebaseDatabase",
- "FirebaseFirestoreTarget",
- "FirebaseFunctions",
- .target(name: "FirebaseInAppMessaging",
- 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",
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .testTarget(
- name: "analytics-import-test",
- dependencies: [
- "FirebaseAnalyticsWrapper",
- "Firebase",
- ],
- path: "SwiftPMTests/analytics-import-test",
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- .testTarget(
- name: "objc-import-test",
- dependencies: [
- "Firebase",
- "FirebaseAuth",
- "FirebaseABTesting",
- "FirebaseAppCheck",
- .target(name: "FirebaseAppDistribution",
- condition: .when(platforms: [.iOS])),
- "FirebaseCrashlytics",
- "FirebaseCore",
- "FirebaseDatabase",
- "FirebaseFirestoreTarget",
- "FirebaseFunctions",
- .target(name: "FirebaseInAppMessaging",
- condition: .when(platforms: [.iOS, .tvOS])),
- "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: [
- "FirebaseAppCheckInterop",
- "FirebaseCore",
- .product(name: "AppCheckCore", package: "app-check"),
- .product(name: "GULEnvironment", package: "GoogleUtilities"),
- .product(name: "GULUserDefaults", 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: "Public",
- cSettings: [
- .headerSearchPath("../../"),
- ]
- ),
- .testTarget(
- name: "FirebaseAppCheckUnit",
- dependencies: [
- "FirebaseAppCheck",
- "SharedTestUtilities",
- .product(name: "OCMock", package: "ocmock"),
- ],
- path: "FirebaseAppCheck/Tests/Unit",
- exclude: [
- // Swift tests are in the target `FirebaseAppCheckUnitSwift` since mixed language targets
- // are not supported (as of Xcode 15.0).
- "Swift",
- ],
- cSettings: [
- .headerSearchPath("../../.."),
- ]
- ),
- .testTarget(
- name: "FirebaseAppCheckUnitSwift",
- dependencies: ["FirebaseAppCheck"],
- path: "FirebaseAppCheck/Tests/Unit/Swift",
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- // 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("../../.."),
- ]
- ),
- ] + firestoreTargets(),
- cxxLanguageStandard: CXXLanguageStandard.gnucxx14
- )
- // MARK: - Helper Functions
- func googleAppMeasurementDependency() -> Package.Dependency {
- let appMeasurementURL = "https://github.com/google/GoogleAppMeasurement.git"
- // Point SPM CI to the tip of main of https://github.com/google/GoogleAppMeasurement so that the
- // release process can defer publishing the GoogleAppMeasurement tag until after testing.
- if Context.environment["FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT"] != nil {
- return .package(url: appMeasurementURL, branch: "main")
- }
- return .package(url: appMeasurementURL, exact: "12.5.0")
- }
- func abseilDependency() -> Package.Dependency {
- let packageInfo: (url: String, range: Range<Version>)
- // If building Firestore from source, abseil will need to be built as source
- // as the headers in the binary version of abseil are unusable.
- if Context.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
- packageInfo = (
- "https://github.com/firebase/abseil-cpp-SwiftPM.git",
- "0.20240722.0" ..< "0.20240723.0"
- )
- } else {
- packageInfo = (
- "https://github.com/google/abseil-cpp-binary.git",
- "1.2024072200.0" ..< "1.2024072300.0"
- )
- }
- return .package(url: packageInfo.url, packageInfo.range)
- }
- func grpcDependency() -> Package.Dependency {
- let packageInfo: (url: String, range: Range<Version>)
- // If building Firestore from source, abseil will need to be built as source
- // as the headers in the binary version of abseil are unusable.
- if Context.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
- packageInfo = ("https://github.com/grpc/grpc-ios.git", "1.69.0" ..< "1.70.0")
- } else {
- packageInfo = ("https://github.com/google/grpc-binary.git", "1.69.0" ..< "1.70.0")
- }
- return .package(url: packageInfo.url, packageInfo.range)
- }
- func firestoreWrapperTarget() -> Target {
- if Context.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
- return .target(
- name: "FirebaseFirestoreTarget",
- dependencies: [.target(name: "FirebaseFirestore",
- condition: .when(platforms: [.iOS, .tvOS, .macOS, .visionOS]))],
- path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
- )
- }
- return .target(
- name: "FirebaseFirestoreTarget",
- dependencies: [.target(name: "FirebaseFirestore",
- condition: .when(platforms: [.iOS, .tvOS, .macOS, .macCatalyst]))],
- path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap",
- cSettings: [.define("FIREBASE_BINARY_FIRESTORE", to: "1")]
- )
- }
- func firestoreTargets() -> [Target] {
- if Context.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
- return [
- .target(
- name: "FirebaseFirestoreInternalWrapper",
- dependencies: [
- "FirebaseAppCheckInterop",
- "FirebaseCore",
- "leveldb",
- .product(name: "nanopb", package: "nanopb"),
- .product(name: "abseil", package: "abseil-cpp-SwiftPM"),
- .product(name: "gRPC-cpp", package: "grpc-ios"),
- ],
- 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",
- "Source/Resources/",
- "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, .visionOS])
- ),
- .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS, .visionOS])),
- .linkedLibrary("c++"),
- ]
- ),
- .target(
- name: "FirebaseFirestore",
- dependencies: [
- "FirebaseCore",
- "FirebaseCoreExtension",
- "FirebaseFirestoreInternalWrapper",
- "FirebaseSharedSwift",
- ],
- path: "Firestore",
- exclude: [
- "CHANGELOG.md",
- "CMakeLists.txt",
- "Example/",
- "LICENSE",
- "Protos/",
- "README.md",
- "Source/",
- "Swift/Source/Resources/",
- "core/",
- "fuzzing/",
- "test.sh",
- "Swift/CHANGELOG.md",
- "Swift/Tests/",
- "third_party/nlohmann_json",
- ],
- sources: [
- "Swift/Source/",
- ],
- resources: [.process("Source/Resources/PrivacyInfo.xcprivacy")],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ]
- ),
- ]
- }
- let firestoreInternalTarget: Target = {
- if Context.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil {
- // This is set when running `scripts/check_firestore_symbols.sh`.
- return .binaryTarget(
- name: "FirebaseFirestoreInternal",
- // The `xcframework` should be moved to the root of the repo.
- path: "FirebaseFirestoreInternal.xcframework"
- )
- } else {
- return .binaryTarget(
- name: "FirebaseFirestoreInternal",
- url: "https://dl.google.com/firebase/ios/bin/firestore/12.4.0/rc0/FirebaseFirestoreInternal.zip",
- checksum: "58b916624c01a56c5de694cfc9c5cc7aabcafb13b54e7bde8c83bacc51a3460d"
- )
- }
- }()
- return [
- .target(
- name: "FirebaseFirestore",
- dependencies: [
- .target(
- name: "FirebaseFirestoreInternalWrapper",
- condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
- ),
- .product(
- name: "abseil",
- package: "abseil-cpp-binary",
- condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
- ),
- .product(
- name: "gRPC-C++",
- package: "grpc-binary",
- condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
- ),
- .product(name: "nanopb", package: "nanopb"),
- "FirebaseAppCheckInterop",
- "FirebaseCore",
- "FirebaseCoreExtension",
- "leveldb",
- "FirebaseSharedSwift",
- ],
- path: "Firestore/Swift/Source",
- resources: [.process("Resources/PrivacyInfo.xcprivacy")],
- swiftSettings: [
- .swiftLanguageMode(SwiftLanguageMode.v5),
- ],
- linkerSettings: [
- .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
- .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
- .linkedLibrary("c++"),
- ]
- ),
- .target(
- name: "FirebaseFirestoreInternalWrapper",
- dependencies: [.target(
- name: "FirebaseFirestoreInternal",
- condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
- )],
- path: "FirebaseFirestoreInternal",
- publicHeadersPath: "."
- ),
- firestoreInternalTarget,
- ]
- }
|