Package.swift 27 KB

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