Package.swift 27 KB

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