Package.swift 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650
  1. // swift-tools-version:5.7.1
  2. // The swift-tools-version declares the minimum version of Swift required to
  3. // build this package.
  4. // Copyright 2020 Google LLC
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License");
  7. // you may not use this file except in compliance with the License.
  8. // You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. import class Foundation.ProcessInfo
  18. import PackageDescription
  19. let firebaseVersion = "10.28.0"
  20. let package = Package(
  21. name: "Firebase",
  22. platforms: [.iOS(.v12), .macCatalyst(.v13), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v7)],
  23. products: [
  24. .library(
  25. name: "FirebaseAnalytics",
  26. targets: ["FirebaseAnalyticsTarget"]
  27. ),
  28. // Adding this library to your project is enough for it to take effect. The module
  29. // does not need to be imported into any source files.
  30. .library(
  31. name: "FirebaseAnalyticsWithoutAdIdSupport",
  32. targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"]
  33. ),
  34. // Adding this library to your project is enough for it to take effect. The module
  35. // does not need to be imported into any source files.
  36. .library(
  37. name: "FirebaseAnalyticsOnDeviceConversion",
  38. targets: ["FirebaseAnalyticsOnDeviceConversionTarget"]
  39. ),
  40. .library(
  41. name: "FirebaseAnalyticsSwift",
  42. targets: ["FirebaseAnalyticsSwiftTarget"]
  43. ),
  44. .library(
  45. name: "FirebaseAuth",
  46. targets: ["FirebaseAuth"]
  47. ),
  48. .library(
  49. name: "FirebaseAppCheck",
  50. targets: ["FirebaseAppCheck"]
  51. ),
  52. .library(
  53. name: "FirebaseAppDistribution-Beta",
  54. targets: ["FirebaseAppDistributionTarget"]
  55. ),
  56. .library(
  57. name: "FirebaseAuthCombine-Community",
  58. targets: ["FirebaseAuthCombineSwift"]
  59. ),
  60. .library(
  61. name: "FirebaseFirestoreCombine-Community",
  62. targets: ["FirebaseFirestoreCombineSwift"]
  63. ),
  64. .library(
  65. name: "FirebaseFunctionsCombine-Community",
  66. targets: ["FirebaseFunctionsCombineSwift"]
  67. ),
  68. .library(
  69. name: "FirebaseStorageCombine-Community",
  70. targets: ["FirebaseStorageCombineSwift"]
  71. ),
  72. .library(
  73. name: "FirebaseCrashlytics",
  74. targets: ["FirebaseCrashlytics"]
  75. ),
  76. .library(
  77. name: "FirebaseDatabase",
  78. targets: ["FirebaseDatabase"]
  79. ),
  80. .library(
  81. name: "FirebaseDatabaseSwift",
  82. targets: ["FirebaseDatabaseSwift"]
  83. ),
  84. .library(
  85. name: "FirebaseDynamicLinks",
  86. targets: ["FirebaseDynamicLinksTarget"]
  87. ),
  88. .library(
  89. name: "FirebaseFirestore",
  90. targets: ["FirebaseFirestoreTarget"]
  91. ),
  92. .library(
  93. name: "FirebaseFirestoreSwift",
  94. targets: ["FirebaseFirestoreSwiftTarget"]
  95. ),
  96. .library(
  97. name: "FirebaseFunctions",
  98. targets: ["FirebaseFunctions"]
  99. ),
  100. .library(
  101. name: "FirebaseInAppMessaging-Beta",
  102. targets: ["FirebaseInAppMessagingTarget"]
  103. ),
  104. .library(
  105. name: "FirebaseInAppMessagingSwift-Beta",
  106. targets: ["FirebaseInAppMessagingSwift"]
  107. ),
  108. .library(
  109. name: "FirebaseInstallations",
  110. targets: ["FirebaseInstallations"]
  111. ),
  112. .library(
  113. name: "FirebaseMessaging",
  114. targets: ["FirebaseMessaging"]
  115. ),
  116. .library(
  117. name: "FirebaseMLModelDownloader",
  118. targets: ["FirebaseMLModelDownloader"]
  119. ),
  120. .library(
  121. name: "FirebasePerformance",
  122. targets: ["FirebasePerformanceTarget"]
  123. ),
  124. .library(
  125. name: "FirebaseRemoteConfig",
  126. targets: ["FirebaseRemoteConfig"]
  127. ),
  128. .library(
  129. name: "FirebaseRemoteConfigSwift",
  130. targets: ["FirebaseRemoteConfigSwift"]
  131. ),
  132. .library(
  133. name: "FirebaseStorage",
  134. targets: ["FirebaseStorage"]
  135. ),
  136. .library(
  137. name: "FirebaseVertexAI-Preview",
  138. targets: ["FirebaseVertexAI"]
  139. ),
  140. ],
  141. dependencies: [
  142. .package(
  143. url: "https://github.com/google/promises.git",
  144. "2.1.0" ..< "3.0.0"
  145. ),
  146. .package(
  147. url: "https://github.com/apple/swift-protobuf.git",
  148. "1.19.0" ..< "2.0.0"
  149. ),
  150. googleAppMeasurementDependency(),
  151. .package(
  152. url: "https://github.com/google/GoogleDataTransport.git",
  153. "9.3.0" ..< "10.0.0"
  154. ),
  155. .package(
  156. url: "https://github.com/google/GoogleUtilities.git",
  157. branch: "release-8.0"
  158. // TODO: Update to 8.0.0 when ready.
  159. // "8.0.0" ..< "9.0.0"
  160. ),
  161. .package(
  162. url: "https://github.com/google/gtm-session-fetcher.git",
  163. "2.1.0" ..< "4.0.0"
  164. ),
  165. .package(
  166. url: "https://github.com/firebase/nanopb.git",
  167. "2.30909.0" ..< "2.30911.0"
  168. ),
  169. abseilDependency(),
  170. grpcDependency(),
  171. // TODO: restore OCMock when https://github.com/erikdoe/ocmock/pull/537
  172. // gets merged to fix Xcode 15.3 builds.
  173. .package(
  174. url: "https://github.com/paulb777/ocmock.git",
  175. revision: "173955e93e6ee6999a10729ab67e4b4efdd1db6d"
  176. ),
  177. // url: "https://github.com/erikdoe/ocmock.git",
  178. // revision: "c5eeaa6dde7c308a5ce48ae4d4530462dd3a1110"
  179. // ),
  180. .package(
  181. url: "https://github.com/firebase/leveldb.git",
  182. "1.22.2" ..< "1.23.0"
  183. ),
  184. .package(
  185. url: "https://github.com/SlaunchaMan/GCDWebServer.git",
  186. revision: "935e2736044e71e5341663c3cc9a335ba6867a2b"
  187. ),
  188. .package(
  189. url: "https://github.com/google/interop-ios-for-google-sdks.git",
  190. "100.0.0" ..< "101.0.0"
  191. ),
  192. .package(url: "https://github.com/google/app-check.git", "10.19.0" ..< "11.0.0"),
  193. ],
  194. targets: [
  195. .target(
  196. name: "Firebase",
  197. path: "CoreOnly/Sources",
  198. publicHeadersPath: "./"
  199. ),
  200. .target(
  201. name: "FirebaseCore",
  202. dependencies: [
  203. "Firebase",
  204. "FirebaseCoreInternal",
  205. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  206. .product(name: "GULLogger", package: "GoogleUtilities"),
  207. ],
  208. path: "FirebaseCore/Sources",
  209. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  210. publicHeadersPath: "Public",
  211. cSettings: [
  212. .headerSearchPath("../.."),
  213. .define("Firebase_VERSION", to: firebaseVersion),
  214. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  215. ],
  216. linkerSettings: [
  217. .linkedFramework("UIKit", .when(platforms: [.iOS, .macCatalyst, .tvOS])),
  218. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  219. ]
  220. ),
  221. .testTarget(
  222. name: "CoreUnit",
  223. dependencies: [
  224. "FirebaseCore",
  225. "SharedTestUtilities",
  226. .product(name: "OCMock", package: "ocmock"),
  227. ],
  228. path: "FirebaseCore/Tests/Unit",
  229. exclude: ["Resources/GoogleService-Info.plist"],
  230. cSettings: [
  231. .headerSearchPath("../../.."),
  232. ]
  233. ),
  234. // MARK: - Firebase Core Extension
  235. // Extension of FirebaseCore for consuming by Swift product SDKs.
  236. // When depending on `FirebaseCoreExtension`, also depend on `FirebaseCore`
  237. // to avoid potential linker issues.
  238. .target(
  239. name: "FirebaseCoreExtension",
  240. path: "FirebaseCore/Extension",
  241. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  242. publicHeadersPath: ".",
  243. cSettings: [
  244. .headerSearchPath("../../"),
  245. ]
  246. ),
  247. // MARK: - Firebase Core Internal
  248. // Shared collection of APIs for internal FirebaseCore usage.
  249. .target(
  250. name: "FirebaseCoreInternal",
  251. dependencies: [
  252. .product(name: "GULNSData", package: "GoogleUtilities"),
  253. ],
  254. path: "FirebaseCore/Internal/Sources",
  255. resources: [.process("Resources/PrivacyInfo.xcprivacy")]
  256. ),
  257. .testTarget(
  258. name: "FirebaseCoreInternalTests",
  259. dependencies: [
  260. "FirebaseCoreInternal",
  261. ],
  262. path: "FirebaseCore/Internal/Tests"
  263. ),
  264. .target(
  265. name: "FirebaseABTesting",
  266. dependencies: ["FirebaseCore"],
  267. path: "FirebaseABTesting/Sources",
  268. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  269. publicHeadersPath: "Public",
  270. cSettings: [
  271. .headerSearchPath("../../"),
  272. ]
  273. ),
  274. .testTarget(
  275. name: "ABTestingUnit",
  276. dependencies: ["FirebaseABTesting", .product(name: "OCMock", package: "ocmock")],
  277. path: "FirebaseABTesting/Tests/Unit",
  278. resources: [.process("Resources")],
  279. cSettings: [
  280. .headerSearchPath("../../.."),
  281. ]
  282. ),
  283. .target(
  284. name: "FirebaseAnalyticsTarget",
  285. dependencies: [.target(name: "FirebaseAnalyticsWrapper",
  286. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  287. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
  288. ),
  289. .target(
  290. name: "FirebaseAnalyticsWrapper",
  291. dependencies: [
  292. .target(
  293. name: "FirebaseAnalytics",
  294. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  295. ),
  296. .product(name: "GoogleAppMeasurement",
  297. package: "GoogleAppMeasurement",
  298. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
  299. "FirebaseCore",
  300. "FirebaseInstallations",
  301. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  302. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  303. .product(name: "GULNSData", package: "GoogleUtilities"),
  304. .product(name: "GULNetwork", package: "GoogleUtilities"),
  305. .product(name: "nanopb", package: "nanopb"),
  306. ],
  307. path: "FirebaseAnalyticsWrapper",
  308. linkerSettings: [
  309. .linkedLibrary("sqlite3"),
  310. .linkedLibrary("c++"),
  311. .linkedLibrary("z"),
  312. .linkedFramework("StoreKit"),
  313. ]
  314. ),
  315. .binaryTarget(
  316. name: "FirebaseAnalytics",
  317. url: "https://dl.google.com/firebase/ios/swiftpm/10.27.0/FirebaseAnalytics.zip",
  318. checksum: "0d5e3c63e34a5e0a8f782641ca128b3bb3be74b1eb58f55a9a4b40064cd84e88"
  319. ),
  320. .target(
  321. name: "FirebaseAnalyticsSwiftTarget",
  322. dependencies: [.target(name: "FirebaseAnalyticsSwift",
  323. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  324. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
  325. ),
  326. .target(
  327. name: "FirebaseAnalyticsSwift",
  328. dependencies: ["FirebaseAnalyticsWrapper"],
  329. path: "FirebaseAnalyticsSwift/Sources"
  330. ),
  331. .testTarget(
  332. name: "AnalyticsSwiftUnit",
  333. dependencies: ["FirebaseAnalyticsSwift"],
  334. path: "FirebaseAnalyticsSwift/Tests/SwiftUnit"
  335. ),
  336. .testTarget(
  337. name: "AnalyticsObjCAPI",
  338. dependencies: ["FirebaseAnalyticsSwift"],
  339. path: "FirebaseAnalyticsSwift/Tests/ObjCAPI"
  340. ),
  341. .target(
  342. name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
  343. dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  344. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  345. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
  346. ),
  347. .target(
  348. name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  349. dependencies: [
  350. .target(
  351. name: "FirebaseAnalytics",
  352. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  353. ),
  354. .product(name: "GoogleAppMeasurementWithoutAdIdSupport",
  355. package: "GoogleAppMeasurement",
  356. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
  357. "FirebaseCore",
  358. "FirebaseInstallations",
  359. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  360. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  361. .product(name: "GULNSData", package: "GoogleUtilities"),
  362. .product(name: "GULNetwork", package: "GoogleUtilities"),
  363. .product(name: "nanopb", package: "nanopb"),
  364. ],
  365. path: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  366. linkerSettings: [
  367. .linkedLibrary("sqlite3"),
  368. .linkedLibrary("c++"),
  369. .linkedLibrary("z"),
  370. .linkedFramework("StoreKit"),
  371. ]
  372. ),
  373. .target(
  374. name: "FirebaseAnalyticsOnDeviceConversionTarget",
  375. dependencies: [
  376. .product(name: "GoogleAppMeasurementOnDeviceConversion",
  377. package: "GoogleAppMeasurement",
  378. condition: .when(platforms: [.iOS])),
  379. ],
  380. path: "FirebaseAnalyticsOnDeviceConversionWrapper",
  381. linkerSettings: [
  382. .linkedLibrary("c++"),
  383. ]
  384. ),
  385. .target(
  386. name: "FirebaseAppDistributionTarget",
  387. dependencies: [.target(name: "FirebaseAppDistribution",
  388. condition: .when(platforms: [.iOS]))],
  389. path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
  390. ),
  391. .target(
  392. name: "FirebaseAppDistribution",
  393. dependencies: [
  394. "FirebaseCore",
  395. "FirebaseInstallations",
  396. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  397. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  398. ],
  399. path: "FirebaseAppDistribution/Sources",
  400. publicHeadersPath: "Public",
  401. cSettings: [
  402. .headerSearchPath("../../"),
  403. ]
  404. ),
  405. .testTarget(
  406. name: "AppDistributionUnit",
  407. dependencies: ["FirebaseAppDistribution", .product(name: "OCMock", package: "ocmock")],
  408. path: "FirebaseAppDistribution/Tests/Unit",
  409. exclude: ["Swift/"],
  410. resources: [.process("Resources")],
  411. cSettings: [
  412. .headerSearchPath("../../.."),
  413. ]
  414. ),
  415. .testTarget(
  416. name: "AppDistributionUnitSwift",
  417. dependencies: ["FirebaseAppDistribution"],
  418. path: "FirebaseAppDistribution/Tests/Unit/Swift",
  419. cSettings: [
  420. .headerSearchPath("../../../.."),
  421. ]
  422. ),
  423. .target(
  424. name: "FirebaseAuth",
  425. dependencies: [
  426. "FirebaseAppCheckInterop",
  427. "FirebaseAuthInterop",
  428. "FirebaseAuthInternal",
  429. "FirebaseCore",
  430. "FirebaseCoreExtension",
  431. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  432. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  433. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  434. .product(name: "RecaptchaInterop", package: "interop-ios-for-google-sdks"),
  435. ],
  436. path: "FirebaseAuth/Sources/Swift",
  437. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  438. linkerSettings: [
  439. .linkedFramework("Security"),
  440. .linkedFramework("SafariServices", .when(platforms: [.iOS])),
  441. ]
  442. ),
  443. .target(
  444. name: "FirebaseAuthInternal",
  445. path: "FirebaseAuth/Sources",
  446. exclude: [
  447. "Swift",
  448. ],
  449. publicHeadersPath: "Public",
  450. cSettings: [
  451. .headerSearchPath("../../"),
  452. ]
  453. ),
  454. // Internal headers only for consuming from Swift.
  455. .target(
  456. name: "FirebaseAuthInterop",
  457. path: "FirebaseAuth/Interop",
  458. exclude: [
  459. "CMakeLists.txt",
  460. ],
  461. publicHeadersPath: "Public",
  462. cSettings: [
  463. .headerSearchPath("../../"),
  464. ]
  465. ),
  466. .testTarget(
  467. name: "AuthUnit",
  468. dependencies: [
  469. "FirebaseAuth",
  470. ],
  471. path: "FirebaseAuth/Tests/Unit",
  472. exclude: [
  473. // TODO: these tests rely on a non-zero UIApplication.shared. They run from CocoaPods.
  474. "PhoneAuthProviderTests.swift",
  475. "AuthNotificationManagerTests.swift",
  476. "ObjCAPITests.m", // Only builds via CocoaPods until mixed language or its own target.
  477. "ObjCGlobalTests.m", // Only builds via CocoaPods until mixed language or its own target.
  478. ]
  479. ),
  480. .target(
  481. name: "FirebaseAuthCombineSwift",
  482. dependencies: ["FirebaseAuth"],
  483. path: "FirebaseCombineSwift/Sources/Auth"
  484. ),
  485. .target(
  486. name: "FirebaseFirestoreCombineSwift",
  487. dependencies: [
  488. "FirebaseFirestoreTarget",
  489. "FirebaseFirestoreSwift",
  490. ],
  491. path: "FirebaseCombineSwift/Sources/Firestore"
  492. ),
  493. .target(
  494. name: "FirebaseStorageCombineSwift",
  495. dependencies: [
  496. "FirebaseStorage",
  497. ],
  498. path: "FirebaseCombineSwift/Sources/Storage"
  499. ),
  500. .target(
  501. name: "FirebaseCrashlytics",
  502. dependencies: [
  503. "FirebaseCore",
  504. "FirebaseInstallations",
  505. "FirebaseSessions",
  506. "FirebaseRemoteConfigInterop",
  507. "FirebaseCrashlyticsSwift",
  508. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  509. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  510. .product(name: "FBLPromises", package: "Promises"),
  511. .product(name: "nanopb", package: "nanopb"),
  512. ],
  513. path: "Crashlytics",
  514. exclude: [
  515. "run",
  516. "CHANGELOG.md",
  517. "LICENSE",
  518. "README.md",
  519. "ProtoSupport/",
  520. "UnitTests/",
  521. "generate_project.sh",
  522. "upload-symbols",
  523. "CrashlyticsInputFiles.xcfilelist",
  524. "third_party/libunwind/LICENSE",
  525. "Crashlytics/Rollouts/",
  526. ],
  527. sources: [
  528. "Crashlytics/",
  529. "Protogen/",
  530. "Shared/",
  531. "third_party/libunwind/dwarf.h",
  532. ],
  533. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  534. publicHeadersPath: "Crashlytics/Public",
  535. cSettings: [
  536. .headerSearchPath(".."),
  537. .define("DISPLAY_VERSION", to: firebaseVersion),
  538. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  539. .define(
  540. "CLS_SDK_NAME",
  541. to: "Crashlytics macOS SDK",
  542. .when(platforms: [.macOS, .macCatalyst])
  543. ),
  544. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  545. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  546. .define("PB_FIELD_32BIT", to: "1"),
  547. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  548. .define("PB_ENABLE_MALLOC", to: "1"),
  549. ],
  550. linkerSettings: [
  551. .linkedFramework("Security"),
  552. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  553. ]
  554. ),
  555. .target(
  556. name: "FirebaseCrashlyticsSwift",
  557. dependencies: ["FirebaseRemoteConfigInterop"],
  558. path: "Crashlytics",
  559. sources: [
  560. "Crashlytics/Rollouts/",
  561. ]
  562. ),
  563. .testTarget(
  564. name: "FirebaseCrashlyticsSwiftUnit",
  565. dependencies: ["FirebaseCrashlyticsSwift"],
  566. path: "Crashlytics/UnitTestsSwift/"
  567. ),
  568. .testTarget(
  569. name: "FirebaseCrashlyticsUnit",
  570. dependencies: ["FirebaseCrashlytics", .product(name: "OCMock", package: "ocmock")],
  571. path: "Crashlytics/UnitTests",
  572. resources: [
  573. .copy("FIRCLSMachO/machO_data"),
  574. .copy("Data"),
  575. ],
  576. cSettings: [
  577. .headerSearchPath("../.."),
  578. .define("DISPLAY_VERSION", to: firebaseVersion),
  579. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  580. .define(
  581. "CLS_SDK_NAME",
  582. to: "Crashlytics macOS SDK",
  583. .when(platforms: [.macOS, .macCatalyst])
  584. ),
  585. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  586. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  587. ]
  588. ),
  589. .target(
  590. name: "FirebaseDatabaseInternal",
  591. dependencies: [
  592. "FirebaseAppCheckInterop",
  593. "FirebaseCore",
  594. "leveldb",
  595. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  596. ],
  597. path: "FirebaseDatabase/Sources",
  598. exclude: [
  599. "third_party/Wrap-leveldb/LICENSE",
  600. "third_party/SocketRocket/LICENSE",
  601. "third_party/FImmutableSortedDictionary/LICENSE",
  602. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  603. ],
  604. publicHeadersPath: "Public",
  605. cSettings: [
  606. .headerSearchPath("../../"),
  607. ],
  608. linkerSettings: [
  609. .linkedFramework("CFNetwork"),
  610. .linkedFramework("Security"),
  611. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  612. .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
  613. ]
  614. ),
  615. .testTarget(
  616. name: "DatabaseUnit",
  617. dependencies: [
  618. "FirebaseDatabase",
  619. "SharedTestUtilities",
  620. .product(name: "OCMock", package: "ocmock"),
  621. ],
  622. path: "FirebaseDatabase/Tests/",
  623. exclude: [
  624. // Disable Swift tests as mixed targets are not supported (Xcode 12.4).
  625. "Unit/Swift",
  626. "Integration/",
  627. ],
  628. resources: [.process("Resources")],
  629. cSettings: [
  630. .headerSearchPath("../.."),
  631. ]
  632. ),
  633. .testTarget(
  634. name: "DatabaseUnitSwift",
  635. dependencies: ["FirebaseDatabase"],
  636. path: "FirebaseDatabase/Tests/Unit/Swift",
  637. cSettings: [
  638. .headerSearchPath("../.."),
  639. ]
  640. ),
  641. .target(
  642. name: "FirebaseDatabase",
  643. dependencies: ["FirebaseDatabaseInternal", "FirebaseSharedSwift"],
  644. path: "FirebaseDatabase/Swift/Sources"
  645. ),
  646. .target(
  647. name: "FirebaseDatabaseSwift",
  648. dependencies: ["FirebaseDatabase"],
  649. path: "FirebaseDatabaseSwift/Sources"
  650. ),
  651. .testTarget(
  652. name: "FirebaseDatabaseSwiftTests",
  653. dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
  654. path: "FirebaseDatabaseSwift/Tests/"
  655. ),
  656. .target(
  657. name: "FirebaseSharedSwift",
  658. path: "FirebaseSharedSwift/Sources",
  659. exclude: [
  660. "third_party/FirebaseDataEncoder/LICENSE",
  661. "third_party/FirebaseDataEncoder/METADATA",
  662. ]
  663. ),
  664. .testTarget(
  665. name: "FirebaseSharedSwiftTests",
  666. dependencies: ["FirebaseSharedSwift"],
  667. path: "FirebaseSharedSwift/Tests/"
  668. ),
  669. .target(
  670. name: "FirebaseDynamicLinksTarget",
  671. dependencies: [.target(name: "FirebaseDynamicLinks",
  672. condition: .when(platforms: [.iOS]))],
  673. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  674. ),
  675. .target(
  676. name: "FirebaseDynamicLinks",
  677. dependencies: ["FirebaseCore"],
  678. path: "FirebaseDynamicLinks/Sources",
  679. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  680. publicHeadersPath: "Public",
  681. cSettings: [
  682. .headerSearchPath("../../"),
  683. .define("FIRDynamicLinks3P", to: "1"),
  684. .define("GIN_SCION_LOGGING", to: "1"),
  685. ],
  686. linkerSettings: [
  687. .linkedFramework("QuartzCore"),
  688. ]
  689. ),
  690. firestoreWrapperTarget(),
  691. .target(
  692. name: "FirebaseFirestoreSwiftTarget",
  693. dependencies: [.target(name: "FirebaseFirestoreSwift",
  694. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS,
  695. .firebaseVisionOS]))],
  696. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  697. ),
  698. .target(
  699. name: "FirebaseFirestoreSwift",
  700. dependencies: [
  701. "FirebaseFirestoreTarget",
  702. ],
  703. path: "FirebaseFirestoreSwift/Sources"
  704. ),
  705. // MARK: - Firebase Functions
  706. .target(
  707. name: "FirebaseFunctions",
  708. dependencies: [
  709. "FirebaseAppCheckInterop",
  710. "FirebaseAuthInterop",
  711. "FirebaseCore",
  712. "FirebaseCoreExtension",
  713. "FirebaseMessagingInterop",
  714. "FirebaseSharedSwift",
  715. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  716. ],
  717. path: "FirebaseFunctions/Sources"
  718. ),
  719. .testTarget(
  720. name: "FirebaseFunctionsUnit",
  721. dependencies: ["FirebaseFunctions",
  722. "FirebaseAppCheckInterop",
  723. "FirebaseAuthInterop",
  724. "FirebaseMessagingInterop",
  725. "SharedTestUtilities"],
  726. path: "FirebaseFunctions/Tests/Unit",
  727. cSettings: [
  728. .headerSearchPath("../../../"),
  729. ]
  730. ),
  731. .testTarget(
  732. name: "FirebaseFunctionsIntegration",
  733. dependencies: ["FirebaseFunctions",
  734. "SharedTestUtilities"],
  735. path: "FirebaseFunctions/Tests/Integration"
  736. ),
  737. .testTarget(
  738. name: "FirebaseFunctionsObjCIntegration",
  739. dependencies: ["FirebaseFunctions",
  740. "SharedTestUtilities"],
  741. path: "FirebaseFunctions/Tests/ObjCIntegration",
  742. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  743. exclude: [
  744. "ObjCPPAPITests.mm",
  745. ],
  746. cSettings: [
  747. .headerSearchPath("../../.."),
  748. ]
  749. ),
  750. .target(
  751. name: "FirebaseFunctionsCombineSwift",
  752. dependencies: ["FirebaseFunctions"],
  753. path: "FirebaseCombineSwift/Sources/Functions"
  754. ),
  755. .testTarget(
  756. name: "FunctionsCombineUnit",
  757. dependencies: ["FirebaseFunctionsCombineSwift",
  758. "SharedTestUtilities"],
  759. path: "FirebaseFunctions/Tests/CombineUnit"
  760. ),
  761. // MARK: - Firebase In App Messaging
  762. .target(
  763. name: "FirebaseInAppMessagingTarget",
  764. dependencies: [
  765. .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
  766. ],
  767. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  768. ),
  769. .target(
  770. name: "FirebaseInAppMessagingInternal",
  771. dependencies: [
  772. "FirebaseCore",
  773. "FirebaseInstallations",
  774. "FirebaseABTesting",
  775. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  776. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  777. .product(name: "nanopb", package: "nanopb"),
  778. .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
  779. ],
  780. path: "FirebaseInAppMessaging/Sources",
  781. exclude: [
  782. "DefaultUI/CHANGELOG.md",
  783. "DefaultUI/README.md",
  784. ],
  785. publicHeadersPath: "Public",
  786. cSettings: [
  787. .headerSearchPath("../../"),
  788. .define("PB_FIELD_32BIT", to: "1"),
  789. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  790. .define("PB_ENABLE_MALLOC", to: "1"),
  791. ]
  792. ),
  793. .target(
  794. name: "FirebaseInAppMessaging_iOS",
  795. path: "FirebaseInAppMessaging/iOS",
  796. resources: [.process("Resources")]
  797. ),
  798. .target(
  799. name: "FirebaseInAppMessaging",
  800. dependencies: ["FirebaseInAppMessagingInternal"],
  801. path: "FirebaseInAppMessaging/Swift/Source"
  802. ),
  803. .target(
  804. name: "FirebaseInAppMessagingSwift",
  805. dependencies: ["FirebaseInAppMessaging"],
  806. path: "FirebaseInAppMessagingSwift/Sources"
  807. ),
  808. .target(
  809. name: "FirebaseInstallations",
  810. dependencies: [
  811. "FirebaseCore",
  812. .product(name: "FBLPromises", package: "Promises"),
  813. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  814. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  815. ],
  816. path: "FirebaseInstallations/Source/Library",
  817. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  818. publicHeadersPath: "Public",
  819. cSettings: [
  820. .headerSearchPath("../../../"),
  821. ],
  822. linkerSettings: [
  823. .linkedFramework("Security"),
  824. ]
  825. ),
  826. .target(
  827. name: "FirebaseMLModelDownloader",
  828. dependencies: [
  829. "FirebaseCore",
  830. "FirebaseInstallations",
  831. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  832. .product(name: "GULLogger", package: "GoogleUtilities"),
  833. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  834. .product(name: "SwiftProtobuf", package: "swift-protobuf"),
  835. ],
  836. path: "FirebaseMLModelDownloader/Sources",
  837. exclude: [
  838. "proto/firebase_ml_log_sdk.proto",
  839. ],
  840. cSettings: [
  841. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  842. ]
  843. ),
  844. .testTarget(
  845. name: "FirebaseMLModelDownloaderUnit",
  846. dependencies: ["FirebaseMLModelDownloader"],
  847. path: "FirebaseMLModelDownloader/Tests/Unit"
  848. ),
  849. .target(
  850. name: "FirebaseMessaging",
  851. dependencies: [
  852. "FirebaseCore",
  853. "FirebaseInstallations",
  854. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  855. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  856. .product(name: "GULReachability", package: "GoogleUtilities"),
  857. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  858. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  859. .product(name: "nanopb", package: "nanopb"),
  860. ],
  861. path: "FirebaseMessaging/Sources",
  862. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  863. publicHeadersPath: "Public",
  864. cSettings: [
  865. .headerSearchPath("../../"),
  866. .define("PB_FIELD_32BIT", to: "1"),
  867. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  868. .define("PB_ENABLE_MALLOC", to: "1"),
  869. ],
  870. linkerSettings: [
  871. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  872. ]
  873. ),
  874. // Internal headers only for consuming from Swift.
  875. .target(
  876. name: "FirebaseMessagingInterop",
  877. path: "FirebaseMessaging/Interop",
  878. publicHeadersPath: ".",
  879. cSettings: [
  880. .headerSearchPath("../../"),
  881. ]
  882. ),
  883. .testTarget(
  884. name: "MessagingUnit",
  885. dependencies: [
  886. "FirebaseMessaging",
  887. "SharedTestUtilities",
  888. .product(name: "OCMock", package: "ocmock"),
  889. ],
  890. path: "FirebaseMessaging/Tests/UnitTests",
  891. exclude: [
  892. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  893. ],
  894. cSettings: [
  895. .headerSearchPath("../../.."),
  896. ]
  897. ),
  898. .target(
  899. name: "FirebasePerformanceTarget",
  900. dependencies: [.target(name: "FirebasePerformance",
  901. condition: .when(platforms: [.iOS, .tvOS, .firebaseVisionOS]))],
  902. path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
  903. ),
  904. .target(
  905. name: "FirebasePerformance",
  906. dependencies: [
  907. "FirebaseCore",
  908. "FirebaseInstallations",
  909. // Performance depends on the Obj-C target of FirebaseRemoteConfig to
  910. // avoid including Swift code from the `FirebaseRemoteConfig` target
  911. // that is unneeded.
  912. "FirebaseRemoteConfigInternal",
  913. "FirebaseSessions",
  914. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  915. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  916. .product(name: "GULISASwizzler", package: "GoogleUtilities"),
  917. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  918. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  919. .product(name: "nanopb", package: "nanopb"),
  920. ],
  921. path: "FirebasePerformance/Sources",
  922. publicHeadersPath: "Public",
  923. cSettings: [
  924. .headerSearchPath("../../"),
  925. .define("PB_FIELD_32BIT", to: "1"),
  926. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  927. .define("PB_ENABLE_MALLOC", to: "1"),
  928. .define("FIRPerformance_LIB_VERSION", to: firebaseVersion),
  929. ],
  930. linkerSettings: [
  931. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .tvOS])),
  932. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .tvOS])),
  933. .linkedFramework("QuartzCore", .when(platforms: [.iOS, .tvOS])),
  934. ]
  935. ),
  936. .testTarget(
  937. name: "PerformanceUnit",
  938. dependencies: [
  939. "FirebasePerformanceTarget",
  940. "SharedTestUtilities",
  941. "GCDWebServer",
  942. .product(name: "OCMock", package: "ocmock"),
  943. ],
  944. path: "FirebasePerformance/Tests/Unit",
  945. resources: [
  946. .process("FPRURLFilterTests-Info.plist"),
  947. .process("Server/smallDownloadFile"),
  948. .process("Server/bigDownloadFile"),
  949. ],
  950. cSettings: [
  951. .headerSearchPath("../../.."),
  952. .define("PB_FIELD_32BIT", to: "1"),
  953. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  954. .define("PB_ENABLE_MALLOC", to: "1"),
  955. ]
  956. ),
  957. .target(
  958. name: "SharedTestUtilities",
  959. dependencies: ["FirebaseCore",
  960. "FirebaseAppCheckInterop",
  961. "FirebaseAuthInterop",
  962. "FirebaseMessagingInterop",
  963. "GoogleDataTransport",
  964. .product(name: "OCMock", package: "ocmock")],
  965. path: "SharedTestUtilities",
  966. publicHeadersPath: "./",
  967. cSettings: [
  968. .headerSearchPath("../"),
  969. ]
  970. ),
  971. // MARK: - Firebase Remote Config
  972. .target(
  973. name: "FirebaseRemoteConfigInternal",
  974. dependencies: [
  975. "FirebaseCore",
  976. "FirebaseABTesting",
  977. "FirebaseInstallations",
  978. "FirebaseRemoteConfigInterop",
  979. .product(name: "GULNSData", package: "GoogleUtilities"),
  980. ],
  981. path: "FirebaseRemoteConfig/Sources",
  982. publicHeadersPath: "Public",
  983. cSettings: [
  984. .headerSearchPath("../../"),
  985. ]
  986. ),
  987. .testTarget(
  988. name: "RemoteConfigUnit",
  989. dependencies: ["FirebaseRemoteConfigInternal", .product(name: "OCMock", package: "ocmock")],
  990. path: "FirebaseRemoteConfig/Tests/Unit",
  991. exclude: [
  992. // Need to be evaluated/ported to RC V2.
  993. "RCNConfigAnalyticsTest.m",
  994. "RCNConfigSettingsTest.m",
  995. "RCNConfigTest.m",
  996. "RCNRemoteConfig+FIRAppTest.m",
  997. "RCNThrottlingTests.m",
  998. ],
  999. resources: [
  1000. .process("SecondApp-GoogleService-Info.plist"),
  1001. .process("Defaults-testInfo.plist"),
  1002. .process("TestABTPayload.txt"),
  1003. ],
  1004. cSettings: [
  1005. .headerSearchPath("../../.."),
  1006. ]
  1007. ),
  1008. .testTarget(
  1009. name: "RemoteConfigSwiftUnit",
  1010. dependencies: ["FirebaseRemoteConfigInternal"],
  1011. path: "FirebaseRemoteConfig/Tests/SwiftUnit",
  1012. cSettings: [
  1013. .headerSearchPath("../../.."),
  1014. ]
  1015. ),
  1016. .target(
  1017. name: "FirebaseRemoteConfig",
  1018. dependencies: [
  1019. "FirebaseRemoteConfigInternal",
  1020. "FirebaseSharedSwift",
  1021. ],
  1022. path: "FirebaseRemoteConfig/Swift",
  1023. resources: [.process("Resources/PrivacyInfo.xcprivacy")]
  1024. ),
  1025. .target(
  1026. name: "FirebaseRemoteConfigSwift",
  1027. dependencies: [
  1028. "FirebaseRemoteConfig",
  1029. ],
  1030. path: "FirebaseRemoteConfigSwift/Sources"
  1031. ),
  1032. .testTarget(
  1033. name: "RemoteConfigFakeConsole",
  1034. dependencies: ["FirebaseRemoteConfig",
  1035. "FirebaseRemoteConfigSwift",
  1036. "RemoteConfigFakeConsoleObjC"],
  1037. path: "FirebaseRemoteConfigSwift/Tests",
  1038. exclude: [
  1039. "AccessToken.json",
  1040. "README.md",
  1041. "ObjC/",
  1042. ],
  1043. resources: [
  1044. .process("Defaults-testInfo.plist"),
  1045. ],
  1046. cSettings: [
  1047. .headerSearchPath("../../"),
  1048. ]
  1049. ),
  1050. .target(
  1051. name: "RemoteConfigFakeConsoleObjC",
  1052. dependencies: [.product(name: "OCMock", package: "ocmock")],
  1053. path: "FirebaseRemoteConfigSwift/Tests/ObjC",
  1054. publicHeadersPath: ".",
  1055. cSettings: [
  1056. .headerSearchPath("../../../"),
  1057. ]
  1058. ),
  1059. // Internal headers only for consuming from other SDK.
  1060. .target(
  1061. name: "FirebaseRemoteConfigInterop",
  1062. path: "FirebaseRemoteConfig/Interop",
  1063. publicHeadersPath: ".",
  1064. cSettings: [
  1065. .headerSearchPath("../../"),
  1066. ]
  1067. ),
  1068. // MARK: - Firebase Sessions
  1069. .target(
  1070. name: "FirebaseSessions",
  1071. dependencies: [
  1072. "FirebaseCore",
  1073. "FirebaseInstallations",
  1074. "FirebaseCoreExtension",
  1075. "FirebaseSessionsObjC",
  1076. .product(name: "Promises", package: "Promises"),
  1077. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  1078. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1079. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  1080. ],
  1081. path: "FirebaseSessions/Sources",
  1082. cSettings: [
  1083. .headerSearchPath(".."),
  1084. .define("DISPLAY_VERSION", to: firebaseVersion),
  1085. .define("PB_FIELD_32BIT", to: "1"),
  1086. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  1087. .define("PB_ENABLE_MALLOC", to: "1"),
  1088. ],
  1089. linkerSettings: [
  1090. .linkedFramework("Security"),
  1091. .linkedFramework(
  1092. "SystemConfiguration",
  1093. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1094. ),
  1095. ]
  1096. ),
  1097. // The Sessions SDK is Swift-first with Objective-C code to support
  1098. // nanopb. Because Swift Package Manager doesn't support mixed
  1099. // language targets, the ObjC code has been extracted out into
  1100. // a separate target.
  1101. .target(
  1102. name: "FirebaseSessionsObjC",
  1103. dependencies: [
  1104. "FirebaseCore",
  1105. "FirebaseCoreExtension",
  1106. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1107. .product(name: "nanopb", package: "nanopb"),
  1108. ],
  1109. path: "FirebaseSessions",
  1110. exclude: [
  1111. "README.md",
  1112. "Sources/",
  1113. "Tests/",
  1114. "ProtoSupport/",
  1115. "generate_project.sh",
  1116. "generate_protos.sh",
  1117. "generate_testapp.sh",
  1118. ],
  1119. publicHeadersPath: "SourcesObjC",
  1120. cSettings: [
  1121. .headerSearchPath(".."),
  1122. .define("DISPLAY_VERSION", to: firebaseVersion),
  1123. .define("PB_FIELD_32BIT", to: "1"),
  1124. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  1125. .define("PB_ENABLE_MALLOC", to: "1"),
  1126. ],
  1127. linkerSettings: [
  1128. .linkedFramework("Security"),
  1129. .linkedFramework(
  1130. "SystemConfiguration",
  1131. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1132. ),
  1133. ]
  1134. ),
  1135. .testTarget(
  1136. name: "FirebaseSessionsUnit",
  1137. dependencies: ["FirebaseSessions"],
  1138. path: "FirebaseSessions/Tests/Unit"
  1139. ),
  1140. // MARK: - Firebase Storage
  1141. .target(
  1142. name: "FirebaseStorage",
  1143. dependencies: [
  1144. "FirebaseAppCheckInterop",
  1145. "FirebaseAuthInterop",
  1146. "FirebaseCore",
  1147. "FirebaseCoreExtension",
  1148. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  1149. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1150. ],
  1151. path: "FirebaseStorage/Sources"
  1152. ),
  1153. .testTarget(
  1154. name: "FirebaseStorageUnit",
  1155. dependencies: ["FirebaseStorage",
  1156. "SharedTestUtilities"],
  1157. path: "FirebaseStorage/Tests/Unit",
  1158. cSettings: [
  1159. .headerSearchPath("../../../"),
  1160. ]
  1161. ),
  1162. .testTarget(
  1163. name: "StorageObjCIntegration",
  1164. dependencies: ["FirebaseStorage"],
  1165. path: "FirebaseStorage/Tests/ObjCIntegration",
  1166. exclude: [
  1167. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  1168. "FIRStorageIntegrationTests.m",
  1169. "ObjCPPAPITests.mm",
  1170. "Credentials.h",
  1171. ],
  1172. cSettings: [
  1173. .headerSearchPath("../../.."),
  1174. ]
  1175. ),
  1176. .testTarget(
  1177. name: "swift-test",
  1178. dependencies: [
  1179. "Firebase",
  1180. "FirebaseAuth",
  1181. "FirebaseAppCheck",
  1182. "FirebaseABTesting",
  1183. "FirebaseAnalytics",
  1184. "FirebaseAnalyticsSwift",
  1185. .target(name: "FirebaseAppDistribution",
  1186. condition: .when(platforms: [.iOS])),
  1187. "FirebaseAuthCombineSwift",
  1188. "FirebaseFirestoreCombineSwift",
  1189. "FirebaseFunctionsCombineSwift",
  1190. "FirebaseStorageCombineSwift",
  1191. "FirebaseCrashlytics",
  1192. "FirebaseCore",
  1193. "FirebaseDatabase",
  1194. "FirebaseDynamicLinks",
  1195. "FirebaseFirestoreTarget",
  1196. "FirebaseFirestoreSwift",
  1197. "FirebaseFunctions",
  1198. .target(name: "FirebaseInAppMessaging",
  1199. condition: .when(platforms: [.iOS, .tvOS])),
  1200. .target(name: "FirebaseInAppMessagingSwift",
  1201. condition: .when(platforms: [.iOS, .tvOS])),
  1202. "FirebaseInstallations",
  1203. "FirebaseMessaging",
  1204. .target(name: "FirebasePerformance",
  1205. condition: .when(platforms: [.iOS, .tvOS])),
  1206. "FirebaseRemoteConfig",
  1207. "FirebaseSessions",
  1208. "FirebaseStorage",
  1209. .product(name: "nanopb", package: "nanopb"),
  1210. ],
  1211. path: "SwiftPMTests/swift-test"
  1212. ),
  1213. .testTarget(
  1214. name: "analytics-import-test",
  1215. dependencies: [
  1216. "FirebaseAnalyticsSwiftTarget",
  1217. "FirebaseAnalyticsWrapper",
  1218. "Firebase",
  1219. ],
  1220. path: "SwiftPMTests/analytics-import-test"
  1221. ),
  1222. .testTarget(
  1223. name: "objc-import-test",
  1224. dependencies: [
  1225. "Firebase",
  1226. "FirebaseAuth",
  1227. "FirebaseABTesting",
  1228. "FirebaseAppCheck",
  1229. .target(name: "FirebaseAppDistribution",
  1230. condition: .when(platforms: [.iOS])),
  1231. "FirebaseCrashlytics",
  1232. "FirebaseCore",
  1233. "FirebaseDatabase",
  1234. "FirebaseDynamicLinks",
  1235. "FirebaseFirestoreTarget",
  1236. "FirebaseFunctions",
  1237. .target(name: "FirebaseInAppMessaging",
  1238. condition: .when(platforms: [.iOS, .tvOS])),
  1239. "FirebaseInstallations",
  1240. "FirebaseMessaging",
  1241. .target(name: "FirebasePerformance",
  1242. condition: .when(platforms: [.iOS, .tvOS])),
  1243. "FirebaseRemoteConfig",
  1244. "FirebaseStorage",
  1245. ],
  1246. path: "SwiftPMTests/objc-import-test"
  1247. ),
  1248. .testTarget(
  1249. name: "version-test",
  1250. dependencies: [
  1251. "FirebaseCore",
  1252. ],
  1253. path: "SwiftPMTests/version-test",
  1254. cSettings: [
  1255. .define("FIR_VERSION", to: firebaseVersion),
  1256. ]
  1257. ),
  1258. // MARK: - Firebase App Check
  1259. .target(name: "FirebaseAppCheck",
  1260. dependencies: [
  1261. "FirebaseAppCheckInterop",
  1262. "FirebaseCore",
  1263. .product(name: "AppCheckCore", package: "app-check"),
  1264. .product(name: "FBLPromises", package: "Promises"),
  1265. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1266. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  1267. ],
  1268. path: "FirebaseAppCheck/Sources",
  1269. publicHeadersPath: "Public",
  1270. cSettings: [
  1271. .headerSearchPath("../.."),
  1272. ],
  1273. linkerSettings: [
  1274. .linkedFramework(
  1275. "DeviceCheck",
  1276. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1277. ),
  1278. ]),
  1279. // Internal headers only for consuming from Swift.
  1280. .target(
  1281. name: "FirebaseAppCheckInterop",
  1282. path: "FirebaseAppCheck/Interop",
  1283. exclude: [
  1284. "CMakeLists.txt",
  1285. ],
  1286. publicHeadersPath: "Public",
  1287. cSettings: [
  1288. .headerSearchPath("../../"),
  1289. ]
  1290. ),
  1291. .testTarget(
  1292. name: "FirebaseAppCheckUnit",
  1293. dependencies: [
  1294. "FirebaseAppCheck",
  1295. "SharedTestUtilities",
  1296. .product(name: "OCMock", package: "ocmock"),
  1297. ],
  1298. path: "FirebaseAppCheck/Tests/Unit",
  1299. exclude: [
  1300. // Swift tests are in the target `FirebaseAppCheckUnitSwift` since mixed language targets
  1301. // are not supported (as of Xcode 15.0).
  1302. "Swift",
  1303. ],
  1304. cSettings: [
  1305. .headerSearchPath("../../.."),
  1306. ]
  1307. ),
  1308. .testTarget(
  1309. name: "FirebaseAppCheckUnitSwift",
  1310. dependencies: ["FirebaseAppCheck"],
  1311. path: "FirebaseAppCheck/Tests/Unit/Swift"
  1312. ),
  1313. // MARK: Testing support
  1314. .target(
  1315. name: "FirebaseFirestoreTestingSupport",
  1316. dependencies: ["FirebaseFirestoreTarget"],
  1317. path: "FirebaseTestingSupport/Firestore/Sources",
  1318. publicHeadersPath: "./",
  1319. cSettings: [
  1320. .headerSearchPath("../../.."),
  1321. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  1322. ]
  1323. ),
  1324. .testTarget(
  1325. name: "FirestoreTestingSupportTests",
  1326. dependencies: ["FirebaseFirestoreTestingSupport"],
  1327. path: "FirebaseTestingSupport/Firestore/Tests",
  1328. cSettings: [
  1329. .headerSearchPath("../../.."),
  1330. ]
  1331. ),
  1332. // MARK: - Firebase Vertex AI
  1333. .target(
  1334. name: "FirebaseVertexAI",
  1335. dependencies: [
  1336. "FirebaseAppCheckInterop",
  1337. "FirebaseAuthInterop",
  1338. "FirebaseCore",
  1339. "FirebaseCoreExtension",
  1340. ],
  1341. path: "FirebaseVertexAI/Sources"
  1342. ),
  1343. .testTarget(
  1344. name: "FirebaseVertexAIUnit",
  1345. dependencies: ["FirebaseVertexAI", "SharedTestUtilities"],
  1346. path: "FirebaseVertexAI/Tests/Unit",
  1347. resources: [
  1348. .process("CountTokenResponses"),
  1349. .process("GenerateContentResponses"),
  1350. ],
  1351. cSettings: [
  1352. .headerSearchPath("../../../"),
  1353. ]
  1354. ),
  1355. ] + firestoreTargets(),
  1356. cLanguageStandard: .c99,
  1357. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  1358. )
  1359. // MARK: - Helper Functions
  1360. func googleAppMeasurementDependency() -> Package.Dependency {
  1361. let appMeasurementURL = "https://github.com/google/GoogleAppMeasurement.git"
  1362. // Point SPM CI to the tip of main of https://github.com/google/GoogleAppMeasurement so that the
  1363. // release process can defer publishing the GoogleAppMeasurement tag until after testing.
  1364. if ProcessInfo.processInfo.environment["FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT"] != nil {
  1365. return .package(url: appMeasurementURL, branch: "main")
  1366. }
  1367. return .package(url: appMeasurementURL, exact: "10.27.0")
  1368. }
  1369. func abseilDependency() -> Package.Dependency {
  1370. let packageInfo: (url: String, range: Range<Version>)
  1371. // If building Firestore from source, abseil will need to be built as source
  1372. // as the headers in the binary version of abseil are unusable.
  1373. if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
  1374. packageInfo = (
  1375. "https://github.com/firebase/abseil-cpp-SwiftPM.git",
  1376. "0.20240116.1" ..< "0.20240117.0"
  1377. )
  1378. } else {
  1379. packageInfo = (
  1380. "https://github.com/google/abseil-cpp-binary.git",
  1381. "1.2024011601.1" ..< "1.2024011700.0"
  1382. )
  1383. }
  1384. return .package(url: packageInfo.url, packageInfo.range)
  1385. }
  1386. func grpcDependency() -> Package.Dependency {
  1387. let packageInfo: (url: String, range: Range<Version>)
  1388. // If building Firestore from source, abseil will need to be built as source
  1389. // as the headers in the binary version of abseil are unusable.
  1390. if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
  1391. packageInfo = ("https://github.com/grpc/grpc-ios.git", "1.62.3" ..< "1.63.0")
  1392. } else {
  1393. packageInfo = ("https://github.com/google/grpc-binary.git", "1.62.2" ..< "1.63.0")
  1394. }
  1395. return .package(url: packageInfo.url, packageInfo.range)
  1396. }
  1397. func firestoreWrapperTarget() -> Target {
  1398. if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
  1399. return .target(
  1400. name: "FirebaseFirestoreTarget",
  1401. dependencies: [.target(name: "FirebaseFirestore",
  1402. condition: .when(platforms: [.iOS, .tvOS, .macOS,
  1403. .firebaseVisionOS]))],
  1404. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  1405. )
  1406. }
  1407. return .target(
  1408. name: "FirebaseFirestoreTarget",
  1409. dependencies: [.target(name: "FirebaseFirestore",
  1410. condition: .when(platforms: [.iOS, .tvOS, .macOS, .macCatalyst]))],
  1411. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap",
  1412. cSettings: [.define("FIREBASE_BINARY_FIRESTORE", to: "1")]
  1413. )
  1414. }
  1415. func firestoreTargets() -> [Target] {
  1416. if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
  1417. return [
  1418. .target(
  1419. name: "FirebaseFirestoreInternalWrapper",
  1420. dependencies: [
  1421. "FirebaseAppCheckInterop",
  1422. "FirebaseCore",
  1423. "leveldb",
  1424. .product(name: "nanopb", package: "nanopb"),
  1425. .product(name: "abseil", package: "abseil-cpp-SwiftPM"),
  1426. .product(name: "gRPC-cpp", package: "grpc-ios"),
  1427. ],
  1428. path: "Firestore",
  1429. exclude: [
  1430. "CHANGELOG.md",
  1431. "CMakeLists.txt",
  1432. "Example/",
  1433. "LICENSE",
  1434. "Protos/CMakeLists.txt",
  1435. "Protos/Podfile",
  1436. "Protos/README.md",
  1437. "Protos/build_protos.py",
  1438. "Protos/cpp/",
  1439. "Protos/lib/",
  1440. "Protos/nanopb_cpp_generator.py",
  1441. "Protos/protos/",
  1442. "README.md",
  1443. "Source/CMakeLists.txt",
  1444. "Swift/",
  1445. "core/CMakeLists.txt",
  1446. "core/src/util/config_detected.h.in",
  1447. "core/test/",
  1448. "fuzzing/",
  1449. "test.sh",
  1450. // Swift PM doesn't recognize hpp files, so we're relying on search paths
  1451. // to find third_party/nlohmann_json/json.hpp.
  1452. "third_party/",
  1453. // Exclude alternate implementations for other platforms
  1454. "core/src/remote/connectivity_monitor_noop.cc",
  1455. "core/src/util/filesystem_win.cc",
  1456. "core/src/util/log_stdio.cc",
  1457. "core/src/util/secure_random_openssl.cc",
  1458. ],
  1459. sources: [
  1460. "Source/",
  1461. "Protos/nanopb/",
  1462. "core/include/",
  1463. "core/src",
  1464. ],
  1465. publicHeadersPath: "Source/Public",
  1466. cSettings: [
  1467. .headerSearchPath("../"),
  1468. .headerSearchPath("Source/Public/FirebaseFirestore"),
  1469. .headerSearchPath("Protos/nanopb"),
  1470. .define("PB_FIELD_32BIT", to: "1"),
  1471. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  1472. .define("PB_ENABLE_MALLOC", to: "1"),
  1473. .define("FIRFirestore_VERSION", to: firebaseVersion),
  1474. ],
  1475. linkerSettings: [
  1476. .linkedFramework(
  1477. "SystemConfiguration",
  1478. .when(platforms: [.iOS, .macOS, .tvOS, .firebaseVisionOS])
  1479. ),
  1480. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS, .firebaseVisionOS])),
  1481. .linkedLibrary("c++"),
  1482. ]
  1483. ),
  1484. .target(
  1485. name: "FirebaseFirestore",
  1486. dependencies: [
  1487. "FirebaseCore",
  1488. "FirebaseCoreExtension",
  1489. "FirebaseFirestoreInternalWrapper",
  1490. "FirebaseSharedSwift",
  1491. ],
  1492. path: "Firestore",
  1493. exclude: [
  1494. "CHANGELOG.md",
  1495. "CMakeLists.txt",
  1496. "Example/",
  1497. "LICENSE",
  1498. "Protos/",
  1499. "README.md",
  1500. "Source/",
  1501. "core/",
  1502. "fuzzing/",
  1503. "test.sh",
  1504. "Swift/CHANGELOG.md",
  1505. "Swift/Tests/",
  1506. "third_party/nlohmann_json",
  1507. ],
  1508. sources: [
  1509. "Swift/Source/",
  1510. ],
  1511. resources: [.process("Source/Resources/PrivacyInfo.xcprivacy")]
  1512. ),
  1513. ]
  1514. }
  1515. let firestoreInternalTarget: Target = {
  1516. if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil {
  1517. // This is set when running `scripts/check_firestore_symbols.sh`.
  1518. return .binaryTarget(
  1519. name: "FirebaseFirestoreInternal",
  1520. // The `xcframework` should be moved to the root of the repo.
  1521. path: "FirebaseFirestoreInternal.xcframework"
  1522. )
  1523. } else {
  1524. return .binaryTarget(
  1525. name: "FirebaseFirestoreInternal",
  1526. url: "https://dl.google.com/firebase/ios/bin/firestore/10.27.0/rc0/FirebaseFirestoreInternal.zip",
  1527. checksum: "38f6d1bb13fabca97f53c0ef5bf283b2fbbbf460eac8fa875cd3faab597097b8"
  1528. )
  1529. }
  1530. }()
  1531. return [
  1532. .target(
  1533. name: "FirebaseFirestore",
  1534. dependencies: [
  1535. .target(
  1536. name: "FirebaseFirestoreInternalWrapper",
  1537. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
  1538. ),
  1539. .product(
  1540. name: "abseil",
  1541. package: "abseil-cpp-binary",
  1542. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
  1543. ),
  1544. .product(
  1545. name: "gRPC-C++",
  1546. package: "grpc-binary",
  1547. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
  1548. ),
  1549. .product(name: "nanopb", package: "nanopb"),
  1550. "FirebaseAppCheckInterop",
  1551. "FirebaseCore",
  1552. "FirebaseCoreExtension",
  1553. "leveldb",
  1554. "FirebaseSharedSwift",
  1555. ],
  1556. path: "Firestore/Swift/Source",
  1557. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  1558. linkerSettings: [
  1559. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  1560. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  1561. .linkedLibrary("c++"),
  1562. ]
  1563. ),
  1564. .target(
  1565. name: "FirebaseFirestoreInternalWrapper",
  1566. dependencies: [.target(
  1567. name: "FirebaseFirestoreInternal",
  1568. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
  1569. )],
  1570. path: "FirebaseFirestoreInternal",
  1571. publicHeadersPath: "."
  1572. ),
  1573. firestoreInternalTarget,
  1574. ]
  1575. }
  1576. extension Platform {
  1577. // Xcode dependent value for the visionOS platform. Namespaced with
  1578. // "firebase" prefix to prevent any API collisions (such issues should not
  1579. // arise as the manifest APIs should be confined to the `Package.swift`).
  1580. static var firebaseVisionOS: Self {
  1581. #if swift(>=5.9)
  1582. // For Xcode 15, return the available `visionOS` platform.
  1583. return .visionOS
  1584. #else
  1585. // For Xcode 14, return `iOS` as visionOS is unavailable. Since all targets
  1586. // support iOS, this acts as a no-op.
  1587. return .iOS
  1588. #endif // swift(>=5.9)
  1589. }
  1590. }