Package.swift 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912
  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.0.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: .some([.iOS, .tvOS]))),
  145. .linkedFramework("AppKit", .when(platforms: .some([.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: .some([.iOS]))),
  202. .target(name: "FIRAnalyticsConnector", condition: .when(platforms: .some([.iOS]))),
  203. .target(name: "GoogleAppMeasurement", condition: .when(platforms: .some([.iOS]))),
  204. "FirebaseCore",
  205. "FirebaseInstallations",
  206. "GoogleUtilities_AppDelegateSwizzler",
  207. "GoogleUtilities_MethodSwizzler",
  208. "GoogleUtilities_NSData",
  209. "GoogleUtilities_Network",
  210. .product(name: "nanopb", package: "nanopb"),
  211. ],
  212. path: "FirebaseAnalyticsWrapper",
  213. linkerSettings: [
  214. .linkedLibrary("sqlite3"),
  215. .linkedLibrary("c++"),
  216. .linkedLibrary("z"),
  217. .linkedFramework("StoreKit"),
  218. ]
  219. ),
  220. .binaryTarget(
  221. name: "FirebaseAnalytics",
  222. url: "https://dl.google.com/firebase/ios/swiftpm/7.0.0/FirebaseAnalytics.zip",
  223. checksum: "8d835a816ec3f279d76d0d164f0b6fc0827239e26ed59a1acd277ed40d26243f"
  224. ),
  225. .binaryTarget(
  226. name: "FIRAnalyticsConnector",
  227. url: "https://dl.google.com/firebase/ios/swiftpm/7.0.0/FIRAnalyticsConnector.zip",
  228. checksum: "bdbf31a06ef741456bd386ad3f10529103953c330771d140e021e5a467d89395"
  229. ),
  230. .binaryTarget(
  231. name: "GoogleAppMeasurement",
  232. url: "https://dl.google.com/firebase/ios/swiftpm/7.0.0/GoogleAppMeasurement.zip",
  233. checksum: "50fd6e762fc44f92a835bebf34ce8ecc9589ef34681be1cb41779bec9e44e652"
  234. ),
  235. .target(
  236. name: "FirebaseAuth",
  237. dependencies: ["FirebaseCore",
  238. "GoogleUtilities_Environment",
  239. "GoogleUtilities_AppDelegateSwizzler",
  240. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher")],
  241. path: "FirebaseAuth/Sources",
  242. publicHeadersPath: "Public",
  243. cSettings: [
  244. .headerSearchPath("../../"),
  245. ],
  246. linkerSettings: [
  247. .linkedFramework("Security"),
  248. .linkedFramework("SafariServices", .when(platforms: .some([.iOS]))),
  249. ]
  250. ),
  251. .testTarget(
  252. name: "AuthUnit",
  253. dependencies: ["FirebaseAuth", "OCMock"],
  254. path: "FirebaseAuth/Tests/Unit",
  255. exclude: [
  256. "FIRAuthKeychainServicesTests.m", // TODO: figure out SPM keychain testing
  257. "FIRAuthTests.m",
  258. "FIRUserTests.m",
  259. ],
  260. cSettings: [
  261. .headerSearchPath("../../.."),
  262. ]
  263. ),
  264. .target(
  265. name: "FirebaseCrashlytics",
  266. dependencies: ["FirebaseCore", "FirebaseInstallations", "GoogleDataTransport",
  267. .product(name: "FBLPromises", package: "Promises"),
  268. .product(name: "nanopb", package: "nanopb")],
  269. path: "Crashlytics",
  270. exclude: [
  271. "run",
  272. "CHANGELOG.md",
  273. "LICENSE",
  274. "README.md",
  275. "Data/",
  276. "Protos/",
  277. "ProtoSupport/",
  278. "UnitTests/",
  279. "generate_project.sh",
  280. "upload-symbols",
  281. "third_party/libunwind/LICENSE",
  282. ],
  283. sources: [
  284. "Crashlytics/",
  285. "Protogen/",
  286. "Shared/",
  287. "third_party/libunwind/dwarf.h",
  288. ],
  289. publicHeadersPath: "Crashlytics/Public",
  290. cSettings: [
  291. .headerSearchPath(".."),
  292. .define("DISPLAY_VERSION", to: firebaseVersion),
  293. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: .some([.iOS]))),
  294. .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: .some([.macOS]))),
  295. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: .some([.tvOS]))),
  296. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: .some([.watchOS]))),
  297. .define("PB_FIELD_32BIT", to: "1"),
  298. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  299. .define("PB_ENABLE_MALLOC", to: "1"),
  300. ],
  301. linkerSettings: [
  302. .linkedFramework("Security"),
  303. .linkedFramework("SystemConfiguration", .when(platforms: .some([.iOS, .macOS, .tvOS]))),
  304. ]
  305. ),
  306. .target(
  307. name: "FirebaseDatabaseTarget",
  308. dependencies: [.target(name: "FirebaseDatabase",
  309. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  310. path: "SwiftPM-PlatformExclude/FirebaseDatabaseWrap"
  311. ),
  312. .target(
  313. name: "FirebaseDatabase",
  314. dependencies: [
  315. "FirebaseCore",
  316. "leveldb",
  317. ],
  318. path: "FirebaseDatabase/Sources",
  319. exclude: [
  320. "third_party/Wrap-leveldb/LICENSE",
  321. "third_party/SocketRocket/LICENSE",
  322. "third_party/FImmutableSortedDictionary/LICENSE",
  323. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  324. ],
  325. publicHeadersPath: "Public",
  326. cSettings: [
  327. .headerSearchPath("../../"),
  328. ],
  329. linkerSettings: [
  330. .linkedFramework("CFNetwork"),
  331. .linkedFramework("Security"),
  332. .linkedFramework("SystemConfiguration", .when(platforms: .some([.iOS, .macOS, .tvOS]))),
  333. ]
  334. ),
  335. .testTarget(
  336. name: "DatabaseUnit",
  337. dependencies: ["FirebaseDatabase", "OCMock", "SharedTestUtilities"],
  338. path: "FirebaseDatabase/Tests/",
  339. exclude: [
  340. "Integration/",
  341. ],
  342. resources: [.process("Resources")],
  343. cSettings: [
  344. .headerSearchPath("../.."),
  345. ]
  346. ),
  347. .target(
  348. name: "FirebaseDynamicLinksTarget",
  349. dependencies: [.target(name: "FirebaseDynamicLinks",
  350. condition: .when(platforms: [.iOS]))],
  351. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  352. ),
  353. .target(
  354. name: "FirebaseDynamicLinks",
  355. dependencies: ["FirebaseCore"],
  356. path: "FirebaseDynamicLinks/Sources",
  357. publicHeadersPath: "Public",
  358. cSettings: [
  359. .headerSearchPath("../../"),
  360. .define("FIRDynamicLinks3P", to: "1"),
  361. .define("GIN_SCION_LOGGING", to: "1"),
  362. ],
  363. linkerSettings: [
  364. .linkedFramework("QuartzCore"),
  365. ]
  366. ),
  367. .target(
  368. name: "FirebaseFirestoreTarget",
  369. dependencies: [.target(name: "FirebaseFirestore",
  370. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  371. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  372. ),
  373. .target(
  374. name: "FirebaseFirestore",
  375. dependencies: [
  376. "FirebaseCore",
  377. "leveldb",
  378. .product(name: "nanopb", package: "nanopb"),
  379. .product(name: "abseil", package: "abseil"),
  380. .product(name: "gRPC-cpp", package: "gRPC"),
  381. ],
  382. path: "Firestore",
  383. exclude: [
  384. "CHANGELOG.md",
  385. "CMakeLists.txt",
  386. "Example/",
  387. "Protos/CMakeLists.txt",
  388. "Protos/Podfile",
  389. "Protos/README.md",
  390. "Protos/build_protos.py",
  391. "Protos/cpp/",
  392. "Protos/lib/",
  393. "Protos/nanopb_cpp_generator.py",
  394. "Protos/protos/",
  395. "README.md",
  396. "Source/CMakeLists.txt",
  397. "Swift/",
  398. "core/CMakeLists.txt",
  399. "core/src/util/config_detected.h.in",
  400. "core/test/",
  401. "fuzzing/",
  402. "test.sh",
  403. "third_party/",
  404. // Exclude alternate implementations for other platforms
  405. "core/src/api/input_validation_std.cc",
  406. "core/src/remote/connectivity_monitor_noop.cc",
  407. "core/src/util/filesystem_win.cc",
  408. "core/src/util/hard_assert_stdio.cc",
  409. "core/src/util/log_stdio.cc",
  410. "core/src/util/secure_random_openssl.cc",
  411. ],
  412. sources: [
  413. "Source/",
  414. "Protos/nanopb/",
  415. "core/include/",
  416. "core/src",
  417. ],
  418. publicHeadersPath: "Source/Public",
  419. cSettings: [
  420. .headerSearchPath("../"),
  421. .headerSearchPath("Source/Public/FirebaseFirestore"),
  422. .headerSearchPath("Protos/nanopb"),
  423. .define("PB_FIELD_32BIT", to: "1"),
  424. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  425. .define("PB_ENABLE_MALLOC", to: "1"),
  426. .define("FIRFirestore_VERSION", to: firebaseVersion),
  427. ],
  428. linkerSettings: [
  429. .linkedFramework("SystemConfiguration", .when(platforms: .some([.iOS, .macOS, .tvOS]))),
  430. .linkedFramework("MobileCoreServices", .when(platforms: .some([.iOS]))),
  431. .linkedFramework("UIKit", .when(platforms: .some([.iOS, .tvOS]))),
  432. .linkedLibrary("c++"),
  433. ]
  434. ),
  435. .target(
  436. name: "FirebaseFirestoreSwiftTarget",
  437. dependencies: [.target(name: "FirebaseFirestoreSwift",
  438. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  439. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  440. ),
  441. .target(
  442. name: "FirebaseFirestoreSwift",
  443. dependencies: ["FirebaseFirestore"],
  444. path: "Firestore",
  445. exclude: [
  446. "CHANGELOG.md",
  447. "CMakeLists.txt",
  448. "Example/",
  449. "Protos/",
  450. "README.md",
  451. "Source/",
  452. "core/",
  453. "fuzzing/",
  454. "test.sh",
  455. "Swift/CHANGELOG.md",
  456. "Swift/README.md",
  457. "Swift/Tests/",
  458. "third_party/FirestoreEncoder/LICENSE",
  459. "third_party/FirestoreEncoder/METADATA",
  460. ],
  461. sources: [
  462. "Swift/Source/",
  463. "third_party/FirestoreEncoder/",
  464. ]
  465. ),
  466. .target(
  467. name: "FirebaseFunctionsTarget",
  468. dependencies: [.target(name: "FirebaseFunctions",
  469. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  470. path: "SwiftPM-PlatformExclude/FirebaseFunctionsWrap"
  471. ),
  472. .target(
  473. name: "FirebaseFunctions",
  474. dependencies: [
  475. "FirebaseCore",
  476. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  477. ],
  478. path: "Functions/FirebaseFunctions",
  479. publicHeadersPath: "Public",
  480. cSettings: [
  481. .headerSearchPath("../../"),
  482. ]
  483. ),
  484. .target(
  485. name: "FirebaseInAppMessagingTarget",
  486. dependencies: [.target(name: "FirebaseInAppMessaging",
  487. condition: .when(platforms: [.iOS]))],
  488. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  489. ),
  490. .target(
  491. name: "FirebaseInAppMessaging",
  492. dependencies: [
  493. "FirebaseCore",
  494. "FirebaseInstallations",
  495. "FirebaseABTesting",
  496. "GoogleUtilities_Environment",
  497. .product(name: "nanopb", package: "nanopb"),
  498. ],
  499. path: "FirebaseInAppMessaging/Sources",
  500. exclude: [
  501. "DefaultUI/CHANGELOG.md",
  502. "DefaultUI/README.md",
  503. ],
  504. resources: [.process("Resources")],
  505. publicHeadersPath: "Public",
  506. cSettings: [
  507. .headerSearchPath("../../"),
  508. .define("PB_FIELD_32BIT", to: "1"),
  509. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  510. .define("PB_ENABLE_MALLOC", to: "1"),
  511. ]
  512. ),
  513. .target(
  514. name: "FirebaseInstanceID",
  515. dependencies: ["FirebaseCore", "FirebaseInstallations",
  516. "GoogleUtilities_Environment", "GoogleUtilities_UserDefaults"],
  517. path: "Firebase/InstanceID",
  518. exclude: [
  519. "CHANGELOG.md",
  520. ],
  521. publicHeadersPath: "Public",
  522. cSettings: [
  523. .headerSearchPath("../../"),
  524. ]
  525. ),
  526. .target(
  527. name: "FirebaseInstallations",
  528. dependencies: ["FirebaseCore", .product(name: "FBLPromises", package: "Promises"),
  529. "GoogleUtilities_Environment", "GoogleUtilities_UserDefaults"],
  530. path: "FirebaseInstallations/Source/Library",
  531. publicHeadersPath: "Public",
  532. cSettings: [
  533. .headerSearchPath("../../../"),
  534. ],
  535. linkerSettings: [
  536. .linkedFramework("Security"),
  537. ]
  538. ),
  539. .target(
  540. name: "FirebaseMessaging",
  541. dependencies: [
  542. "FirebaseCore",
  543. "FirebaseInstanceID",
  544. "GoogleUtilities_AppDelegateSwizzler",
  545. "GoogleUtilities_Environment",
  546. "GoogleUtilities_Reachability",
  547. "GoogleUtilities_UserDefaults",
  548. ],
  549. path: "FirebaseMessaging/Sources",
  550. publicHeadersPath: "Public",
  551. cSettings: [
  552. .headerSearchPath("../../"),
  553. ],
  554. linkerSettings: [
  555. .linkedFramework("SystemConfiguration", .when(platforms: .some([.iOS, .macOS, .tvOS]))),
  556. ]
  557. ),
  558. .testTarget(
  559. name: "MessagingUnit",
  560. dependencies: ["FirebaseMessaging", "OCMock"],
  561. path: "FirebaseMessaging/Tests/UnitTests",
  562. exclude: [
  563. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  564. ],
  565. cSettings: [
  566. .headerSearchPath("../../.."),
  567. ]
  568. ),
  569. .target(
  570. name: "SharedTestUtilities",
  571. dependencies: ["FirebaseCore", "OCMock"],
  572. path: "SharedTestUtilities",
  573. publicHeadersPath: "./",
  574. cSettings: [
  575. .headerSearchPath("../"),
  576. ]
  577. ),
  578. .target(
  579. name: "FirebaseRemoteConfigTarget",
  580. dependencies: [.target(name: "FirebaseRemoteConfig",
  581. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  582. path: "SwiftPM-PlatformExclude/FirebaseRemoteConfigWrap"
  583. ),
  584. .target(
  585. name: "FirebaseRemoteConfig",
  586. dependencies: [
  587. "FirebaseCore",
  588. "FirebaseABTesting",
  589. "FirebaseInstallations",
  590. "GoogleUtilities_NSData",
  591. ],
  592. path: "FirebaseRemoteConfig/Sources",
  593. publicHeadersPath: "Public",
  594. cSettings: [
  595. .headerSearchPath("../../"),
  596. ]
  597. ),
  598. .testTarget(
  599. name: "RemoteConfigUnit",
  600. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  601. path: "FirebaseRemoteConfig/Tests/Unit",
  602. exclude: [
  603. // Need to be evaluated/ported to RC V2.
  604. "RCNConfigAnalyticsTest.m",
  605. "RCNConfigSettingsTest.m",
  606. "RCNConfigTest.m",
  607. "RCNRemoteConfig+FIRAppTest.m",
  608. "RCNThrottlingTests.m",
  609. ],
  610. resources: [
  611. .process("SecondApp-GoogleService-Info.plist"),
  612. .process("Defaults-testInfo.plist"),
  613. .process("TestABTPayload.txt"),
  614. ],
  615. cSettings: [
  616. .headerSearchPath("../../.."),
  617. ]
  618. ),
  619. .target(
  620. name: "FirebaseStorage",
  621. dependencies: [
  622. "FirebaseCore",
  623. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  624. ],
  625. path: "FirebaseStorage/Sources",
  626. publicHeadersPath: "Public",
  627. cSettings: [
  628. .headerSearchPath("../../"),
  629. ],
  630. linkerSettings: [
  631. .linkedFramework("MobileCoreServices", .when(platforms: .some([.iOS]))),
  632. .linkedFramework("CoreServices", .when(platforms: .some([.macOS]))),
  633. ]
  634. ),
  635. .testTarget(
  636. name: "StorageUnit",
  637. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  638. path: "FirebaseStorage/Tests/Unit",
  639. cSettings: [
  640. .headerSearchPath("../../.."),
  641. ]
  642. ),
  643. .target(
  644. name: "FirebaseStorageSwift",
  645. dependencies: ["FirebaseStorage"],
  646. path: "FirebaseStorageSwift/Sources"
  647. ),
  648. .target(
  649. name: "GoogleDataTransport",
  650. dependencies: [
  651. .product(name: "nanopb", package: "nanopb"),
  652. ],
  653. path: "GoogleDataTransport",
  654. exclude: [
  655. "CHANGELOG.md",
  656. "README.md",
  657. "generate_project.sh",
  658. "GDTCCTWatchOSTestApp/",
  659. "GDTWatchOSTestApp/",
  660. "GDTCCTTestApp/",
  661. "GDTTestApp/",
  662. "GDTCCTTests/",
  663. "GDTCORTests/",
  664. "ProtoSupport/",
  665. ],
  666. sources: [
  667. "GDTCORLibrary",
  668. "GDTCCTLibrary",
  669. ],
  670. publicHeadersPath: "GDTCORLibrary/Public",
  671. cSettings: [
  672. .headerSearchPath("../"),
  673. .define("GDTCOR_VERSION", to: "0.0.1"),
  674. .define("PB_FIELD_32BIT", to: "1"),
  675. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  676. .define("PB_ENABLE_MALLOC", to: "1"),
  677. ],
  678. linkerSettings: [
  679. .linkedFramework("SystemConfiguration", .when(platforms: .some([.iOS, .macOS, .tvOS]))),
  680. .linkedFramework("CoreTelephony", .when(platforms: .some([.macOS, .iOS]))),
  681. ]
  682. ),
  683. .testTarget(
  684. name: "swift-test",
  685. dependencies: [
  686. "FirebaseAuth",
  687. "FirebaseABTesting",
  688. "Firebase",
  689. "FirebaseCrashlytics",
  690. "FirebaseCore",
  691. "FirebaseDatabase",
  692. "FirebaseDynamicLinks",
  693. "FirebaseFirestore",
  694. "FirebaseFirestoreSwift",
  695. "FirebaseFunctions",
  696. "FirebaseInAppMessaging",
  697. "FirebaseInstallations",
  698. "FirebaseMessaging",
  699. "FirebaseRemoteConfig",
  700. "FirebaseStorage",
  701. "FirebaseStorageSwift",
  702. "GoogleDataTransport",
  703. "GoogleUtilities_AppDelegateSwizzler",
  704. "GoogleUtilities_Environment",
  705. // "GoogleUtilities_ISASwizzler", // Build needs to disable ARC.
  706. "GoogleUtilities_Logger",
  707. "GoogleUtilities_MethodSwizzler",
  708. "GoogleUtilities_Network",
  709. "GoogleUtilities_NSData",
  710. "GoogleUtilities_Reachability",
  711. "GoogleUtilities_UserDefaults",
  712. .product(name: "nanopb", package: "nanopb"),
  713. ],
  714. path: "SwiftPMTests/swift-test"
  715. ),
  716. .testTarget(
  717. name: "analytics-import-test",
  718. dependencies: [
  719. "FirebaseAnalyticsWrapper",
  720. "Firebase",
  721. ],
  722. path: "SwiftPMTests/analytics-import-test"
  723. ),
  724. .testTarget(
  725. name: "objc-import-test",
  726. dependencies: [
  727. "FirebaseAuth",
  728. "FirebaseABTesting",
  729. "Firebase",
  730. "FirebaseCrashlytics",
  731. "FirebaseCore",
  732. "FirebaseDatabase",
  733. "FirebaseDynamicLinks",
  734. "FirebaseFirestore",
  735. "FirebaseFunctions",
  736. "FirebaseInAppMessaging",
  737. "FirebaseInstallations",
  738. "FirebaseMessaging",
  739. "FirebaseRemoteConfig",
  740. "FirebaseStorage",
  741. ],
  742. path: "SwiftPMTests/objc-import-test"
  743. ),
  744. .testTarget(
  745. name: "version-test",
  746. dependencies: [
  747. "FirebaseCore",
  748. ],
  749. path: "SwiftPMTests/version-test",
  750. cSettings: [
  751. .define("FIR_VERSION", to: firebaseVersion),
  752. ]
  753. ),
  754. .target(
  755. name: "GoogleUtilities_AppDelegateSwizzler",
  756. dependencies: ["GoogleUtilities_Environment", "GoogleUtilities_Logger",
  757. "GoogleUtilities_Network"],
  758. path: "GoogleUtilities",
  759. exclude: [
  760. "CHANGELOG.md",
  761. "CMakeLists.txt",
  762. "LICENSE",
  763. "README.md",
  764. "AppDelegateSwizzler/README.md",
  765. "Environment/",
  766. "Network/",
  767. "ISASwizzler/",
  768. "Logger/",
  769. "MethodSwizzler/",
  770. "NSData+zlib/",
  771. "Reachability",
  772. "SwizzlerTestHelpers/",
  773. "Tests",
  774. "UserDefaults/",
  775. ],
  776. sources: [
  777. "AppDelegateSwizzler/",
  778. "SceneDelegateSwizzler/",
  779. "Common/*.h",
  780. ],
  781. publicHeadersPath: "AppDelegateSwizzler/Public",
  782. cSettings: [
  783. .headerSearchPath("../"),
  784. ]
  785. ),
  786. .target(
  787. name: "GoogleUtilities_Environment",
  788. dependencies: [.product(name: "FBLPromises", package: "Promises")],
  789. path: "GoogleUtilities/Environment",
  790. exclude: ["third_party/LICENSE"],
  791. publicHeadersPath: "Public",
  792. cSettings: [
  793. .headerSearchPath("../../"),
  794. ]
  795. ),
  796. .target(
  797. name: "GoogleUtilities_Logger",
  798. dependencies: ["GoogleUtilities_Environment"],
  799. path: "GoogleUtilities/Logger",
  800. publicHeadersPath: "Public",
  801. cSettings: [
  802. .headerSearchPath("../../"),
  803. ]
  804. ),
  805. // TODO: ISA_Swizzler requires building without ARC.
  806. .target(
  807. name: "GoogleUtilities_MethodSwizzler",
  808. dependencies: ["GoogleUtilities_Logger"],
  809. path: "GoogleUtilities/MethodSwizzler",
  810. publicHeadersPath: "Public",
  811. cSettings: [
  812. .headerSearchPath("../../"),
  813. ]
  814. ),
  815. .target(
  816. name: "GoogleUtilities_Network",
  817. dependencies: ["GoogleUtilities_Logger", "GoogleUtilities_NSData",
  818. "GoogleUtilities_Reachability"],
  819. path: "GoogleUtilities/Network",
  820. publicHeadersPath: "Public",
  821. cSettings: [
  822. .headerSearchPath("../.."),
  823. ]
  824. ),
  825. .target(
  826. name: "GoogleUtilities_NSData",
  827. path: "GoogleUtilities/NSData+zlib",
  828. publicHeadersPath: "Public",
  829. cSettings: [
  830. .headerSearchPath("../.."),
  831. ],
  832. linkerSettings: [
  833. .linkedLibrary("z"),
  834. ]
  835. ),
  836. .target(
  837. name: "GoogleUtilities_Reachability",
  838. dependencies: ["GoogleUtilities_Logger"],
  839. path: "GoogleUtilities/Reachability",
  840. publicHeadersPath: "Public",
  841. cSettings: [
  842. .headerSearchPath("../../"),
  843. ]
  844. ),
  845. .target(
  846. name: "GoogleUtilities_UserDefaults",
  847. dependencies: ["GoogleUtilities_Logger"],
  848. path: "GoogleUtilities/UserDefaults",
  849. publicHeadersPath: "Public",
  850. cSettings: [
  851. .headerSearchPath("../../"),
  852. ]
  853. ),
  854. // TODO: - need to port Network/third_party/GTMHTTPServer.m to ARC.
  855. // .testTarget(
  856. // name: "UtilitiesUnit",
  857. // dependencies: [
  858. // "OCMock",
  859. // "GoogleUtilities_AppDelegateSwizzler",
  860. // "GoogleUtilities_Environment",
  861. // "GoogleUtilities_ISASwizzler", // Build needs to disable ARC.
  862. // "GoogleUtilities_Logger",
  863. // "GoogleUtilities_MethodSwizzler",
  864. // "GoogleUtilities_Network",
  865. // "GoogleUtilities_NSData",
  866. // "GoogleUtilities_Reachability",
  867. // "GoogleUtilities_UserDefaults",
  868. // ],
  869. // path: "GoogleUtilities/Tests/Unit",
  870. // exclude: [
  871. // "Network/third_party/LICENSE",
  872. // "Network/third_party/GTMHTTPServer.m", // Requires disabling ARC
  873. // ],
  874. // cSettings: [
  875. // .headerSearchPath("../../.."),
  876. // ]
  877. // ),
  878. ],
  879. cLanguageStandard: .c99,
  880. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  881. )