Package.swift 26 KB

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