Package.swift 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  1. // swift-tools-version:5.6
  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 PackageDescription
  18. import class Foundation.ProcessInfo
  19. let firebaseVersion = "10.11.0"
  20. let package = Package(
  21. name: "Firebase",
  22. platforms: [.iOS(.v11), .macCatalyst(.v13), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v7)],
  23. products: [
  24. .library(
  25. name: "FirebaseAnalytics",
  26. targets: ["FirebaseAnalyticsTarget"]
  27. ),
  28. // This library is not designed to be imported into client source code.
  29. .library(
  30. name: "FirebaseAnalyticsWithoutAdIdSupport",
  31. targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"]
  32. ),
  33. // This library is not designed to be imported into client source code.
  34. .library(
  35. name: "FirebaseAnalyticsOnDeviceConversion",
  36. targets: ["FirebaseAnalyticsOnDeviceConversionTarget"]
  37. ),
  38. .library(
  39. name: "FirebaseAnalyticsSwift",
  40. targets: ["FirebaseAnalyticsSwiftTarget"]
  41. ),
  42. .library(
  43. name: "FirebaseAuth",
  44. targets: ["FirebaseAuth"]
  45. ),
  46. .library(
  47. name: "FirebaseAppCheck",
  48. targets: ["FirebaseAppCheck"]
  49. ),
  50. .library(
  51. name: "FirebaseAppDistribution-Beta",
  52. targets: ["FirebaseAppDistributionTarget"]
  53. ),
  54. .library(
  55. name: "FirebaseAuthCombine-Community",
  56. targets: ["FirebaseAuthCombineSwift"]
  57. ),
  58. .library(
  59. name: "FirebaseFirestoreCombine-Community",
  60. targets: ["FirebaseFirestoreCombineSwift"]
  61. ),
  62. .library(
  63. name: "FirebaseFunctionsCombine-Community",
  64. targets: ["FirebaseFunctionsCombineSwift"]
  65. ),
  66. .library(
  67. name: "FirebaseStorageCombine-Community",
  68. targets: ["FirebaseStorageCombineSwift"]
  69. ),
  70. .library(
  71. name: "FirebaseCrashlytics",
  72. targets: ["FirebaseCrashlytics"]
  73. ),
  74. .library(
  75. name: "FirebaseDatabase",
  76. targets: ["FirebaseDatabase"]
  77. ),
  78. .library(
  79. name: "FirebaseDatabaseSwift",
  80. targets: ["FirebaseDatabaseSwift"]
  81. ),
  82. .library(
  83. name: "FirebaseDynamicLinks",
  84. targets: ["FirebaseDynamicLinksTarget"]
  85. ),
  86. .library(
  87. name: "FirebaseFirestore",
  88. targets: ["FirebaseFirestoreTarget"]
  89. ),
  90. .library(
  91. name: "FirebaseFirestoreSwift",
  92. targets: ["FirebaseFirestoreSwiftTarget"]
  93. ),
  94. .library(
  95. name: "FirebaseFunctions",
  96. targets: ["FirebaseFunctions"]
  97. ),
  98. .library(
  99. name: "FirebaseInAppMessaging-Beta",
  100. targets: ["FirebaseInAppMessagingTarget"]
  101. ),
  102. .library(
  103. name: "FirebaseInAppMessagingSwift-Beta",
  104. targets: ["FirebaseInAppMessagingSwift"]
  105. ),
  106. .library(
  107. name: "FirebaseInstallations",
  108. targets: ["FirebaseInstallations"]
  109. ),
  110. .library(
  111. name: "FirebaseMessaging",
  112. targets: ["FirebaseMessaging"]
  113. ),
  114. .library(
  115. name: "FirebaseMLModelDownloader",
  116. targets: ["FirebaseMLModelDownloader"]
  117. ),
  118. .library(
  119. name: "FirebasePerformance",
  120. targets: ["FirebasePerformanceTarget"]
  121. ),
  122. .library(
  123. name: "FirebaseRemoteConfig",
  124. targets: ["FirebaseRemoteConfig"]
  125. ),
  126. .library(
  127. name: "FirebaseRemoteConfigSwift",
  128. targets: ["FirebaseRemoteConfigSwift"]
  129. ),
  130. .library(
  131. name: "FirebaseStorage",
  132. targets: ["FirebaseStorage"]
  133. ),
  134. ],
  135. dependencies: [
  136. .package(
  137. url: "https://github.com/google/promises.git",
  138. "2.1.0" ..< "3.0.0"
  139. ),
  140. .package(
  141. url: "https://github.com/apple/swift-protobuf.git",
  142. "1.19.0" ..< "2.0.0"
  143. ),
  144. googleAppMeasurementDependency(),
  145. .package(
  146. url: "https://github.com/google/GoogleDataTransport.git",
  147. "9.2.0" ..< "10.0.0"
  148. ),
  149. .package(
  150. url: "https://github.com/google/GoogleUtilities.git",
  151. "7.11.0" ..< "8.0.0"
  152. ),
  153. .package(
  154. url: "https://github.com/google/gtm-session-fetcher.git",
  155. "2.1.0" ..< "4.0.0"
  156. ),
  157. .package(
  158. url: "https://github.com/firebase/nanopb.git",
  159. "2.30909.0" ..< "2.30910.0"
  160. ),
  161. .package(
  162. url: "https://github.com/google/abseil-cpp-binary.git",
  163. "1.2022062300.0" ..< "1.2022062400.0"
  164. ),
  165. .package(
  166. url: "https://github.com/google/grpc-binary.git",
  167. "1.50.1" ..< "1.51.0"
  168. ),
  169. .package(
  170. url: "https://github.com/erikdoe/ocmock.git",
  171. revision: "c5eeaa6dde7c308a5ce48ae4d4530462dd3a1110"
  172. ),
  173. .package(
  174. url: "https://github.com/firebase/leveldb.git",
  175. "1.22.2" ..< "1.23.0"
  176. ),
  177. .package(
  178. url: "https://github.com/SlaunchaMan/GCDWebServer.git",
  179. revision: "935e2736044e71e5341663c3cc9a335ba6867a2b"
  180. ),
  181. ],
  182. targets: [
  183. .target(
  184. name: "Firebase",
  185. path: "CoreOnly/Sources",
  186. publicHeadersPath: "./"
  187. ),
  188. .target(
  189. name: "FirebaseCore",
  190. dependencies: [
  191. "Firebase",
  192. "FirebaseCoreInternal",
  193. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  194. .product(name: "GULLogger", package: "GoogleUtilities"),
  195. ],
  196. path: "FirebaseCore/Sources",
  197. publicHeadersPath: "Public",
  198. cSettings: [
  199. .headerSearchPath("../.."),
  200. .define("Firebase_VERSION", to: firebaseVersion),
  201. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  202. ],
  203. linkerSettings: [
  204. .linkedFramework("UIKit", .when(platforms: [.iOS, .macCatalyst, .tvOS])),
  205. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  206. ]
  207. ),
  208. .testTarget(
  209. name: "CoreUnit",
  210. dependencies: [
  211. "FirebaseCore",
  212. "SharedTestUtilities",
  213. .product(name: "OCMock", package: "ocmock"),
  214. ],
  215. path: "FirebaseCore/Tests/Unit",
  216. exclude: ["Resources/GoogleService-Info.plist"],
  217. cSettings: [
  218. .headerSearchPath("../../.."),
  219. ]
  220. ),
  221. // MARK: - Firebase Core Extension
  222. // Extension of FirebaseCore for consuming by Swift product SDKs.
  223. // When depending on `FirebaseCoreExtension`, also depend on `FirebaseCore`
  224. // to avoid potential linker issues.
  225. .target(
  226. name: "FirebaseCoreExtension",
  227. path: "FirebaseCore/Extension",
  228. publicHeadersPath: ".",
  229. cSettings: [
  230. .headerSearchPath("../../"),
  231. ]
  232. ),
  233. // MARK: - Firebase Core Internal
  234. // Shared collection of APIs for internal FirebaseCore usage.
  235. .target(
  236. name: "FirebaseCoreInternal",
  237. dependencies: [
  238. .product(name: "GULNSData", package: "GoogleUtilities"),
  239. ],
  240. path: "FirebaseCore/Internal/Sources"
  241. ),
  242. .testTarget(
  243. name: "FirebaseCoreInternalTests",
  244. dependencies: [
  245. "FirebaseCoreInternal",
  246. ],
  247. path: "FirebaseCore/Internal/Tests"
  248. ),
  249. .target(
  250. name: "FirebaseABTesting",
  251. dependencies: ["FirebaseCore"],
  252. path: "FirebaseABTesting/Sources",
  253. publicHeadersPath: "Public",
  254. cSettings: [
  255. .headerSearchPath("../../"),
  256. ]
  257. ),
  258. .testTarget(
  259. name: "ABTestingUnit",
  260. dependencies: ["FirebaseABTesting", .product(name: "OCMock", package: "ocmock")],
  261. path: "FirebaseABTesting/Tests/Unit",
  262. resources: [.process("Resources")],
  263. cSettings: [
  264. .headerSearchPath("../../.."),
  265. ]
  266. ),
  267. .target(
  268. name: "FirebaseAnalyticsTarget",
  269. dependencies: [.target(name: "FirebaseAnalyticsWrapper",
  270. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  271. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
  272. ),
  273. .target(
  274. name: "FirebaseAnalyticsWrapper",
  275. dependencies: [
  276. .target(
  277. name: "FirebaseAnalytics",
  278. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  279. ),
  280. .product(name: "GoogleAppMeasurement",
  281. package: "GoogleAppMeasurement",
  282. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
  283. "FirebaseCore",
  284. "FirebaseInstallations",
  285. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  286. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  287. .product(name: "GULNSData", package: "GoogleUtilities"),
  288. .product(name: "GULNetwork", package: "GoogleUtilities"),
  289. .product(name: "nanopb", package: "nanopb"),
  290. ],
  291. path: "FirebaseAnalyticsWrapper",
  292. linkerSettings: [
  293. .linkedLibrary("sqlite3"),
  294. .linkedLibrary("c++"),
  295. .linkedLibrary("z"),
  296. .linkedFramework("StoreKit"),
  297. ]
  298. ),
  299. .binaryTarget(
  300. name: "FirebaseAnalytics",
  301. url: "https://dl.google.com/firebase/ios/swiftpm/10.11.0/FirebaseAnalytics.zip",
  302. checksum: "986032391d024536568c028890debdd1a175715be7c778863bc88a7e5a0edf7d"
  303. ),
  304. .target(
  305. name: "FirebaseAnalyticsSwiftTarget",
  306. dependencies: [.target(name: "FirebaseAnalyticsSwift",
  307. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  308. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
  309. ),
  310. .target(
  311. name: "FirebaseAnalyticsSwift",
  312. dependencies: ["FirebaseAnalyticsWrapper"],
  313. path: "FirebaseAnalyticsSwift/Sources"
  314. ),
  315. .testTarget(
  316. name: "AnalyticsSwiftUnit",
  317. dependencies: ["FirebaseAnalyticsSwift"],
  318. path: "FirebaseAnalyticsSwift/Tests/SwiftUnit"
  319. ),
  320. .testTarget(
  321. name: "AnalyticsObjCAPI",
  322. dependencies: ["FirebaseAnalyticsSwift"],
  323. path: "FirebaseAnalyticsSwift/Tests/ObjCAPI"
  324. ),
  325. .target(
  326. name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
  327. dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  328. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  329. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
  330. ),
  331. .target(
  332. name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  333. dependencies: [
  334. .target(
  335. name: "FirebaseAnalytics",
  336. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  337. ),
  338. .product(name: "GoogleAppMeasurementWithoutAdIdSupport",
  339. package: "GoogleAppMeasurement",
  340. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
  341. "FirebaseCore",
  342. "FirebaseInstallations",
  343. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  344. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  345. .product(name: "GULNSData", package: "GoogleUtilities"),
  346. .product(name: "GULNetwork", package: "GoogleUtilities"),
  347. .product(name: "nanopb", package: "nanopb"),
  348. ],
  349. path: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  350. linkerSettings: [
  351. .linkedLibrary("sqlite3"),
  352. .linkedLibrary("c++"),
  353. .linkedLibrary("z"),
  354. .linkedFramework("StoreKit"),
  355. ]
  356. ),
  357. .target(
  358. name: "FirebaseAnalyticsOnDeviceConversionTarget",
  359. dependencies: [
  360. .product(name: "GoogleAppMeasurementOnDeviceConversion",
  361. package: "GoogleAppMeasurement",
  362. condition: .when(platforms: [.iOS])),
  363. ],
  364. path: "FirebaseAnalyticsOnDeviceConversionWrapper",
  365. linkerSettings: [
  366. .linkedLibrary("c++"),
  367. ]
  368. ),
  369. .target(
  370. name: "FirebaseAppDistributionTarget",
  371. dependencies: [.target(name: "FirebaseAppDistribution",
  372. condition: .when(platforms: [.iOS]))],
  373. path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
  374. ),
  375. .target(
  376. name: "FirebaseAppDistribution",
  377. dependencies: [
  378. "FirebaseCore",
  379. "FirebaseInstallations",
  380. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  381. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  382. ],
  383. path: "FirebaseAppDistribution/Sources",
  384. publicHeadersPath: "Public",
  385. cSettings: [
  386. .headerSearchPath("../../"),
  387. ]
  388. ),
  389. .testTarget(
  390. name: "AppDistributionUnit",
  391. dependencies: ["FirebaseAppDistribution", .product(name: "OCMock", package: "ocmock")],
  392. path: "FirebaseAppDistribution/Tests/Unit",
  393. exclude: ["Swift/"],
  394. resources: [.process("Resources")],
  395. cSettings: [
  396. .headerSearchPath("../../.."),
  397. ]
  398. ),
  399. .testTarget(
  400. name: "AppDistributionUnitSwift",
  401. dependencies: ["FirebaseAppDistribution"],
  402. path: "FirebaseAppDistribution/Tests/Unit/Swift",
  403. cSettings: [
  404. .headerSearchPath("../../../.."),
  405. ]
  406. ),
  407. .target(
  408. name: "FirebaseAuth",
  409. dependencies: [
  410. "FirebaseCore",
  411. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  412. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  413. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  414. ],
  415. path: "FirebaseAuth/Sources",
  416. publicHeadersPath: "Public",
  417. cSettings: [
  418. .headerSearchPath("../../"),
  419. ],
  420. linkerSettings: [
  421. .linkedFramework("Security"),
  422. .linkedFramework("SafariServices", .when(platforms: [.iOS])),
  423. ]
  424. ),
  425. // Internal headers only for consuming from Swift.
  426. .target(
  427. name: "FirebaseAuthInterop",
  428. path: "FirebaseAuth/Interop",
  429. exclude: [
  430. "CMakeLists.txt",
  431. ],
  432. publicHeadersPath: ".",
  433. cSettings: [
  434. .headerSearchPath("../../"),
  435. ]
  436. ),
  437. .testTarget(
  438. name: "AuthUnit",
  439. dependencies: [
  440. "FirebaseAuth",
  441. .product(name: "OCMock", package: "ocmock"),
  442. ],
  443. path: "FirebaseAuth/Tests/Unit",
  444. exclude: [
  445. "FIRAuthKeychainServicesTests.m", // TODO: figure out SPM keychain testing
  446. "FIRAuthTests.m",
  447. "FIRUserTests.m",
  448. ],
  449. cSettings: [
  450. .headerSearchPath("../../.."),
  451. ]
  452. ),
  453. .target(
  454. name: "FirebaseAuthCombineSwift",
  455. dependencies: ["FirebaseAuth"],
  456. path: "FirebaseCombineSwift/Sources/Auth"
  457. ),
  458. .target(
  459. name: "FirebaseFirestoreCombineSwift",
  460. dependencies: [
  461. "FirebaseFirestoreTarget",
  462. "FirebaseFirestoreSwift",
  463. ],
  464. path: "FirebaseCombineSwift/Sources/Firestore"
  465. ),
  466. .target(
  467. name: "FirebaseStorageCombineSwift",
  468. dependencies: [
  469. "FirebaseStorage",
  470. ],
  471. path: "FirebaseCombineSwift/Sources/Storage"
  472. ),
  473. .target(
  474. name: "FirebaseCrashlytics",
  475. dependencies: ["FirebaseCore", "FirebaseInstallations", "FirebaseSessions",
  476. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  477. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  478. .product(name: "FBLPromises", package: "Promises"),
  479. .product(name: "nanopb", package: "nanopb")],
  480. path: "Crashlytics",
  481. exclude: [
  482. "run",
  483. "CHANGELOG.md",
  484. "LICENSE",
  485. "README.md",
  486. "ProtoSupport/",
  487. "UnitTests/",
  488. "generate_project.sh",
  489. "upload-symbols",
  490. "CrashlyticsInputFiles.xcfilelist",
  491. "third_party/libunwind/LICENSE",
  492. ],
  493. sources: [
  494. "Crashlytics/",
  495. "Protogen/",
  496. "Shared/",
  497. "third_party/libunwind/dwarf.h",
  498. ],
  499. publicHeadersPath: "Crashlytics/Public",
  500. cSettings: [
  501. .headerSearchPath(".."),
  502. .define("DISPLAY_VERSION", to: firebaseVersion),
  503. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  504. .define(
  505. "CLS_SDK_NAME",
  506. to: "Crashlytics macOS SDK",
  507. .when(platforms: [.macOS, .macCatalyst])
  508. ),
  509. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  510. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  511. .define("PB_FIELD_32BIT", to: "1"),
  512. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  513. .define("PB_ENABLE_MALLOC", to: "1"),
  514. ],
  515. linkerSettings: [
  516. .linkedFramework("Security"),
  517. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  518. ]
  519. ),
  520. .testTarget(
  521. name: "FirebaseCrashlyticsUnit",
  522. dependencies: ["FirebaseCrashlytics", .product(name: "OCMock", package: "ocmock")],
  523. path: "Crashlytics/UnitTests",
  524. resources: [
  525. .copy("FIRCLSMachO/machO_data"),
  526. .copy("Data"),
  527. ],
  528. cSettings: [
  529. .headerSearchPath("../.."),
  530. .define("DISPLAY_VERSION", to: firebaseVersion),
  531. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  532. .define(
  533. "CLS_SDK_NAME",
  534. to: "Crashlytics macOS SDK",
  535. .when(platforms: [.macOS, .macCatalyst])
  536. ),
  537. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  538. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  539. ]
  540. ),
  541. .target(
  542. name: "FirebaseDatabase",
  543. dependencies: [
  544. "FirebaseCore",
  545. "leveldb",
  546. ],
  547. path: "FirebaseDatabase/Sources",
  548. exclude: [
  549. "third_party/Wrap-leveldb/LICENSE",
  550. "third_party/SocketRocket/LICENSE",
  551. "third_party/FImmutableSortedDictionary/LICENSE",
  552. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  553. ],
  554. publicHeadersPath: "Public",
  555. cSettings: [
  556. .headerSearchPath("../../"),
  557. ],
  558. linkerSettings: [
  559. .linkedFramework("CFNetwork"),
  560. .linkedFramework("Security"),
  561. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  562. .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
  563. ]
  564. ),
  565. .testTarget(
  566. name: "DatabaseUnit",
  567. dependencies: [
  568. "FirebaseDatabase",
  569. "SharedTestUtilities",
  570. .product(name: "OCMock", package: "ocmock"),
  571. ],
  572. path: "FirebaseDatabase/Tests/",
  573. exclude: [
  574. // Disable Swift tests as mixed targets are not supported (Xcode 12.4).
  575. "Unit/Swift",
  576. "Integration/",
  577. ],
  578. resources: [.process("Resources")],
  579. cSettings: [
  580. .headerSearchPath("../.."),
  581. ]
  582. ),
  583. .testTarget(
  584. name: "DatabaseUnitSwift",
  585. dependencies: ["FirebaseDatabase"],
  586. path: "FirebaseDatabase/Tests/Unit/Swift",
  587. cSettings: [
  588. .headerSearchPath("../.."),
  589. ]
  590. ),
  591. .target(
  592. name: "FirebaseDatabaseSwift",
  593. dependencies: ["FirebaseDatabase", "FirebaseSharedSwift"],
  594. path: "FirebaseDatabaseSwift/Sources"
  595. ),
  596. .testTarget(
  597. name: "FirebaseDatabaseSwiftTests",
  598. dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
  599. path: "FirebaseDatabaseSwift/Tests/"
  600. ),
  601. .target(
  602. name: "FirebaseSharedSwift",
  603. path: "FirebaseSharedSwift/Sources",
  604. exclude: [
  605. "third_party/FirebaseDataEncoder/LICENSE",
  606. "third_party/FirebaseDataEncoder/METADATA",
  607. ]
  608. ),
  609. .testTarget(
  610. name: "FirebaseSharedSwiftTests",
  611. dependencies: ["FirebaseSharedSwift"],
  612. path: "FirebaseSharedSwift/Tests/"
  613. ),
  614. .target(
  615. name: "FirebaseDynamicLinksTarget",
  616. dependencies: [.target(name: "FirebaseDynamicLinks",
  617. condition: .when(platforms: [.iOS]))],
  618. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  619. ),
  620. .target(
  621. name: "FirebaseDynamicLinks",
  622. dependencies: ["FirebaseCore"],
  623. path: "FirebaseDynamicLinks/Sources",
  624. publicHeadersPath: "Public",
  625. cSettings: [
  626. .headerSearchPath("../../"),
  627. .define("FIRDynamicLinks3P", to: "1"),
  628. .define("GIN_SCION_LOGGING", to: "1"),
  629. ],
  630. linkerSettings: [
  631. .linkedFramework("QuartzCore"),
  632. ]
  633. ),
  634. .target(
  635. name: "FirebaseFirestoreTarget",
  636. dependencies: [
  637. .target(
  638. name: "FirebaseFirestore",
  639. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
  640. ),
  641. .product(name: "abseil", package: "abseil-cpp-binary"),
  642. .product(name: "gRPC-C++", package: "grpc-binary"),
  643. .product(name: "nanopb", package: "nanopb"),
  644. "FirebaseCore",
  645. "leveldb",
  646. ],
  647. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap",
  648. linkerSettings: [
  649. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  650. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  651. .linkedLibrary("c++"),
  652. ]
  653. ),
  654. .binaryTarget(
  655. name: "FirebaseFirestore",
  656. url: "https://dl.google.com/firebase/ios/bin/firestore/10.11.0/FirebaseFirestore.zip",
  657. checksum: "47da0c2d102c90d32ffa93cc5884c5a14eea006325944717b5e8d67ec9b440f3"
  658. ),
  659. .target(
  660. name: "FirebaseFirestoreSwiftTarget",
  661. dependencies: [.target(name: "FirebaseFirestoreSwift",
  662. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS]))],
  663. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  664. ),
  665. .target(
  666. name: "FirebaseFirestoreSwift",
  667. dependencies: [
  668. "FirebaseCore",
  669. "FirebaseCoreExtension",
  670. "FirebaseFirestoreTarget",
  671. "FirebaseSharedSwift",
  672. ],
  673. path: "Firestore",
  674. exclude: [
  675. "CHANGELOG.md",
  676. "CMakeLists.txt",
  677. "Example/",
  678. "LICENSE",
  679. "Protos/",
  680. "README.md",
  681. "Source/",
  682. "core/",
  683. "fuzzing/",
  684. "test.sh",
  685. "Swift/CHANGELOG.md",
  686. "Swift/Tests/",
  687. "third_party/nlohmann_json",
  688. ],
  689. sources: [
  690. "Swift/Source/",
  691. ]
  692. ),
  693. // MARK: - Firebase Functions
  694. .target(
  695. name: "FirebaseFunctions",
  696. dependencies: [
  697. "FirebaseAppCheckInterop",
  698. "FirebaseAuthInterop",
  699. "FirebaseCore",
  700. "FirebaseCoreExtension",
  701. "FirebaseMessagingInterop",
  702. "FirebaseSharedSwift",
  703. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  704. ],
  705. path: "FirebaseFunctions/Sources"
  706. ),
  707. .testTarget(
  708. name: "FirebaseFunctionsUnit",
  709. dependencies: ["FirebaseFunctions",
  710. "FirebaseAppCheckInterop",
  711. "FirebaseAuthInterop",
  712. "FirebaseMessagingInterop",
  713. "SharedTestUtilities"],
  714. path: "FirebaseFunctions/Tests/Unit",
  715. cSettings: [
  716. .headerSearchPath("../../../"),
  717. ]
  718. ),
  719. .testTarget(
  720. name: "FirebaseFunctionsIntegration",
  721. dependencies: ["FirebaseFunctions",
  722. "SharedTestUtilities"],
  723. path: "FirebaseFunctions/Tests/Integration"
  724. ),
  725. .testTarget(
  726. name: "FirebaseFunctionsObjCIntegration",
  727. dependencies: ["FirebaseFunctions",
  728. "SharedTestUtilities"],
  729. path: "FirebaseFunctions/Tests/ObjCIntegration",
  730. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  731. exclude: [
  732. "ObjCPPAPITests.mm",
  733. ],
  734. cSettings: [
  735. .headerSearchPath("../../.."),
  736. ]
  737. ),
  738. .target(
  739. name: "FirebaseFunctionsCombineSwift",
  740. dependencies: ["FirebaseFunctions"],
  741. path: "FirebaseCombineSwift/Sources/Functions"
  742. ),
  743. .testTarget(
  744. name: "FunctionsCombineUnit",
  745. dependencies: ["FirebaseFunctionsCombineSwift",
  746. "SharedTestUtilities"],
  747. path: "FirebaseFunctions/Tests/CombineUnit"
  748. ),
  749. // MARK: - Firebase In App Messaging
  750. .target(
  751. name: "FirebaseInAppMessagingTarget",
  752. dependencies: [
  753. .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
  754. ],
  755. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  756. ),
  757. .target(
  758. name: "FirebaseInAppMessaging",
  759. dependencies: [
  760. "FirebaseCore",
  761. "FirebaseInstallations",
  762. "FirebaseABTesting",
  763. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  764. .product(name: "nanopb", package: "nanopb"),
  765. .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
  766. ],
  767. path: "FirebaseInAppMessaging/Sources",
  768. exclude: [
  769. "DefaultUI/CHANGELOG.md",
  770. "DefaultUI/README.md",
  771. ],
  772. publicHeadersPath: "Public",
  773. cSettings: [
  774. .headerSearchPath("../../"),
  775. .define("PB_FIELD_32BIT", to: "1"),
  776. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  777. .define("PB_ENABLE_MALLOC", to: "1"),
  778. ]
  779. ),
  780. .target(
  781. name: "FirebaseInAppMessaging_iOS",
  782. path: "FirebaseInAppMessaging/iOS",
  783. resources: [.process("Resources")]
  784. ),
  785. .target(
  786. name: "FirebaseInAppMessagingSwift",
  787. dependencies: ["FirebaseInAppMessaging"],
  788. path: "FirebaseInAppMessaging/Swift/Source"
  789. ),
  790. .target(
  791. name: "FirebaseInstallations",
  792. dependencies: [
  793. "FirebaseCore",
  794. .product(name: "FBLPromises", package: "Promises"),
  795. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  796. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  797. ],
  798. path: "FirebaseInstallations/Source/Library",
  799. publicHeadersPath: "Public",
  800. cSettings: [
  801. .headerSearchPath("../../../"),
  802. ],
  803. linkerSettings: [
  804. .linkedFramework("Security"),
  805. ]
  806. ),
  807. .target(
  808. name: "FirebaseMLModelDownloader",
  809. dependencies: [
  810. "FirebaseCore",
  811. "FirebaseInstallations",
  812. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  813. .product(name: "GULLogger", package: "GoogleUtilities"),
  814. .product(name: "SwiftProtobuf", package: "swift-protobuf"),
  815. ],
  816. path: "FirebaseMLModelDownloader/Sources",
  817. exclude: [
  818. "proto/firebase_ml_log_sdk.proto",
  819. ],
  820. cSettings: [
  821. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  822. ]
  823. ),
  824. .testTarget(
  825. name: "FirebaseMLModelDownloaderUnit",
  826. dependencies: ["FirebaseMLModelDownloader"],
  827. path: "FirebaseMLModelDownloader/Tests/Unit"
  828. ),
  829. .target(
  830. name: "FirebaseMessaging",
  831. dependencies: [
  832. "FirebaseCore",
  833. "FirebaseInstallations",
  834. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  835. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  836. .product(name: "GULReachability", package: "GoogleUtilities"),
  837. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  838. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  839. .product(name: "nanopb", package: "nanopb"),
  840. ],
  841. path: "FirebaseMessaging/Sources",
  842. publicHeadersPath: "Public",
  843. cSettings: [
  844. .headerSearchPath("../../"),
  845. .define("PB_FIELD_32BIT", to: "1"),
  846. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  847. .define("PB_ENABLE_MALLOC", to: "1"),
  848. ],
  849. linkerSettings: [
  850. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  851. ]
  852. ),
  853. // Internal headers only for consuming from Swift.
  854. .target(
  855. name: "FirebaseMessagingInterop",
  856. path: "FirebaseMessaging/Interop",
  857. publicHeadersPath: ".",
  858. cSettings: [
  859. .headerSearchPath("../../"),
  860. ]
  861. ),
  862. .testTarget(
  863. name: "MessagingUnit",
  864. dependencies: [
  865. "FirebaseMessaging",
  866. "SharedTestUtilities",
  867. .product(name: "OCMock", package: "ocmock"),
  868. ],
  869. path: "FirebaseMessaging/Tests/UnitTests",
  870. exclude: [
  871. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  872. ],
  873. cSettings: [
  874. .headerSearchPath("../../.."),
  875. ]
  876. ),
  877. .target(
  878. name: "FirebasePerformanceTarget",
  879. dependencies: [.target(name: "FirebasePerformance",
  880. condition: .when(platforms: [.iOS, .tvOS]))],
  881. path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
  882. ),
  883. .target(
  884. name: "FirebasePerformance",
  885. dependencies: [
  886. "FirebaseCore",
  887. "FirebaseInstallations",
  888. "FirebaseRemoteConfig",
  889. "FirebaseSessions",
  890. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  891. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  892. .product(name: "GULISASwizzler", package: "GoogleUtilities"),
  893. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  894. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  895. .product(name: "nanopb", package: "nanopb"),
  896. ],
  897. path: "FirebasePerformance/Sources",
  898. publicHeadersPath: "Public",
  899. cSettings: [
  900. .headerSearchPath("../../"),
  901. .define("PB_FIELD_32BIT", to: "1"),
  902. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  903. .define("PB_ENABLE_MALLOC", to: "1"),
  904. .define("FIRPerformance_LIB_VERSION", to: firebaseVersion),
  905. ],
  906. linkerSettings: [
  907. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .tvOS])),
  908. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .tvOS])),
  909. .linkedFramework("QuartzCore", .when(platforms: [.iOS, .tvOS])),
  910. ]
  911. ),
  912. .testTarget(
  913. name: "PerformanceUnit",
  914. dependencies: [
  915. "FirebasePerformanceTarget",
  916. "SharedTestUtilities",
  917. "GCDWebServer",
  918. .product(name: "OCMock", package: "ocmock"),
  919. ],
  920. path: "FirebasePerformance/Tests/Unit",
  921. resources: [
  922. .process("FPRURLFilterTests-Info.plist"),
  923. .process("Server/smallDownloadFile"),
  924. .process("Server/bigDownloadFile"),
  925. ],
  926. cSettings: [
  927. .headerSearchPath("../../.."),
  928. .define("PB_FIELD_32BIT", to: "1"),
  929. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  930. .define("PB_ENABLE_MALLOC", to: "1"),
  931. ]
  932. ),
  933. .target(
  934. name: "SharedTestUtilities",
  935. dependencies: ["FirebaseCore",
  936. "FirebaseAppCheckInterop",
  937. "FirebaseAuthInterop",
  938. "FirebaseMessagingInterop",
  939. "GoogleDataTransport",
  940. .product(name: "OCMock", package: "ocmock")],
  941. path: "SharedTestUtilities",
  942. publicHeadersPath: "./",
  943. cSettings: [
  944. .headerSearchPath("../"),
  945. ]
  946. ),
  947. // MARK: - Firebase Remote Config
  948. .target(
  949. name: "FirebaseRemoteConfig",
  950. dependencies: [
  951. "FirebaseCore",
  952. "FirebaseABTesting",
  953. "FirebaseInstallations",
  954. .product(name: "GULNSData", package: "GoogleUtilities"),
  955. ],
  956. path: "FirebaseRemoteConfig/Sources",
  957. publicHeadersPath: "Public",
  958. cSettings: [
  959. .headerSearchPath("../../"),
  960. ]
  961. ),
  962. .testTarget(
  963. name: "RemoteConfigUnit",
  964. dependencies: ["FirebaseRemoteConfig", .product(name: "OCMock", package: "ocmock")],
  965. path: "FirebaseRemoteConfig/Tests/Unit",
  966. exclude: [
  967. // Need to be evaluated/ported to RC V2.
  968. "RCNConfigAnalyticsTest.m",
  969. "RCNConfigSettingsTest.m",
  970. "RCNConfigTest.m",
  971. "RCNRemoteConfig+FIRAppTest.m",
  972. "RCNThrottlingTests.m",
  973. ],
  974. resources: [
  975. .process("SecondApp-GoogleService-Info.plist"),
  976. .process("Defaults-testInfo.plist"),
  977. .process("TestABTPayload.txt"),
  978. ],
  979. cSettings: [
  980. .headerSearchPath("../../.."),
  981. ]
  982. ),
  983. .target(
  984. name: "FirebaseRemoteConfigSwift",
  985. dependencies: [
  986. "FirebaseRemoteConfig",
  987. "FirebaseSharedSwift",
  988. ],
  989. path: "FirebaseRemoteConfigSwift/Sources"
  990. ),
  991. .testTarget(
  992. name: "RemoteConfigFakeConsole",
  993. dependencies: ["FirebaseRemoteConfigSwift",
  994. "RemoteConfigFakeConsoleObjC"],
  995. path: "FirebaseRemoteConfigSwift/Tests",
  996. exclude: [
  997. "AccessToken.json",
  998. "README.md",
  999. "ObjC/",
  1000. ],
  1001. resources: [
  1002. .process("Defaults-testInfo.plist"),
  1003. ],
  1004. cSettings: [
  1005. .headerSearchPath("../../"),
  1006. ]
  1007. ),
  1008. .target(
  1009. name: "RemoteConfigFakeConsoleObjC",
  1010. dependencies: [.product(name: "OCMock", package: "ocmock")],
  1011. path: "FirebaseRemoteConfigSwift/Tests/ObjC",
  1012. publicHeadersPath: ".",
  1013. cSettings: [
  1014. .headerSearchPath("../../../"),
  1015. ]
  1016. ),
  1017. // MARK: - Firebase Sessions
  1018. .target(
  1019. name: "FirebaseSessions",
  1020. dependencies: [
  1021. "FirebaseCore",
  1022. "FirebaseInstallations",
  1023. "FirebaseCoreExtension",
  1024. "FirebaseSessionsObjC",
  1025. .product(name: "Promises", package: "Promises"),
  1026. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  1027. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1028. ],
  1029. path: "FirebaseSessions/Sources",
  1030. cSettings: [
  1031. .headerSearchPath(".."),
  1032. .define("DISPLAY_VERSION", to: firebaseVersion),
  1033. .define("PB_FIELD_32BIT", to: "1"),
  1034. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  1035. .define("PB_ENABLE_MALLOC", to: "1"),
  1036. ],
  1037. linkerSettings: [
  1038. .linkedFramework("Security"),
  1039. .linkedFramework(
  1040. "SystemConfiguration",
  1041. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1042. ),
  1043. ]
  1044. ),
  1045. // The Sessions SDK is Swift-first with Objective-C code to support
  1046. // nanopb. Because Swift Package Manager doesn't support mixed
  1047. // language targets, the ObjC code has been extracted out into
  1048. // a separate target.
  1049. .target(
  1050. name: "FirebaseSessionsObjC",
  1051. dependencies: [
  1052. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1053. .product(name: "nanopb", package: "nanopb"),
  1054. ],
  1055. path: "FirebaseSessions",
  1056. exclude: [
  1057. "README.md",
  1058. "Sources/",
  1059. "Tests/",
  1060. "ProtoSupport/",
  1061. "generate_project.sh",
  1062. "generate_protos.sh",
  1063. "generate_testapp.sh",
  1064. ],
  1065. publicHeadersPath: "SourcesObjC",
  1066. cSettings: [
  1067. .headerSearchPath(".."),
  1068. .define("DISPLAY_VERSION", to: firebaseVersion),
  1069. .define("PB_FIELD_32BIT", to: "1"),
  1070. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  1071. .define("PB_ENABLE_MALLOC", to: "1"),
  1072. ],
  1073. linkerSettings: [
  1074. .linkedFramework("Security"),
  1075. .linkedFramework(
  1076. "SystemConfiguration",
  1077. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1078. ),
  1079. ]
  1080. ),
  1081. .testTarget(
  1082. name: "FirebaseSessionsUnit",
  1083. dependencies: ["FirebaseSessions"],
  1084. path: "FirebaseSessions/Tests/Unit"
  1085. ),
  1086. // MARK: - Firebase Storage
  1087. .target(
  1088. name: "FirebaseStorage",
  1089. dependencies: [
  1090. "FirebaseAppCheckInterop",
  1091. "FirebaseAuthInterop",
  1092. "FirebaseCore",
  1093. "FirebaseCoreExtension",
  1094. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  1095. ],
  1096. path: "FirebaseStorage/Sources"
  1097. ),
  1098. .testTarget(
  1099. name: "FirebaseStorageUnit",
  1100. dependencies: ["FirebaseStorage",
  1101. "SharedTestUtilities"],
  1102. path: "FirebaseStorage/Tests/Unit",
  1103. cSettings: [
  1104. .headerSearchPath("../../../"),
  1105. ]
  1106. ),
  1107. .testTarget(
  1108. name: "StorageObjCIntegration",
  1109. dependencies: ["FirebaseStorage"],
  1110. path: "FirebaseStorage/Tests/ObjCIntegration",
  1111. exclude: [
  1112. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  1113. "FIRStorageIntegrationTests.m",
  1114. "ObjCPPAPITests.mm",
  1115. "Credentials.h",
  1116. ],
  1117. cSettings: [
  1118. .headerSearchPath("../../.."),
  1119. ]
  1120. ),
  1121. .testTarget(
  1122. name: "swift-test",
  1123. dependencies: [
  1124. "Firebase",
  1125. "FirebaseAuth",
  1126. "FirebaseAppCheck",
  1127. "FirebaseABTesting",
  1128. "FirebaseAnalytics",
  1129. "FirebaseAnalyticsSwift",
  1130. .target(name: "FirebaseAppDistribution",
  1131. condition: .when(platforms: [.iOS])),
  1132. "FirebaseAuthCombineSwift",
  1133. "FirebaseFirestoreCombineSwift",
  1134. "FirebaseFunctionsCombineSwift",
  1135. "FirebaseStorageCombineSwift",
  1136. "FirebaseCrashlytics",
  1137. "FirebaseCore",
  1138. "FirebaseDatabase",
  1139. "FirebaseDynamicLinks",
  1140. "FirebaseFirestoreTarget",
  1141. "FirebaseFirestoreSwift",
  1142. "FirebaseFunctions",
  1143. "FirebaseInAppMessaging",
  1144. .target(name: "FirebaseInAppMessagingSwift",
  1145. condition: .when(platforms: [.iOS, .tvOS])),
  1146. "FirebaseInstallations",
  1147. "FirebaseMessaging",
  1148. .target(name: "FirebasePerformance",
  1149. condition: .when(platforms: [.iOS, .tvOS])),
  1150. "FirebaseRemoteConfig",
  1151. "FirebaseSessions",
  1152. "FirebaseStorage",
  1153. .product(name: "nanopb", package: "nanopb"),
  1154. ],
  1155. path: "SwiftPMTests/swift-test"
  1156. ),
  1157. .testTarget(
  1158. name: "analytics-import-test",
  1159. dependencies: [
  1160. "FirebaseAnalyticsSwiftTarget",
  1161. "FirebaseAnalyticsWrapper",
  1162. "Firebase",
  1163. ],
  1164. path: "SwiftPMTests/analytics-import-test"
  1165. ),
  1166. .testTarget(
  1167. name: "objc-import-test",
  1168. dependencies: [
  1169. "Firebase",
  1170. "FirebaseAuth",
  1171. "FirebaseABTesting",
  1172. "FirebaseAppCheck",
  1173. .target(name: "FirebaseAppDistribution",
  1174. condition: .when(platforms: [.iOS])),
  1175. "FirebaseCrashlytics",
  1176. "FirebaseCore",
  1177. "FirebaseDatabase",
  1178. "FirebaseDynamicLinks",
  1179. "FirebaseFirestoreTarget",
  1180. "FirebaseFunctions",
  1181. "FirebaseInAppMessaging",
  1182. "FirebaseInstallations",
  1183. "FirebaseMessaging",
  1184. .target(name: "FirebasePerformance",
  1185. condition: .when(platforms: [.iOS, .tvOS])),
  1186. "FirebaseRemoteConfig",
  1187. "FirebaseStorage",
  1188. ],
  1189. path: "SwiftPMTests/objc-import-test"
  1190. ),
  1191. .testTarget(
  1192. name: "version-test",
  1193. dependencies: [
  1194. "FirebaseCore",
  1195. ],
  1196. path: "SwiftPMTests/version-test",
  1197. cSettings: [
  1198. .define("FIR_VERSION", to: firebaseVersion),
  1199. ]
  1200. ),
  1201. // MARK: - Firebase App Check
  1202. .target(name: "FirebaseAppCheck",
  1203. dependencies: [
  1204. "FirebaseCore",
  1205. .product(name: "FBLPromises", package: "Promises"),
  1206. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1207. ],
  1208. path: "FirebaseAppCheck/Sources",
  1209. publicHeadersPath: "Public",
  1210. cSettings: [
  1211. .headerSearchPath("../.."),
  1212. ],
  1213. linkerSettings: [
  1214. .linkedFramework(
  1215. "DeviceCheck",
  1216. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1217. ),
  1218. ]),
  1219. // Internal headers only for consuming from Swift.
  1220. .target(
  1221. name: "FirebaseAppCheckInterop",
  1222. path: "FirebaseAppCheck/Interop",
  1223. exclude: [
  1224. "CMakeLists.txt",
  1225. ],
  1226. publicHeadersPath: ".",
  1227. cSettings: [
  1228. .headerSearchPath("../../"),
  1229. ]
  1230. ),
  1231. .testTarget(
  1232. name: "FirebaseAppCheckUnit",
  1233. dependencies: [
  1234. "FirebaseAppCheck",
  1235. "SharedTestUtilities",
  1236. .product(name: "OCMock", package: "ocmock"),
  1237. ],
  1238. path: "FirebaseAppCheck/Tests",
  1239. exclude: [
  1240. // Swift tests are in the target `FirebaseAppCheckUnitSwift` since mixed language targets
  1241. // are not supported (as of Xcode 14.3).
  1242. "Unit/Swift",
  1243. ],
  1244. resources: [
  1245. .process("Fixture"),
  1246. ],
  1247. cSettings: [
  1248. .headerSearchPath("../.."),
  1249. ]
  1250. ),
  1251. .testTarget(
  1252. name: "FirebaseAppCheckUnitSwift",
  1253. dependencies: ["FirebaseAppCheck"],
  1254. path: "FirebaseAppCheck/Tests/Unit/Swift",
  1255. cSettings: [
  1256. .headerSearchPath("../.."),
  1257. ]
  1258. ),
  1259. // MARK: Testing support
  1260. .target(
  1261. name: "FirebaseFirestoreTestingSupport",
  1262. dependencies: ["FirebaseFirestoreTarget"],
  1263. path: "FirebaseTestingSupport/Firestore/Sources",
  1264. publicHeadersPath: "./",
  1265. cSettings: [
  1266. .headerSearchPath("../../.."),
  1267. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  1268. ]
  1269. ),
  1270. .testTarget(
  1271. name: "FirestoreTestingSupportTests",
  1272. dependencies: ["FirebaseFirestoreTestingSupport"],
  1273. path: "FirebaseTestingSupport/Firestore/Tests",
  1274. cSettings: [
  1275. .headerSearchPath("../../.."),
  1276. ]
  1277. ),
  1278. ],
  1279. cLanguageStandard: .c99,
  1280. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  1281. )
  1282. // This is set when running `scripts/check_firestore_symbols.sh`.
  1283. if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil {
  1284. if let firestoreIndex = package.targets
  1285. .firstIndex(where: { $0.name == "FirebaseFirestore" }) {
  1286. package.targets[firestoreIndex] = .binaryTarget(
  1287. name: "FirebaseFirestore",
  1288. // The `xcframework` should be moved to the root of the repo.
  1289. path: "FirebaseFirestore.xcframework"
  1290. )
  1291. }
  1292. }
  1293. // MARK: - Helper Functions
  1294. func googleAppMeasurementDependency() -> Package.Dependency {
  1295. let appMeasurementURL = "https://github.com/google/GoogleAppMeasurement.git"
  1296. // Point SPM CI to the tip of main of https://github.com/google/GoogleAppMeasurement so that the
  1297. // release process can defer publishing the GoogleAppMeasurement tag until after testing.
  1298. if ProcessInfo.processInfo.environment["FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT"] != nil {
  1299. return .package(url: appMeasurementURL, branch: "main")
  1300. }
  1301. return .package(url: appMeasurementURL, exact: "10.11.0")
  1302. }