Package.swift 25 KB

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