Package.swift 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878
  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.7.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: "FirebaseAuth",
  28. targets: ["FirebaseAuth"]
  29. ),
  30. .library(
  31. name: "FirebaseAppDistribution-Beta",
  32. targets: ["FirebaseAppDistributionTarget"]
  33. ),
  34. .library(
  35. name: "FirebaseCombineSwift-Beta",
  36. targets: ["FirebaseCombineSwift"]
  37. ),
  38. .library(
  39. name: "FirebaseAuthCombineSwift-Beta",
  40. targets: ["FirebaseAuthCombineSwift"]
  41. ),
  42. .library(
  43. name: "FirebaseFirestoreCombineSwift-Beta",
  44. targets: ["FirebaseFirestoreCombineSwift"]
  45. ),
  46. .library(
  47. name: "FirebaseFunctionsCombineSwift-Beta",
  48. targets: ["FirebaseFunctionsCombineSwift"]
  49. ),
  50. .library(
  51. name: "FirebaseCrashlytics",
  52. targets: ["FirebaseCrashlytics"]
  53. ),
  54. .library(
  55. name: "FirebaseDatabase",
  56. targets: ["FirebaseDatabaseTarget"]
  57. ),
  58. .library(
  59. name: "FirebaseDynamicLinks",
  60. targets: ["FirebaseDynamicLinksTarget"]
  61. ),
  62. .library(
  63. name: "FirebaseFirestore",
  64. targets: ["FirebaseFirestoreTarget"]
  65. ),
  66. .library(
  67. name: "FirebaseFirestoreSwift-Beta",
  68. targets: ["FirebaseFirestoreSwiftTarget"]
  69. ),
  70. .library(
  71. name: "FirebaseFunctions",
  72. targets: ["FirebaseFunctionsTarget"]
  73. ),
  74. .library(
  75. name: "FirebaseInAppMessaging-Beta",
  76. targets: ["FirebaseInAppMessagingTarget"]
  77. ),
  78. .library(
  79. name: "FirebaseInstallations",
  80. targets: ["FirebaseInstallations"]
  81. ),
  82. .library(
  83. name: "FirebaseMessaging",
  84. targets: ["FirebaseMessaging"]
  85. ),
  86. .library(
  87. name: "FirebaseMLModelDownloader",
  88. targets: ["FirebaseMLModelDownloader"]
  89. ),
  90. .library(
  91. name: "FirebaseRemoteConfig",
  92. targets: ["FirebaseRemoteConfigTarget"]
  93. ),
  94. .library(
  95. name: "FirebaseStorage",
  96. targets: ["FirebaseStorage"]
  97. ),
  98. .library(
  99. name: "FirebaseStorageSwift-Beta",
  100. targets: ["FirebaseStorageSwift"]
  101. ),
  102. ],
  103. dependencies: [
  104. .package(name: "Promises", url: "https://github.com/google/promises.git", "1.2.8" ..< "1.3.0"),
  105. .package(
  106. name: "SwiftProtobuf",
  107. url: "https://github.com/apple/swift-protobuf.git",
  108. from: "1.14.0"
  109. ),
  110. .package(
  111. name: "GoogleAppMeasurement",
  112. url: "https://github.com/google/GoogleAppMeasurement.git",
  113. .exact("7.5.1")
  114. ),
  115. .package(
  116. name: "GoogleDataTransport",
  117. url: "https://github.com/google/GoogleDataTransport.git",
  118. "8.2.0" ..< "9.0.0"
  119. ),
  120. .package(
  121. name: "GoogleUtilities",
  122. url: "https://github.com/google/GoogleUtilities.git",
  123. "7.2.1" ..< "8.0.0"
  124. ),
  125. .package(
  126. name: "GTMSessionFetcher",
  127. url: "https://github.com/google/gtm-session-fetcher.git",
  128. "1.4.0" ..< "2.0.0"
  129. ),
  130. .package(
  131. name: "nanopb",
  132. url: "https://github.com/firebase/nanopb.git",
  133. // This revision adds SPM enablement to the 0.3.9.6 release tag.
  134. "2.30907.0" ..< "2.30908.0"
  135. ),
  136. .package(name: "abseil",
  137. url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
  138. from: "0.20200225.0"),
  139. .package(
  140. name: "gRPC",
  141. url: "https://github.com/firebase/grpc-SwiftPM.git",
  142. "1.28.2" ..< "1.29.0"
  143. ),
  144. .package(
  145. name: "OCMock",
  146. url: "https://github.com/firebase/ocmock.git",
  147. .revision("7291762d3551c5c7e31c49cce40a0e391a52e889")
  148. ),
  149. .package(
  150. name: "leveldb",
  151. url: "https://github.com/firebase/leveldb.git",
  152. "1.22.1" ..< "1.23.0"
  153. ),
  154. // Branches need a force update with a run with the revision set like below.
  155. // .package(url: "https://github.com/paulb777/nanopb.git", .revision("564392bd87bd093c308a3aaed3997466efb95f74"))
  156. ],
  157. targets: [
  158. .target(
  159. name: "Firebase",
  160. path: "CoreOnly/Sources",
  161. publicHeadersPath: "./"
  162. ),
  163. .target(
  164. name: "FirebaseCore",
  165. dependencies: [
  166. "Firebase",
  167. "FirebaseCoreDiagnostics",
  168. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  169. .product(name: "GULLogger", package: "GoogleUtilities"),
  170. ],
  171. path: "FirebaseCore/Sources",
  172. publicHeadersPath: "Public",
  173. cSettings: [
  174. .headerSearchPath("../.."),
  175. .define("Firebase_VERSION", to: firebaseVersion),
  176. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  177. ],
  178. linkerSettings: [
  179. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  180. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  181. ]
  182. ),
  183. .testTarget(
  184. name: "CoreUnit",
  185. dependencies: ["FirebaseCore", "SharedTestUtilities", "OCMock"],
  186. path: "FirebaseCore/Tests/Unit",
  187. exclude: ["Resources/GoogleService-Info.plist"],
  188. cSettings: [
  189. .headerSearchPath("../../.."),
  190. ]
  191. ),
  192. .target(
  193. name: "FirebaseCoreDiagnostics",
  194. dependencies: [
  195. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  196. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  197. .product(name: "GULLogger", package: "GoogleUtilities"),
  198. .product(name: "nanopb", package: "nanopb"),
  199. ],
  200. path: "Firebase/CoreDiagnostics/FIRCDLibrary",
  201. publicHeadersPath: ".",
  202. cSettings: [
  203. .headerSearchPath("../../.."),
  204. .define("PB_FIELD_32BIT", to: "1"),
  205. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  206. .define("PB_ENABLE_MALLOC", to: "1"),
  207. ]
  208. ),
  209. .target(
  210. name: "FirebaseABTesting",
  211. dependencies: ["FirebaseCore"],
  212. path: "FirebaseABTesting/Sources",
  213. publicHeadersPath: "Public",
  214. cSettings: [
  215. .headerSearchPath("../../"),
  216. ]
  217. ),
  218. .testTarget(
  219. name: "ABTestingUnit",
  220. dependencies: ["FirebaseABTesting", "OCMock"],
  221. path: "FirebaseABTesting/Tests/Unit",
  222. resources: [.process("Resources")],
  223. cSettings: [
  224. .headerSearchPath("../../.."),
  225. ]
  226. ),
  227. .target(
  228. name: "FirebaseAnalyticsTarget",
  229. dependencies: [.target(name: "FirebaseAnalyticsWrapper",
  230. condition: .when(platforms: [.iOS]))],
  231. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
  232. ),
  233. .target(
  234. name: "FirebaseAnalyticsWrapper",
  235. dependencies: [
  236. .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS])),
  237. .product(name: "GoogleAppMeasurement",
  238. package: "GoogleAppMeasurement",
  239. condition: .when(platforms: [.iOS])),
  240. "FirebaseCore",
  241. "FirebaseInstallations",
  242. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  243. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  244. .product(name: "GULNSData", package: "GoogleUtilities"),
  245. .product(name: "GULNetwork", package: "GoogleUtilities"),
  246. .product(name: "nanopb", package: "nanopb"),
  247. ],
  248. path: "FirebaseAnalyticsWrapper",
  249. linkerSettings: [
  250. .linkedLibrary("sqlite3"),
  251. .linkedLibrary("c++"),
  252. .linkedLibrary("z"),
  253. .linkedFramework("StoreKit"),
  254. ]
  255. ),
  256. .binaryTarget(
  257. name: "FirebaseAnalytics",
  258. url: "https://dl.google.com/firebase/ios/swiftpm/7.5.0/FirebaseAnalytics.zip",
  259. checksum: "2a622329e1f233d9bd38333c62c900854cb2eb9c63a00b65df14dadf4ef7988e"
  260. ),
  261. .target(
  262. name: "FirebaseAppDistributionTarget",
  263. dependencies: [.target(name: "FirebaseAppDistribution",
  264. condition: .when(platforms: [.iOS]))],
  265. path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
  266. ),
  267. .target(
  268. name: "FirebaseAppDistribution",
  269. dependencies: [
  270. "FirebaseCore",
  271. "FirebaseInstallations",
  272. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  273. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  274. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  275. ],
  276. path: "FirebaseAppDistribution/Sources",
  277. publicHeadersPath: "Public",
  278. cSettings: [
  279. .headerSearchPath("../../"),
  280. ]
  281. ),
  282. .testTarget(
  283. name: "AppDistributionUnit",
  284. dependencies: ["FirebaseAppDistribution", "OCMock"],
  285. path: "FirebaseAppDistribution/Tests/Unit",
  286. resources: [.process("Resources")],
  287. cSettings: [
  288. .headerSearchPath("../../.."),
  289. ]
  290. ),
  291. .target(
  292. name: "FirebaseAuth",
  293. dependencies: [
  294. "FirebaseCore",
  295. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  296. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  297. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  298. ],
  299. path: "FirebaseAuth/Sources",
  300. publicHeadersPath: "Public",
  301. cSettings: [
  302. .headerSearchPath("../../"),
  303. ],
  304. linkerSettings: [
  305. .linkedFramework("Security"),
  306. .linkedFramework("SafariServices", .when(platforms: [.iOS])),
  307. ]
  308. ),
  309. .testTarget(
  310. name: "AuthUnit",
  311. dependencies: ["FirebaseAuth", "OCMock"],
  312. path: "FirebaseAuth/Tests/Unit",
  313. exclude: [
  314. "FIRAuthKeychainServicesTests.m", // TODO: figure out SPM keychain testing
  315. "FIRAuthTests.m",
  316. "FIRUserTests.m",
  317. ],
  318. cSettings: [
  319. .headerSearchPath("../../.."),
  320. ]
  321. ),
  322. .target(
  323. name: "FirebaseCombineSwift",
  324. dependencies: [
  325. "FirebaseAuthCombineSwift",
  326. "FirebaseFirestoreCombineSwift",
  327. "FirebaseFunctionsCombineSwift",
  328. ],
  329. path: "FirebaseCombineSwift/Sources/Core"
  330. ),
  331. .target(
  332. name: "FirebaseAuthCombineSwift",
  333. dependencies: ["FirebaseAuth"],
  334. path: "FirebaseCombineSwift/Sources/Auth"
  335. ),
  336. .target(
  337. name: "FirebaseFirestoreCombineSwift",
  338. dependencies: ["FirebaseFirestore", "FirebaseFirestoreSwift"],
  339. path: "FirebaseCombineSwift/Sources/Firestore"
  340. ),
  341. .target(
  342. name: "FirebaseFunctionsCombineSwift",
  343. dependencies: ["FirebaseFunctions"],
  344. path: "FirebaseCombineSwift/Sources/Functions"
  345. ),
  346. .target(
  347. name: "FirebaseCrashlytics",
  348. dependencies: ["FirebaseCore", "FirebaseInstallations",
  349. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  350. .product(name: "FBLPromises", package: "Promises"),
  351. .product(name: "nanopb", package: "nanopb")],
  352. path: "Crashlytics",
  353. exclude: [
  354. "run",
  355. "CHANGELOG.md",
  356. "LICENSE",
  357. "README.md",
  358. "Data/",
  359. "Protos/",
  360. "ProtoSupport/",
  361. "UnitTests/",
  362. "generate_project.sh",
  363. "upload-symbols",
  364. "third_party/libunwind/LICENSE",
  365. ],
  366. sources: [
  367. "Crashlytics/",
  368. "Protogen/",
  369. "Shared/",
  370. "third_party/libunwind/dwarf.h",
  371. ],
  372. publicHeadersPath: "Crashlytics/Public",
  373. cSettings: [
  374. .headerSearchPath(".."),
  375. .define("DISPLAY_VERSION", to: firebaseVersion),
  376. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  377. .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: [.macOS])),
  378. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  379. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  380. .define("PB_FIELD_32BIT", to: "1"),
  381. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  382. .define("PB_ENABLE_MALLOC", to: "1"),
  383. ],
  384. linkerSettings: [
  385. .linkedFramework("Security"),
  386. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  387. ]
  388. ),
  389. .target(
  390. name: "FirebaseDatabaseTarget",
  391. dependencies: [.target(name: "FirebaseDatabase",
  392. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  393. path: "SwiftPM-PlatformExclude/FirebaseDatabaseWrap"
  394. ),
  395. .target(
  396. name: "FirebaseDatabase",
  397. dependencies: [
  398. "FirebaseCore",
  399. "leveldb",
  400. ],
  401. path: "FirebaseDatabase/Sources",
  402. exclude: [
  403. "third_party/Wrap-leveldb/LICENSE",
  404. "third_party/SocketRocket/LICENSE",
  405. "third_party/FImmutableSortedDictionary/LICENSE",
  406. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  407. ],
  408. publicHeadersPath: "Public",
  409. cSettings: [
  410. .headerSearchPath("../../"),
  411. ],
  412. linkerSettings: [
  413. .linkedFramework("CFNetwork"),
  414. .linkedFramework("Security"),
  415. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  416. ]
  417. ),
  418. .testTarget(
  419. name: "DatabaseUnit",
  420. dependencies: ["FirebaseDatabase", "OCMock", "SharedTestUtilities"],
  421. path: "FirebaseDatabase/Tests/",
  422. exclude: [
  423. "Integration/",
  424. ],
  425. resources: [.process("Resources")],
  426. cSettings: [
  427. .headerSearchPath("../.."),
  428. ]
  429. ),
  430. .target(
  431. name: "FirebaseDynamicLinksTarget",
  432. dependencies: [.target(name: "FirebaseDynamicLinks",
  433. condition: .when(platforms: [.iOS]))],
  434. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  435. ),
  436. .target(
  437. name: "FirebaseDynamicLinks",
  438. dependencies: ["FirebaseCore"],
  439. path: "FirebaseDynamicLinks/Sources",
  440. publicHeadersPath: "Public",
  441. cSettings: [
  442. .headerSearchPath("../../"),
  443. .define("FIRDynamicLinks3P", to: "1"),
  444. .define("GIN_SCION_LOGGING", to: "1"),
  445. ],
  446. linkerSettings: [
  447. .linkedFramework("QuartzCore"),
  448. ]
  449. ),
  450. .target(
  451. name: "FirebaseFirestoreTarget",
  452. dependencies: [.target(name: "FirebaseFirestore",
  453. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  454. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  455. ),
  456. .target(
  457. name: "FirebaseFirestore",
  458. dependencies: [
  459. "FirebaseCore",
  460. "leveldb",
  461. .product(name: "nanopb", package: "nanopb"),
  462. .product(name: "abseil", package: "abseil"),
  463. .product(name: "gRPC-cpp", package: "gRPC"),
  464. ],
  465. path: "Firestore",
  466. exclude: [
  467. "CHANGELOG.md",
  468. "CMakeLists.txt",
  469. "Example/",
  470. "Protos/CMakeLists.txt",
  471. "Protos/Podfile",
  472. "Protos/README.md",
  473. "Protos/build_protos.py",
  474. "Protos/cpp/",
  475. "Protos/lib/",
  476. "Protos/nanopb_cpp_generator.py",
  477. "Protos/protos/",
  478. "README.md",
  479. "Source/CMakeLists.txt",
  480. "Swift/",
  481. "core/CMakeLists.txt",
  482. "core/src/util/config_detected.h.in",
  483. "core/test/",
  484. "fuzzing/",
  485. "test.sh",
  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/FirestoreEncoder/LICENSE",
  541. "third_party/FirestoreEncoder/METADATA",
  542. ],
  543. sources: [
  544. "Swift/Source/",
  545. "third_party/FirestoreEncoder/",
  546. ]
  547. ),
  548. .target(
  549. name: "FirebaseFunctionsTarget",
  550. dependencies: [.target(name: "FirebaseFunctions",
  551. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  552. path: "SwiftPM-PlatformExclude/FirebaseFunctionsWrap"
  553. ),
  554. .target(
  555. name: "FirebaseFunctions",
  556. dependencies: [
  557. "FirebaseCore",
  558. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  559. ],
  560. path: "Functions/FirebaseFunctions",
  561. publicHeadersPath: "Public",
  562. cSettings: [
  563. .headerSearchPath("../../"),
  564. ]
  565. ),
  566. .target(
  567. name: "FirebaseInAppMessagingTarget",
  568. dependencies: [.target(name: "FirebaseInAppMessaging",
  569. condition: .when(platforms: [.iOS]))],
  570. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  571. ),
  572. .target(
  573. name: "FirebaseInAppMessaging",
  574. dependencies: [
  575. "FirebaseCore",
  576. "FirebaseInstallations",
  577. "FirebaseABTesting",
  578. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  579. .product(name: "nanopb", package: "nanopb"),
  580. ],
  581. path: "FirebaseInAppMessaging/Sources",
  582. exclude: [
  583. "DefaultUI/CHANGELOG.md",
  584. "DefaultUI/README.md",
  585. ],
  586. resources: [.process("Resources")],
  587. publicHeadersPath: "Public",
  588. cSettings: [
  589. .headerSearchPath("../../"),
  590. .define("PB_FIELD_32BIT", to: "1"),
  591. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  592. .define("PB_ENABLE_MALLOC", to: "1"),
  593. ]
  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: "FirebaseRemoteConfigTarget",
  691. dependencies: [.target(name: "FirebaseRemoteConfig",
  692. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  693. path: "SwiftPM-PlatformExclude/FirebaseRemoteConfigWrap"
  694. ),
  695. .target(
  696. name: "FirebaseRemoteConfig",
  697. dependencies: [
  698. "FirebaseCore",
  699. "FirebaseABTesting",
  700. "FirebaseInstallations",
  701. .product(name: "GULNSData", package: "GoogleUtilities"),
  702. ],
  703. path: "FirebaseRemoteConfig/Sources",
  704. publicHeadersPath: "Public",
  705. cSettings: [
  706. .headerSearchPath("../../"),
  707. ]
  708. ),
  709. .testTarget(
  710. name: "RemoteConfigUnit",
  711. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  712. path: "FirebaseRemoteConfig/Tests/Unit",
  713. exclude: [
  714. // Need to be evaluated/ported to RC V2.
  715. "RCNConfigAnalyticsTest.m",
  716. "RCNConfigSettingsTest.m",
  717. "RCNConfigTest.m",
  718. "RCNRemoteConfig+FIRAppTest.m",
  719. "RCNThrottlingTests.m",
  720. ],
  721. resources: [
  722. .process("SecondApp-GoogleService-Info.plist"),
  723. .process("Defaults-testInfo.plist"),
  724. .process("TestABTPayload.txt"),
  725. ],
  726. cSettings: [
  727. .headerSearchPath("../../.."),
  728. ]
  729. ),
  730. .target(
  731. name: "FirebaseStorage",
  732. dependencies: [
  733. "FirebaseCore",
  734. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  735. ],
  736. path: "FirebaseStorage/Sources",
  737. publicHeadersPath: "Public",
  738. cSettings: [
  739. .headerSearchPath("../../"),
  740. ],
  741. linkerSettings: [
  742. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS])),
  743. .linkedFramework("CoreServices", .when(platforms: [.macOS])),
  744. ]
  745. ),
  746. .testTarget(
  747. name: "StorageUnit",
  748. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  749. path: "FirebaseStorage/Tests/Unit",
  750. cSettings: [
  751. .headerSearchPath("../../.."),
  752. ]
  753. ),
  754. .target(
  755. name: "FirebaseStorageSwift",
  756. dependencies: ["FirebaseStorage"],
  757. path: "FirebaseStorageSwift/Sources"
  758. ),
  759. .testTarget(
  760. name: "swift-test",
  761. dependencies: [
  762. "FirebaseAuth",
  763. "FirebaseABTesting",
  764. .target(name: "FirebaseAppDistribution",
  765. condition: .when(platforms: [.iOS])),
  766. "Firebase",
  767. "FirebaseCombineSwift",
  768. "FirebaseCrashlytics",
  769. "FirebaseCore",
  770. "FirebaseDatabase",
  771. "FirebaseDynamicLinks",
  772. "FirebaseFirestore",
  773. "FirebaseFirestoreSwift",
  774. "FirebaseFunctions",
  775. "FirebaseInAppMessaging",
  776. "FirebaseInstallations",
  777. "FirebaseMessaging",
  778. "FirebaseRemoteConfig",
  779. "FirebaseStorage",
  780. "FirebaseStorageSwift",
  781. .product(name: "nanopb", package: "nanopb"),
  782. ],
  783. path: "SwiftPMTests/swift-test"
  784. ),
  785. .testTarget(
  786. name: "analytics-import-test",
  787. dependencies: [
  788. "FirebaseAnalyticsWrapper",
  789. "Firebase",
  790. ],
  791. path: "SwiftPMTests/analytics-import-test"
  792. ),
  793. .testTarget(
  794. name: "objc-import-test",
  795. dependencies: [
  796. "FirebaseAuth",
  797. "FirebaseABTesting",
  798. .target(name: "FirebaseAppDistribution",
  799. condition: .when(platforms: [.iOS])),
  800. "Firebase",
  801. "FirebaseCrashlytics",
  802. "FirebaseCore",
  803. "FirebaseDatabase",
  804. "FirebaseDynamicLinks",
  805. "FirebaseFirestore",
  806. "FirebaseFunctions",
  807. "FirebaseInAppMessaging",
  808. "FirebaseInstallations",
  809. "FirebaseMessaging",
  810. "FirebaseRemoteConfig",
  811. "FirebaseStorage",
  812. ],
  813. path: "SwiftPMTests/objc-import-test"
  814. ),
  815. .testTarget(
  816. name: "version-test",
  817. dependencies: [
  818. "FirebaseCore",
  819. ],
  820. path: "SwiftPMTests/version-test",
  821. cSettings: [
  822. .define("FIR_VERSION", to: firebaseVersion),
  823. ]
  824. ),
  825. // MARK: Testing support
  826. .target(
  827. name: "FirebaseFirestoreTestingSupport",
  828. dependencies: ["FirebaseFirestore"],
  829. path: "FirebaseTestingSupport/Firestore/Sources",
  830. publicHeadersPath: "./",
  831. cSettings: [
  832. .headerSearchPath("../../.."),
  833. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  834. ]
  835. ),
  836. .testTarget(
  837. name: "FirestoreTestingSupportTests",
  838. dependencies: ["FirebaseFirestoreTestingSupport"],
  839. path: "FirebaseTestingSupport/Firestore/Tests",
  840. cSettings: [
  841. .headerSearchPath("../../.."),
  842. ]
  843. ),
  844. ],
  845. cLanguageStandard: .c99,
  846. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  847. )