Package.swift 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815
  1. // swift-tools-version:5.3
  2. // The swift-tools-version declares the minimum version of Swift required to build this package.
  3. // Copyright 2020 Google LLC
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License");
  6. // you may not use this file except in compliance with the License.
  7. // You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. import PackageDescription
  17. let firebaseVersion = "7.8.1"
  18. let package = Package(
  19. name: "Firebase",
  20. platforms: [.iOS(.v10), .macOS(.v10_12), .tvOS(.v10), .watchOS(.v6)],
  21. products: [
  22. .library(
  23. name: "FirebaseAnalytics",
  24. targets: ["FirebaseAnalyticsTarget"]
  25. ),
  26. .library(
  27. name: "FirebaseAuth",
  28. targets: ["FirebaseAuth"]
  29. ),
  30. .library(
  31. name: "FirebaseAppDistribution-Beta",
  32. targets: ["FirebaseAppDistributionTarget"]
  33. ),
  34. .library(
  35. name: "FirebaseCrashlytics",
  36. targets: ["FirebaseCrashlytics"]
  37. ),
  38. .library(
  39. name: "FirebaseDatabase",
  40. targets: ["FirebaseDatabaseTarget"]
  41. ),
  42. .library(
  43. name: "FirebaseDynamicLinks",
  44. targets: ["FirebaseDynamicLinksTarget"]
  45. ),
  46. .library(
  47. name: "FirebaseFirestore",
  48. targets: ["FirebaseFirestoreTarget"]
  49. ),
  50. .library(
  51. name: "FirebaseFirestoreSwift-Beta",
  52. targets: ["FirebaseFirestoreSwiftTarget"]
  53. ),
  54. .library(
  55. name: "FirebaseFunctions",
  56. targets: ["FirebaseFunctionsTarget"]
  57. ),
  58. .library(
  59. name: "FirebaseInAppMessaging-Beta",
  60. targets: ["FirebaseInAppMessagingTarget"]
  61. ),
  62. .library(
  63. name: "FirebaseInstallations",
  64. targets: ["FirebaseInstallations"]
  65. ),
  66. .library(
  67. name: "FirebaseMessaging",
  68. targets: ["FirebaseMessaging"]
  69. ),
  70. .library(
  71. name: "FirebaseMLModelDownloader",
  72. targets: ["FirebaseMLModelDownloader"]
  73. ),
  74. .library(
  75. name: "FirebaseRemoteConfig",
  76. targets: ["FirebaseRemoteConfigTarget"]
  77. ),
  78. .library(
  79. name: "FirebaseStorage",
  80. targets: ["FirebaseStorage"]
  81. ),
  82. .library(
  83. name: "FirebaseStorageSwift-Beta",
  84. targets: ["FirebaseStorageSwift"]
  85. ),
  86. ],
  87. dependencies: [
  88. .package(name: "Promises", url: "https://github.com/google/promises.git", "1.2.8" ..< "1.3.0"),
  89. .package(
  90. name: "SwiftProtobuf",
  91. url: "https://github.com/apple/swift-protobuf.git",
  92. from: "1.14.0"
  93. ),
  94. .package(
  95. name: "GoogleAppMeasurement",
  96. url: "https://github.com/google/GoogleAppMeasurement.git",
  97. .exact("7.8.1")
  98. ),
  99. .package(
  100. name: "GoogleDataTransport",
  101. url: "https://github.com/google/GoogleDataTransport.git",
  102. "8.2.0" ..< "9.0.0"
  103. ),
  104. .package(
  105. name: "GoogleUtilities",
  106. url: "https://github.com/google/GoogleUtilities.git",
  107. "7.2.1" ..< "8.0.0"
  108. ),
  109. .package(
  110. name: "GTMSessionFetcher",
  111. url: "https://github.com/google/gtm-session-fetcher.git",
  112. "1.4.0" ..< "2.0.0"
  113. ),
  114. .package(
  115. name: "nanopb",
  116. url: "https://github.com/firebase/nanopb.git",
  117. // This revision adds SPM enablement to the 0.3.9.6 release tag.
  118. "2.30907.0" ..< "2.30908.0"
  119. ),
  120. .package(name: "abseil",
  121. url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
  122. from: "0.20200225.0"),
  123. .package(
  124. name: "gRPC",
  125. url: "https://github.com/firebase/grpc-SwiftPM.git",
  126. "1.28.2" ..< "1.29.0"
  127. ),
  128. .package(
  129. name: "OCMock",
  130. url: "https://github.com/firebase/ocmock.git",
  131. .revision("7291762d3551c5c7e31c49cce40a0e391a52e889")
  132. ),
  133. .package(
  134. name: "leveldb",
  135. url: "https://github.com/firebase/leveldb.git",
  136. "1.22.1" ..< "1.23.0"
  137. ),
  138. // Branches need a force update with a run with the revision set like below.
  139. // .package(url: "https://github.com/paulb777/nanopb.git", .revision("564392bd87bd093c308a3aaed3997466efb95f74"))
  140. ],
  141. targets: [
  142. .target(
  143. name: "Firebase",
  144. path: "CoreOnly/Sources",
  145. publicHeadersPath: "./"
  146. ),
  147. .target(
  148. name: "FirebaseCore",
  149. dependencies: [
  150. "Firebase",
  151. "FirebaseCoreDiagnostics",
  152. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  153. .product(name: "GULLogger", package: "GoogleUtilities"),
  154. ],
  155. path: "FirebaseCore/Sources",
  156. publicHeadersPath: "Public",
  157. cSettings: [
  158. .headerSearchPath("../.."),
  159. .define("Firebase_VERSION", to: firebaseVersion),
  160. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  161. ],
  162. linkerSettings: [
  163. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  164. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  165. ]
  166. ),
  167. .testTarget(
  168. name: "CoreUnit",
  169. dependencies: ["FirebaseCore", "SharedTestUtilities", "OCMock"],
  170. path: "FirebaseCore/Tests/Unit",
  171. exclude: ["Resources/GoogleService-Info.plist"],
  172. cSettings: [
  173. .headerSearchPath("../../.."),
  174. ]
  175. ),
  176. .target(
  177. name: "FirebaseCoreDiagnostics",
  178. dependencies: [
  179. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  180. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  181. .product(name: "GULLogger", package: "GoogleUtilities"),
  182. .product(name: "nanopb", package: "nanopb"),
  183. ],
  184. path: "Firebase/CoreDiagnostics/FIRCDLibrary",
  185. publicHeadersPath: ".",
  186. cSettings: [
  187. .headerSearchPath("../../.."),
  188. .define("PB_FIELD_32BIT", to: "1"),
  189. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  190. .define("PB_ENABLE_MALLOC", to: "1"),
  191. ]
  192. ),
  193. .target(
  194. name: "FirebaseABTesting",
  195. dependencies: ["FirebaseCore"],
  196. path: "FirebaseABTesting/Sources",
  197. publicHeadersPath: "Public",
  198. cSettings: [
  199. .headerSearchPath("../../"),
  200. ]
  201. ),
  202. .testTarget(
  203. name: "ABTestingUnit",
  204. dependencies: ["FirebaseABTesting", "OCMock"],
  205. path: "FirebaseABTesting/Tests/Unit",
  206. resources: [.process("Resources")],
  207. cSettings: [
  208. .headerSearchPath("../../.."),
  209. ]
  210. ),
  211. .target(
  212. name: "FirebaseAnalyticsTarget",
  213. dependencies: [.target(name: "FirebaseAnalyticsWrapper",
  214. condition: .when(platforms: [.iOS]))],
  215. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
  216. ),
  217. .target(
  218. name: "FirebaseAnalyticsWrapper",
  219. dependencies: [
  220. .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS])),
  221. .product(name: "GoogleAppMeasurement",
  222. package: "GoogleAppMeasurement",
  223. condition: .when(platforms: [.iOS])),
  224. "FirebaseCore",
  225. "FirebaseInstallations",
  226. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  227. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  228. .product(name: "GULNSData", package: "GoogleUtilities"),
  229. .product(name: "GULNetwork", package: "GoogleUtilities"),
  230. .product(name: "nanopb", package: "nanopb"),
  231. ],
  232. path: "FirebaseAnalyticsWrapper",
  233. linkerSettings: [
  234. .linkedLibrary("sqlite3"),
  235. .linkedLibrary("c++"),
  236. .linkedLibrary("z"),
  237. .linkedFramework("StoreKit"),
  238. ]
  239. ),
  240. .binaryTarget(
  241. name: "FirebaseAnalytics",
  242. url: "https://dl.google.com/firebase/ios/swiftpm/7.8.1/FirebaseAnalytics.zip",
  243. checksum: "d3838e4d498a4846254feebf8d1995f63904a845fb57036b0520a413fb39b8a4"
  244. ),
  245. .target(
  246. name: "FirebaseAppDistributionTarget",
  247. dependencies: [.target(name: "FirebaseAppDistribution",
  248. condition: .when(platforms: [.iOS]))],
  249. path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
  250. ),
  251. .target(
  252. name: "FirebaseAppDistribution",
  253. dependencies: [
  254. "FirebaseCore",
  255. "FirebaseInstallations",
  256. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  257. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  258. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  259. ],
  260. path: "FirebaseAppDistribution/Sources",
  261. publicHeadersPath: "Public",
  262. cSettings: [
  263. .headerSearchPath("../../"),
  264. ]
  265. ),
  266. .testTarget(
  267. name: "AppDistributionUnit",
  268. dependencies: ["FirebaseAppDistribution", "OCMock"],
  269. path: "FirebaseAppDistribution/Tests/Unit",
  270. resources: [.process("Resources")],
  271. cSettings: [
  272. .headerSearchPath("../../.."),
  273. ]
  274. ),
  275. .target(
  276. name: "FirebaseAuth",
  277. dependencies: [
  278. "FirebaseCore",
  279. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  280. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  281. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  282. ],
  283. path: "FirebaseAuth/Sources",
  284. publicHeadersPath: "Public",
  285. cSettings: [
  286. .headerSearchPath("../../"),
  287. ],
  288. linkerSettings: [
  289. .linkedFramework("Security"),
  290. .linkedFramework("SafariServices", .when(platforms: [.iOS])),
  291. ]
  292. ),
  293. .testTarget(
  294. name: "AuthUnit",
  295. dependencies: ["FirebaseAuth", "OCMock"],
  296. path: "FirebaseAuth/Tests/Unit",
  297. exclude: [
  298. "FIRAuthKeychainServicesTests.m", // TODO: figure out SPM keychain testing
  299. "FIRAuthTests.m",
  300. "FIRUserTests.m",
  301. ],
  302. cSettings: [
  303. .headerSearchPath("../../.."),
  304. ]
  305. ),
  306. .target(
  307. name: "FirebaseCrashlytics",
  308. dependencies: ["FirebaseCore", "FirebaseInstallations",
  309. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  310. .product(name: "FBLPromises", package: "Promises"),
  311. .product(name: "nanopb", package: "nanopb")],
  312. path: "Crashlytics",
  313. exclude: [
  314. "run",
  315. "CHANGELOG.md",
  316. "LICENSE",
  317. "README.md",
  318. "Data/",
  319. "Protos/",
  320. "ProtoSupport/",
  321. "UnitTests/",
  322. "generate_project.sh",
  323. "upload-symbols",
  324. "third_party/libunwind/LICENSE",
  325. ],
  326. sources: [
  327. "Crashlytics/",
  328. "Protogen/",
  329. "Shared/",
  330. "third_party/libunwind/dwarf.h",
  331. ],
  332. publicHeadersPath: "Crashlytics/Public",
  333. cSettings: [
  334. .headerSearchPath(".."),
  335. .define("DISPLAY_VERSION", to: firebaseVersion),
  336. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  337. .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: [.macOS])),
  338. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  339. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  340. .define("PB_FIELD_32BIT", to: "1"),
  341. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  342. .define("PB_ENABLE_MALLOC", to: "1"),
  343. ],
  344. linkerSettings: [
  345. .linkedFramework("Security"),
  346. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  347. ]
  348. ),
  349. .target(
  350. name: "FirebaseDatabaseTarget",
  351. dependencies: [.target(name: "FirebaseDatabase",
  352. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  353. path: "SwiftPM-PlatformExclude/FirebaseDatabaseWrap"
  354. ),
  355. .target(
  356. name: "FirebaseDatabase",
  357. dependencies: [
  358. "FirebaseCore",
  359. "leveldb",
  360. ],
  361. path: "FirebaseDatabase/Sources",
  362. exclude: [
  363. "third_party/Wrap-leveldb/LICENSE",
  364. "third_party/SocketRocket/LICENSE",
  365. "third_party/FImmutableSortedDictionary/LICENSE",
  366. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  367. ],
  368. publicHeadersPath: "Public",
  369. cSettings: [
  370. .headerSearchPath("../../"),
  371. ],
  372. linkerSettings: [
  373. .linkedFramework("CFNetwork"),
  374. .linkedFramework("Security"),
  375. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  376. ]
  377. ),
  378. .testTarget(
  379. name: "DatabaseUnit",
  380. dependencies: ["FirebaseDatabase", "OCMock", "SharedTestUtilities"],
  381. path: "FirebaseDatabase/Tests/",
  382. exclude: [
  383. "Integration/",
  384. ],
  385. resources: [.process("Resources")],
  386. cSettings: [
  387. .headerSearchPath("../.."),
  388. ]
  389. ),
  390. .target(
  391. name: "FirebaseDynamicLinksTarget",
  392. dependencies: [.target(name: "FirebaseDynamicLinks",
  393. condition: .when(platforms: [.iOS]))],
  394. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  395. ),
  396. .target(
  397. name: "FirebaseDynamicLinks",
  398. dependencies: ["FirebaseCore"],
  399. path: "FirebaseDynamicLinks/Sources",
  400. publicHeadersPath: "Public",
  401. cSettings: [
  402. .headerSearchPath("../../"),
  403. .define("FIRDynamicLinks3P", to: "1"),
  404. .define("GIN_SCION_LOGGING", to: "1"),
  405. ],
  406. linkerSettings: [
  407. .linkedFramework("QuartzCore"),
  408. ]
  409. ),
  410. .target(
  411. name: "FirebaseFirestoreTarget",
  412. dependencies: [.target(name: "FirebaseFirestore",
  413. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  414. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  415. ),
  416. .target(
  417. name: "FirebaseFirestore",
  418. dependencies: [
  419. "FirebaseCore",
  420. "leveldb",
  421. .product(name: "nanopb", package: "nanopb"),
  422. .product(name: "abseil", package: "abseil"),
  423. .product(name: "gRPC-cpp", package: "gRPC"),
  424. ],
  425. path: "Firestore",
  426. exclude: [
  427. "CHANGELOG.md",
  428. "CMakeLists.txt",
  429. "Example/",
  430. "Protos/CMakeLists.txt",
  431. "Protos/Podfile",
  432. "Protos/README.md",
  433. "Protos/build_protos.py",
  434. "Protos/cpp/",
  435. "Protos/lib/",
  436. "Protos/nanopb_cpp_generator.py",
  437. "Protos/protos/",
  438. "README.md",
  439. "Source/CMakeLists.txt",
  440. "Swift/",
  441. "core/CMakeLists.txt",
  442. "core/src/util/config_detected.h.in",
  443. "core/test/",
  444. "fuzzing/",
  445. "test.sh",
  446. "third_party/",
  447. // Exclude alternate implementations for other platforms
  448. "core/src/api/input_validation_std.cc",
  449. "core/src/remote/connectivity_monitor_noop.cc",
  450. "core/src/util/filesystem_win.cc",
  451. "core/src/util/hard_assert_stdio.cc",
  452. "core/src/util/log_stdio.cc",
  453. "core/src/util/secure_random_openssl.cc",
  454. ],
  455. sources: [
  456. "Source/",
  457. "Protos/nanopb/",
  458. "core/include/",
  459. "core/src",
  460. ],
  461. publicHeadersPath: "Source/Public",
  462. cSettings: [
  463. .headerSearchPath("../"),
  464. .headerSearchPath("Source/Public/FirebaseFirestore"),
  465. .headerSearchPath("Protos/nanopb"),
  466. .define("PB_FIELD_32BIT", to: "1"),
  467. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  468. .define("PB_ENABLE_MALLOC", to: "1"),
  469. .define("FIRFirestore_VERSION", to: firebaseVersion),
  470. ],
  471. linkerSettings: [
  472. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  473. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  474. .linkedLibrary("c++"),
  475. ]
  476. ),
  477. .target(
  478. name: "FirebaseFirestoreSwiftTarget",
  479. dependencies: [.target(name: "FirebaseFirestoreSwift",
  480. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  481. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  482. ),
  483. .target(
  484. name: "FirebaseFirestoreSwift",
  485. dependencies: ["FirebaseFirestore"],
  486. path: "Firestore",
  487. exclude: [
  488. "CHANGELOG.md",
  489. "CMakeLists.txt",
  490. "Example/",
  491. "Protos/",
  492. "README.md",
  493. "Source/",
  494. "core/",
  495. "fuzzing/",
  496. "test.sh",
  497. "Swift/CHANGELOG.md",
  498. "Swift/README.md",
  499. "Swift/Tests/",
  500. "third_party/FirestoreEncoder/LICENSE",
  501. "third_party/FirestoreEncoder/METADATA",
  502. ],
  503. sources: [
  504. "Swift/Source/",
  505. "third_party/FirestoreEncoder/",
  506. ]
  507. ),
  508. .target(
  509. name: "FirebaseFunctionsTarget",
  510. dependencies: [.target(name: "FirebaseFunctions",
  511. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  512. path: "SwiftPM-PlatformExclude/FirebaseFunctionsWrap"
  513. ),
  514. .target(
  515. name: "FirebaseFunctions",
  516. dependencies: [
  517. "FirebaseCore",
  518. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  519. ],
  520. path: "Functions/FirebaseFunctions",
  521. publicHeadersPath: "Public",
  522. cSettings: [
  523. .headerSearchPath("../../"),
  524. ]
  525. ),
  526. .target(
  527. name: "FirebaseInAppMessagingTarget",
  528. dependencies: [.target(name: "FirebaseInAppMessaging",
  529. condition: .when(platforms: [.iOS]))],
  530. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  531. ),
  532. .target(
  533. name: "FirebaseInAppMessaging",
  534. dependencies: [
  535. "FirebaseCore",
  536. "FirebaseInstallations",
  537. "FirebaseABTesting",
  538. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  539. .product(name: "nanopb", package: "nanopb"),
  540. ],
  541. path: "FirebaseInAppMessaging/Sources",
  542. exclude: [
  543. "DefaultUI/CHANGELOG.md",
  544. "DefaultUI/README.md",
  545. ],
  546. resources: [.process("Resources")],
  547. publicHeadersPath: "Public",
  548. cSettings: [
  549. .headerSearchPath("../../"),
  550. .define("PB_FIELD_32BIT", to: "1"),
  551. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  552. .define("PB_ENABLE_MALLOC", to: "1"),
  553. ]
  554. ),
  555. .target(
  556. name: "FirebaseInstanceID",
  557. dependencies: [
  558. "FirebaseCore",
  559. "FirebaseInstallations",
  560. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  561. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  562. ],
  563. path: "Firebase/InstanceID",
  564. exclude: [
  565. "CHANGELOG.md",
  566. ],
  567. publicHeadersPath: "Public",
  568. cSettings: [
  569. .headerSearchPath("../../"),
  570. ]
  571. ),
  572. .target(
  573. name: "FirebaseInstallations",
  574. dependencies: [
  575. "FirebaseCore",
  576. .product(name: "FBLPromises", package: "Promises"),
  577. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  578. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  579. ],
  580. path: "FirebaseInstallations/Source/Library",
  581. publicHeadersPath: "Public",
  582. cSettings: [
  583. .headerSearchPath("../../../"),
  584. ],
  585. linkerSettings: [
  586. .linkedFramework("Security"),
  587. ]
  588. ),
  589. .target(
  590. name: "FirebaseMLModelDownloader",
  591. dependencies: [
  592. "FirebaseCore",
  593. "FirebaseInstallations",
  594. .product(name: "GULLogger", package: "GoogleUtilities"),
  595. "SwiftProtobuf",
  596. ],
  597. path: "FirebaseMLModelDownloader/Sources",
  598. exclude: [
  599. "proto/firebase_ml_log_sdk.proto",
  600. ],
  601. cSettings: [
  602. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  603. ]
  604. ),
  605. .testTarget(
  606. name: "FirebaseMLModelDownloaderUnit",
  607. dependencies: ["FirebaseMLModelDownloader"],
  608. path: "FirebaseMLModelDownloader/Tests/Unit"
  609. ),
  610. .target(
  611. name: "FirebaseMessaging",
  612. dependencies: [
  613. "FirebaseCore",
  614. "FirebaseInstanceID",
  615. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  616. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  617. .product(name: "GULReachability", package: "GoogleUtilities"),
  618. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  619. ],
  620. path: "FirebaseMessaging/Sources",
  621. publicHeadersPath: "Public",
  622. cSettings: [
  623. .headerSearchPath("../../"),
  624. ],
  625. linkerSettings: [
  626. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  627. ]
  628. ),
  629. .testTarget(
  630. name: "MessagingUnit",
  631. dependencies: ["FirebaseMessaging", "OCMock"],
  632. path: "FirebaseMessaging/Tests/UnitTests",
  633. exclude: [
  634. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  635. ],
  636. cSettings: [
  637. .headerSearchPath("../../.."),
  638. ]
  639. ),
  640. .target(
  641. name: "SharedTestUtilities",
  642. dependencies: ["FirebaseCore", "OCMock"],
  643. path: "SharedTestUtilities",
  644. publicHeadersPath: "./",
  645. cSettings: [
  646. .headerSearchPath("../"),
  647. ]
  648. ),
  649. .target(
  650. name: "FirebaseRemoteConfigTarget",
  651. dependencies: [.target(name: "FirebaseRemoteConfig",
  652. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  653. path: "SwiftPM-PlatformExclude/FirebaseRemoteConfigWrap"
  654. ),
  655. .target(
  656. name: "FirebaseRemoteConfig",
  657. dependencies: [
  658. "FirebaseCore",
  659. "FirebaseABTesting",
  660. "FirebaseInstallations",
  661. .product(name: "GULNSData", package: "GoogleUtilities"),
  662. ],
  663. path: "FirebaseRemoteConfig/Sources",
  664. publicHeadersPath: "Public",
  665. cSettings: [
  666. .headerSearchPath("../../"),
  667. ]
  668. ),
  669. .testTarget(
  670. name: "RemoteConfigUnit",
  671. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  672. path: "FirebaseRemoteConfig/Tests/Unit",
  673. exclude: [
  674. // Need to be evaluated/ported to RC V2.
  675. "RCNConfigAnalyticsTest.m",
  676. "RCNConfigSettingsTest.m",
  677. "RCNConfigTest.m",
  678. "RCNRemoteConfig+FIRAppTest.m",
  679. "RCNThrottlingTests.m",
  680. ],
  681. resources: [
  682. .process("SecondApp-GoogleService-Info.plist"),
  683. .process("Defaults-testInfo.plist"),
  684. .process("TestABTPayload.txt"),
  685. ],
  686. cSettings: [
  687. .headerSearchPath("../../.."),
  688. ]
  689. ),
  690. .target(
  691. name: "FirebaseStorage",
  692. dependencies: [
  693. "FirebaseCore",
  694. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  695. ],
  696. path: "FirebaseStorage/Sources",
  697. publicHeadersPath: "Public",
  698. cSettings: [
  699. .headerSearchPath("../../"),
  700. ],
  701. linkerSettings: [
  702. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS])),
  703. .linkedFramework("CoreServices", .when(platforms: [.macOS])),
  704. ]
  705. ),
  706. .testTarget(
  707. name: "StorageUnit",
  708. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  709. path: "FirebaseStorage/Tests/Unit",
  710. cSettings: [
  711. .headerSearchPath("../../.."),
  712. ]
  713. ),
  714. .target(
  715. name: "FirebaseStorageSwift",
  716. dependencies: ["FirebaseStorage"],
  717. path: "FirebaseStorageSwift/Sources"
  718. ),
  719. .testTarget(
  720. name: "swift-test",
  721. dependencies: [
  722. "FirebaseAuth",
  723. "FirebaseABTesting",
  724. .target(name: "FirebaseAppDistribution",
  725. condition: .when(platforms: [.iOS])),
  726. "Firebase",
  727. "FirebaseCrashlytics",
  728. "FirebaseCore",
  729. "FirebaseDatabase",
  730. "FirebaseDynamicLinks",
  731. "FirebaseFirestore",
  732. "FirebaseFirestoreSwift",
  733. "FirebaseFunctions",
  734. "FirebaseInAppMessaging",
  735. "FirebaseInstallations",
  736. "FirebaseMessaging",
  737. "FirebaseRemoteConfig",
  738. "FirebaseStorage",
  739. "FirebaseStorageSwift",
  740. .product(name: "nanopb", package: "nanopb"),
  741. ],
  742. path: "SwiftPMTests/swift-test"
  743. ),
  744. .testTarget(
  745. name: "analytics-import-test",
  746. dependencies: [
  747. "FirebaseAnalyticsWrapper",
  748. "Firebase",
  749. ],
  750. path: "SwiftPMTests/analytics-import-test"
  751. ),
  752. .testTarget(
  753. name: "objc-import-test",
  754. dependencies: [
  755. "FirebaseAuth",
  756. "FirebaseABTesting",
  757. .target(name: "FirebaseAppDistribution",
  758. condition: .when(platforms: [.iOS])),
  759. "Firebase",
  760. "FirebaseCrashlytics",
  761. "FirebaseCore",
  762. "FirebaseDatabase",
  763. "FirebaseDynamicLinks",
  764. "FirebaseFirestore",
  765. "FirebaseFunctions",
  766. "FirebaseInAppMessaging",
  767. "FirebaseInstallations",
  768. "FirebaseMessaging",
  769. "FirebaseRemoteConfig",
  770. "FirebaseStorage",
  771. ],
  772. path: "SwiftPMTests/objc-import-test"
  773. ),
  774. .testTarget(
  775. name: "version-test",
  776. dependencies: [
  777. "FirebaseCore",
  778. ],
  779. path: "SwiftPMTests/version-test",
  780. cSettings: [
  781. .define("FIR_VERSION", to: firebaseVersion),
  782. ]
  783. ),
  784. ],
  785. cLanguageStandard: .c99,
  786. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  787. )