Package.swift 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  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.8.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: "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.8.1")
  111. ),
  112. .package(
  113. name: "GoogleDataTransport",
  114. url: "https://github.com/google/GoogleDataTransport.git",
  115. "8.2.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.30907.0" ..< "2.30908.0"
  132. ),
  133. .package(
  134. name: "abseil",
  135. url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
  136. .revision("973d27376eedfb8f0f0a324be4b4121d44808dc9")
  137. ),
  138. .package(
  139. name: "gRPC",
  140. url: "https://github.com/firebase/grpc-SwiftPM.git",
  141. .revision("b54af2c0d3b77209ccc8dc25af902c31a2095943")
  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. .revision("e4e8ab44a2781a3656b4b5852e71c07fd18fecfa")
  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.8.1/FirebaseAnalytics.zip",
  258. checksum: "d3838e4d498a4846254feebf8d1995f63904a845fb57036b0520a413fb39b8a4"
  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. "third_party/",
  482. // Exclude alternate implementations for other platforms
  483. "core/src/api/input_validation_std.cc",
  484. "core/src/remote/connectivity_monitor_noop.cc",
  485. "core/src/util/filesystem_win.cc",
  486. "core/src/util/hard_assert_stdio.cc",
  487. "core/src/util/log_stdio.cc",
  488. "core/src/util/secure_random_openssl.cc",
  489. ],
  490. sources: [
  491. "Source/",
  492. "Protos/nanopb/",
  493. "core/include/",
  494. "core/src",
  495. ],
  496. publicHeadersPath: "Source/Public",
  497. cSettings: [
  498. .headerSearchPath("../"),
  499. .headerSearchPath("Source/Public/FirebaseFirestore"),
  500. .headerSearchPath("Protos/nanopb"),
  501. .define("PB_FIELD_32BIT", to: "1"),
  502. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  503. .define("PB_ENABLE_MALLOC", to: "1"),
  504. .define("FIRFirestore_VERSION", to: firebaseVersion),
  505. ],
  506. linkerSettings: [
  507. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  508. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  509. .linkedLibrary("c++"),
  510. ]
  511. ),
  512. .target(
  513. name: "FirebaseFirestoreSwiftTarget",
  514. dependencies: [.target(name: "FirebaseFirestoreSwift",
  515. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  516. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  517. ),
  518. .target(
  519. name: "FirebaseFirestoreSwift",
  520. dependencies: ["FirebaseFirestore"],
  521. path: "Firestore",
  522. exclude: [
  523. "CHANGELOG.md",
  524. "CMakeLists.txt",
  525. "Example/",
  526. "Protos/",
  527. "README.md",
  528. "Source/",
  529. "core/",
  530. "fuzzing/",
  531. "test.sh",
  532. "Swift/CHANGELOG.md",
  533. "Swift/README.md",
  534. "Swift/Tests/",
  535. "third_party/FirestoreEncoder/LICENSE",
  536. "third_party/FirestoreEncoder/METADATA",
  537. ],
  538. sources: [
  539. "Swift/Source/",
  540. "third_party/FirestoreEncoder/",
  541. ]
  542. ),
  543. .target(
  544. name: "FirebaseFunctionsTarget",
  545. dependencies: [.target(name: "FirebaseFunctions",
  546. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  547. path: "SwiftPM-PlatformExclude/FirebaseFunctionsWrap"
  548. ),
  549. .target(
  550. name: "FirebaseFunctions",
  551. dependencies: [
  552. "FirebaseCore",
  553. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  554. ],
  555. path: "Functions/FirebaseFunctions",
  556. publicHeadersPath: "Public",
  557. cSettings: [
  558. .headerSearchPath("../../"),
  559. ]
  560. ),
  561. .target(
  562. name: "FirebaseInAppMessagingTarget",
  563. dependencies: [.target(name: "FirebaseInAppMessaging",
  564. condition: .when(platforms: [.iOS]))],
  565. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  566. ),
  567. .target(
  568. name: "FirebaseInAppMessaging",
  569. dependencies: [
  570. "FirebaseCore",
  571. "FirebaseInstallations",
  572. "FirebaseABTesting",
  573. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  574. .product(name: "nanopb", package: "nanopb"),
  575. ],
  576. path: "FirebaseInAppMessaging/Sources",
  577. exclude: [
  578. "DefaultUI/CHANGELOG.md",
  579. "DefaultUI/README.md",
  580. ],
  581. resources: [.process("Resources")],
  582. publicHeadersPath: "Public",
  583. cSettings: [
  584. .headerSearchPath("../../"),
  585. .define("PB_FIELD_32BIT", to: "1"),
  586. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  587. .define("PB_ENABLE_MALLOC", to: "1"),
  588. ]
  589. ),
  590. .target(
  591. name: "FirebaseInAppMessagingSwift",
  592. dependencies: ["FirebaseInAppMessaging"],
  593. path: "FirebaseInAppMessaging/Swift/Source"
  594. ),
  595. .target(
  596. name: "FirebaseInstanceID",
  597. dependencies: [
  598. "FirebaseCore",
  599. "FirebaseInstallations",
  600. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  601. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  602. ],
  603. path: "Firebase/InstanceID",
  604. exclude: [
  605. "CHANGELOG.md",
  606. ],
  607. publicHeadersPath: "Public",
  608. cSettings: [
  609. .headerSearchPath("../../"),
  610. ]
  611. ),
  612. .target(
  613. name: "FirebaseInstallations",
  614. dependencies: [
  615. "FirebaseCore",
  616. .product(name: "FBLPromises", package: "Promises"),
  617. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  618. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  619. ],
  620. path: "FirebaseInstallations/Source/Library",
  621. publicHeadersPath: "Public",
  622. cSettings: [
  623. .headerSearchPath("../../../"),
  624. ],
  625. linkerSettings: [
  626. .linkedFramework("Security"),
  627. ]
  628. ),
  629. .target(
  630. name: "FirebaseMLModelDownloader",
  631. dependencies: [
  632. "FirebaseCore",
  633. "FirebaseInstallations",
  634. .product(name: "GULLogger", package: "GoogleUtilities"),
  635. "SwiftProtobuf",
  636. ],
  637. path: "FirebaseMLModelDownloader/Sources",
  638. exclude: [
  639. "proto/firebase_ml_log_sdk.proto",
  640. ],
  641. cSettings: [
  642. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  643. ]
  644. ),
  645. .testTarget(
  646. name: "FirebaseMLModelDownloaderUnit",
  647. dependencies: ["FirebaseMLModelDownloader"],
  648. path: "FirebaseMLModelDownloader/Tests/Unit"
  649. ),
  650. .target(
  651. name: "FirebaseMessaging",
  652. dependencies: [
  653. "FirebaseCore",
  654. "FirebaseInstanceID",
  655. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  656. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  657. .product(name: "GULReachability", package: "GoogleUtilities"),
  658. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  659. ],
  660. path: "FirebaseMessaging/Sources",
  661. publicHeadersPath: "Public",
  662. cSettings: [
  663. .headerSearchPath("../../"),
  664. ],
  665. linkerSettings: [
  666. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  667. ]
  668. ),
  669. .testTarget(
  670. name: "MessagingUnit",
  671. dependencies: ["FirebaseMessaging", "OCMock"],
  672. path: "FirebaseMessaging/Tests/UnitTests",
  673. exclude: [
  674. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  675. ],
  676. cSettings: [
  677. .headerSearchPath("../../.."),
  678. ]
  679. ),
  680. .target(
  681. name: "SharedTestUtilities",
  682. dependencies: ["FirebaseCore", "OCMock"],
  683. path: "SharedTestUtilities",
  684. publicHeadersPath: "./",
  685. cSettings: [
  686. .headerSearchPath("../"),
  687. ]
  688. ),
  689. .target(
  690. name: "FirebaseRemoteConfig",
  691. dependencies: [
  692. "FirebaseCore",
  693. "FirebaseABTesting",
  694. "FirebaseInstallations",
  695. .product(name: "GULNSData", package: "GoogleUtilities"),
  696. ],
  697. path: "FirebaseRemoteConfig/Sources",
  698. publicHeadersPath: "Public",
  699. cSettings: [
  700. .headerSearchPath("../../"),
  701. ]
  702. ),
  703. .testTarget(
  704. name: "RemoteConfigUnit",
  705. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  706. path: "FirebaseRemoteConfig/Tests/Unit",
  707. exclude: [
  708. // Need to be evaluated/ported to RC V2.
  709. "RCNConfigAnalyticsTest.m",
  710. "RCNConfigSettingsTest.m",
  711. "RCNConfigTest.m",
  712. "RCNRemoteConfig+FIRAppTest.m",
  713. "RCNThrottlingTests.m",
  714. ],
  715. resources: [
  716. .process("SecondApp-GoogleService-Info.plist"),
  717. .process("Defaults-testInfo.plist"),
  718. .process("TestABTPayload.txt"),
  719. ],
  720. cSettings: [
  721. .headerSearchPath("../../.."),
  722. ]
  723. ),
  724. .target(
  725. name: "FirebaseStorage",
  726. dependencies: [
  727. "FirebaseCore",
  728. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  729. ],
  730. path: "FirebaseStorage/Sources",
  731. publicHeadersPath: "Public",
  732. cSettings: [
  733. .headerSearchPath("../../"),
  734. ],
  735. linkerSettings: [
  736. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS])),
  737. .linkedFramework("CoreServices", .when(platforms: [.macOS])),
  738. ]
  739. ),
  740. .testTarget(
  741. name: "StorageUnit",
  742. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  743. path: "FirebaseStorage/Tests/Unit",
  744. cSettings: [
  745. .headerSearchPath("../../.."),
  746. ]
  747. ),
  748. .target(
  749. name: "FirebaseStorageSwift",
  750. dependencies: ["FirebaseStorage"],
  751. path: "FirebaseStorageSwift/Sources"
  752. ),
  753. .testTarget(
  754. name: "swift-test",
  755. dependencies: [
  756. "FirebaseAuth",
  757. "FirebaseABTesting",
  758. .target(name: "FirebaseAppDistribution",
  759. condition: .when(platforms: [.iOS])),
  760. "Firebase",
  761. "FirebaseCrashlytics",
  762. "FirebaseCore",
  763. "FirebaseDatabase",
  764. "FirebaseDynamicLinks",
  765. "FirebaseFirestore",
  766. "FirebaseFirestoreSwift",
  767. "FirebaseFunctions",
  768. "FirebaseInAppMessaging",
  769. .target(name: "FirebaseInAppMessagingSwift",
  770. condition: .when(platforms: [.iOS, .tvOS])),
  771. "FirebaseInstallations",
  772. "FirebaseMessaging",
  773. "FirebaseRemoteConfig",
  774. "FirebaseStorage",
  775. "FirebaseStorageSwift",
  776. .product(name: "nanopb", package: "nanopb"),
  777. ],
  778. path: "SwiftPMTests/swift-test"
  779. ),
  780. .testTarget(
  781. name: "analytics-import-test",
  782. dependencies: [
  783. "FirebaseAnalyticsSwiftTarget",
  784. "FirebaseAnalyticsWrapper",
  785. "Firebase",
  786. ],
  787. path: "SwiftPMTests/analytics-import-test"
  788. ),
  789. .testTarget(
  790. name: "objc-import-test",
  791. dependencies: [
  792. "FirebaseAuth",
  793. "FirebaseABTesting",
  794. .target(name: "FirebaseAppDistribution",
  795. condition: .when(platforms: [.iOS])),
  796. "Firebase",
  797. "FirebaseCrashlytics",
  798. "FirebaseCore",
  799. "FirebaseDatabase",
  800. "FirebaseDynamicLinks",
  801. "FirebaseFirestore",
  802. "FirebaseFunctions",
  803. "FirebaseInAppMessaging",
  804. "FirebaseInstallations",
  805. "FirebaseMessaging",
  806. "FirebaseRemoteConfig",
  807. "FirebaseStorage",
  808. ],
  809. path: "SwiftPMTests/objc-import-test"
  810. ),
  811. .testTarget(
  812. name: "version-test",
  813. dependencies: [
  814. "FirebaseCore",
  815. ],
  816. path: "SwiftPMTests/version-test",
  817. cSettings: [
  818. .define("FIR_VERSION", to: firebaseVersion),
  819. ]
  820. ),
  821. ],
  822. cLanguageStandard: .c99,
  823. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  824. )