Package.swift 29 KB

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