Package.swift 26 KB

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