Package.swift 24 KB

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