Package.swift 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  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 = "6.34.0"
  22. let package = Package(
  23. name: "Firebase",
  24. platforms: [.iOS(.v10), .macOS(.v10_12), .tvOS(.v10)],
  25. products: [
  26. .library(
  27. name: "FirebaseAnalytics",
  28. targets: ["FirebaseAnalyticsWrapper"]
  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: ["FirebaseDatabase"]
  41. ),
  42. .library(
  43. name: "FirebaseDynamicLinks",
  44. targets: ["FirebaseDynamicLinks"]
  45. ),
  46. .library(
  47. name: "FirebaseFirestore",
  48. targets: ["FirebaseFirestore"]
  49. ),
  50. .library(
  51. name: "FirebaseFirestoreSwift",
  52. targets: ["FirebaseFirestoreSwift"]
  53. ),
  54. .library(
  55. name: "FirebaseFunctions",
  56. targets: ["FirebaseFunctions"]
  57. ),
  58. .library(
  59. name: "FirebaseInAppMessaging-Beta",
  60. targets: ["FirebaseInAppMessaging"]
  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: ["FirebaseRemoteConfig"]
  73. ),
  74. .library(
  75. name: "FirebaseStorage",
  76. targets: ["FirebaseStorage"]
  77. ),
  78. .library(
  79. name: "FirebaseStorageSwift",
  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/nanopb/nanopb.git",
  98. // This revision adds SPM enablement to the 0.3.9.6 release tag.
  99. .revision("8119dfe5631f2616d11e50ead95448d12e816062")
  100. ),
  101. .package(
  102. name: "abseil",
  103. url: "https://github.com/firebase/abseil-cpp.git",
  104. .revision("8ddf129163673642a339d7980327bcb2c117a28e")
  105. ),
  106. .package(
  107. name: "gRPC",
  108. url: "https://github.com/firebase/grpc.git",
  109. .revision("b22bc5256665ff2f1763505631df0ee60378b083")
  110. ),
  111. .package(
  112. name: "OCMock",
  113. url: "https://github.com/firebase/ocmock.git",
  114. .revision("7291762d3551c5c7e31c49cce40a0e391a52e889")
  115. ),
  116. .package(
  117. name: "leveldb",
  118. url: "https://github.com/firebase/leveldb.git",
  119. .revision("fa1f25f296a766e5a789c4dacd4798dea798b2c2")
  120. ),
  121. // Branches need a force update with a run with the revision set like below.
  122. // .package(url: "https://github.com/paulb777/nanopb.git", .revision("564392bd87bd093c308a3aaed3997466efb95f74"))
  123. ],
  124. targets: [
  125. .target(
  126. name: "Firebase",
  127. path: "CoreOnly/Sources",
  128. publicHeadersPath: "./"
  129. ),
  130. .target(
  131. name: "FirebaseCore",
  132. dependencies: [
  133. "Firebase",
  134. "FirebaseCoreDiagnostics",
  135. "GoogleUtilities_Environment",
  136. "GoogleUtilities_Logger",
  137. ],
  138. path: "FirebaseCore/Sources",
  139. publicHeadersPath: "Public",
  140. cSettings: [
  141. .headerSearchPath("../.."),
  142. .define("FIRCore_VERSION", to: firebaseVersion),
  143. .define("Firebase_VERSION", to: firebaseVersion),
  144. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  145. ],
  146. linkerSettings: [
  147. .linkedFramework("UIKit", .when(platforms: .some([.iOS, .tvOS]))),
  148. .linkedFramework("AppKit", .when(platforms: .some([.macOS]))),
  149. ]
  150. ),
  151. .testTarget(
  152. name: "CoreUnit",
  153. dependencies: ["FirebaseCore", "SharedTestUtilities", "OCMock"],
  154. path: "FirebaseCore/Tests/Unit",
  155. exclude: ["Resources/GoogleService-Info.plist"],
  156. cSettings: [
  157. .headerSearchPath("../../.."),
  158. ]
  159. ),
  160. .target(
  161. name: "FirebaseCoreDiagnostics",
  162. dependencies: [
  163. "GoogleDataTransport",
  164. "GoogleUtilities_Environment",
  165. "GoogleUtilities_Logger",
  166. .product(name: "nanopb", package: "nanopb"),
  167. ],
  168. path: "Firebase/CoreDiagnostics/FIRCDLibrary",
  169. publicHeadersPath: ".",
  170. cSettings: [
  171. .headerSearchPath("../../.."),
  172. .define("PB_FIELD_32BIT", to: "1"),
  173. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  174. .define("PB_ENABLE_MALLOC", to: "1"),
  175. ]
  176. ),
  177. .target(
  178. name: "FirebaseABTesting",
  179. dependencies: ["FirebaseCore"],
  180. path: "FirebaseABTesting/Sources",
  181. publicHeadersPath: "Public",
  182. cSettings: [
  183. .headerSearchPath("../../"),
  184. .define("FIRABTesting_VERSION", to: firebaseVersion),
  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: "FirebaseAnalyticsWrapper",
  198. dependencies: [
  199. .target(name: "FirebaseAnalytics", condition: .when(platforms: .some([.iOS]))),
  200. .target(name: "FIRAnalyticsConnector", condition: .when(platforms: .some([.iOS]))),
  201. .target(name: "GoogleAppMeasurement", condition: .when(platforms: .some([.iOS]))),
  202. "FirebaseCore",
  203. "FirebaseInstallations",
  204. "GoogleUtilities_AppDelegateSwizzler",
  205. "GoogleUtilities_MethodSwizzler",
  206. "GoogleUtilities_NSData",
  207. "GoogleUtilities_Network",
  208. .product(name: "nanopb", package: "nanopb"),
  209. ],
  210. path: "FirebaseAnalyticsWrapper",
  211. linkerSettings: [
  212. .linkedLibrary("sqlite3"),
  213. .linkedLibrary("c++"),
  214. .linkedLibrary("z"),
  215. .linkedFramework("StoreKit"),
  216. ]
  217. ),
  218. .binaryTarget(
  219. name: "FirebaseAnalytics",
  220. url: "https://dl.google.com/firebase/ios/swiftpm/6.34.0/FirebaseAnalytics.zip",
  221. checksum: "48aee46798b06ab4dbe6241541ba21ebdfe449e343c34a07845a67b6b328c4e2"
  222. ),
  223. .binaryTarget(
  224. name: "FIRAnalyticsConnector",
  225. url: "https://dl.google.com/firebase/ios/swiftpm/6.34.0/FIRAnalyticsConnector.zip",
  226. checksum: "b3818c2cac2f2f780eacf33ace7bd1632b477060670a21ca3d1b423991c08ca1"
  227. ),
  228. .binaryTarget(
  229. name: "GoogleAppMeasurement",
  230. url: "https://dl.google.com/firebase/ios/swiftpm/6.34.0/GoogleAppMeasurement.zip",
  231. checksum: "05f6d2da2aa072781826be135498c6e1730ed43519c2232e01c5f043f5fe7189"
  232. ),
  233. .target(
  234. name: "FirebaseAuth",
  235. dependencies: ["FirebaseCore",
  236. "GoogleUtilities_Environment",
  237. "GoogleUtilities_AppDelegateSwizzler",
  238. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher")],
  239. path: "FirebaseAuth/Sources",
  240. publicHeadersPath: "Public",
  241. cSettings: [
  242. .headerSearchPath("../../"),
  243. .define("FIRAuth_VERSION", to: firebaseVersion),
  244. .define("FIRAuth_MINOR_VERSION", to: "1.1"), // TODO: Fix version
  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("PB_FIELD_32BIT", to: "1"),
  297. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  298. .define("PB_ENABLE_MALLOC", to: "1"),
  299. ],
  300. linkerSettings: [
  301. .linkedFramework("Security"),
  302. .linkedFramework("SystemConfiguration"),
  303. ]
  304. ),
  305. .target(
  306. name: "FirebaseDatabase",
  307. dependencies: [
  308. "FirebaseCore",
  309. "leveldb",
  310. ],
  311. path: "FirebaseDatabase/Sources",
  312. exclude: [
  313. "third_party/Wrap-leveldb/LICENSE",
  314. "third_party/SocketRocket/LICENSE",
  315. "third_party/FImmutableSortedDictionary/LICENSE",
  316. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  317. ],
  318. publicHeadersPath: "Public",
  319. cSettings: [
  320. .headerSearchPath("../../"),
  321. .define("FIRDatabase_VERSION", to: firebaseVersion),
  322. ],
  323. linkerSettings: [
  324. .linkedFramework("CFNetwork"),
  325. .linkedFramework("Security"),
  326. .linkedFramework("SystemConfiguration"),
  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: "FirebaseDynamicLinks",
  343. dependencies: ["FirebaseCore"],
  344. path: "FirebaseDynamicLinks/Sources",
  345. publicHeadersPath: "Public",
  346. cSettings: [
  347. .headerSearchPath("../../"),
  348. .define("FIRDynamicLinks3P", to: "1"),
  349. .define("GIN_SCION_LOGGING", to: "1"),
  350. .define("FIRDynamicLinks_VERSION", to: firebaseVersion),
  351. ],
  352. linkerSettings: [
  353. .linkedFramework("QuartzCore"),
  354. ]
  355. ),
  356. .target(
  357. name: "FirebaseFirestore",
  358. dependencies: [
  359. "FirebaseCore",
  360. "leveldb",
  361. .product(name: "nanopb", package: "nanopb"),
  362. .product(name: "abseil", package: "abseil"),
  363. .product(name: "gRPC-cpp", package: "gRPC"),
  364. ],
  365. path: "Firestore",
  366. exclude: [
  367. "CHANGELOG.md",
  368. "CMakeLists.txt",
  369. "Example/",
  370. "Protos/CMakeLists.txt",
  371. "Protos/Podfile",
  372. "Protos/README.md",
  373. "Protos/build_protos.py",
  374. "Protos/cpp/",
  375. "Protos/lib/",
  376. "Protos/nanopb_cpp_generator.py",
  377. "Protos/protos/",
  378. "README.md",
  379. "Source/CMakeLists.txt",
  380. "Swift/",
  381. "core/CMakeLists.txt",
  382. "core/src/util/config_detected.h.in",
  383. "core/test/",
  384. "fuzzing/",
  385. "test.sh",
  386. "third_party/",
  387. // Exclude alternate implementations for other platforms
  388. "core/src/api/input_validation_std.cc",
  389. "core/src/remote/connectivity_monitor_noop.cc",
  390. "core/src/util/filesystem_win.cc",
  391. "core/src/util/hard_assert_stdio.cc",
  392. "core/src/util/log_stdio.cc",
  393. "core/src/util/secure_random_openssl.cc",
  394. ],
  395. sources: [
  396. "Source/",
  397. "Protos/nanopb/",
  398. "core/include/",
  399. "core/src",
  400. ],
  401. publicHeadersPath: "Source/Public",
  402. cSettings: [
  403. .headerSearchPath("../"),
  404. .headerSearchPath("Source/Public/FirebaseFirestore"),
  405. .headerSearchPath("Protos/nanopb"),
  406. .define("PB_FIELD_32BIT", to: "1"),
  407. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  408. .define("PB_ENABLE_MALLOC", to: "1"),
  409. .define("FIRFirestore_VERSION", to: firebaseVersion),
  410. ],
  411. linkerSettings: [
  412. .linkedFramework("SystemConfiguration"),
  413. .linkedFramework("MobileCoreServices", .when(platforms: .some([.iOS]))),
  414. .linkedFramework("UIKit", .when(platforms: .some([.iOS, .tvOS]))),
  415. .linkedLibrary("c++"),
  416. ]
  417. ),
  418. .target(
  419. name: "FirebaseFirestoreSwift",
  420. dependencies: ["FirebaseFirestore"],
  421. path: "Firestore",
  422. exclude: [
  423. "CHANGELOG.md",
  424. "CMakeLists.txt",
  425. "Example/",
  426. "Protos/",
  427. "README.md",
  428. "Source/",
  429. "core/",
  430. "fuzzing/",
  431. "test.sh",
  432. "Swift/CHANGELOG.md",
  433. "Swift/README.md",
  434. "Swift/Tests/",
  435. "third_party/FirestoreEncoder/LICENSE",
  436. "third_party/FirestoreEncoder/METADATA",
  437. ],
  438. sources: [
  439. "Swift/Source/",
  440. "third_party/FirestoreEncoder/",
  441. ]
  442. ),
  443. .target(
  444. name: "FirebaseFunctions",
  445. dependencies: [
  446. "FirebaseCore",
  447. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  448. ],
  449. path: "Functions/FirebaseFunctions",
  450. publicHeadersPath: "Public",
  451. cSettings: [
  452. .headerSearchPath("../../"),
  453. .define("FIRFunctions_VERSION", to: firebaseVersion),
  454. ]
  455. ),
  456. .target(
  457. name: "FirebaseInAppMessaging",
  458. dependencies: [
  459. "FirebaseCore",
  460. "FirebaseInstallations",
  461. "FirebaseABTesting",
  462. "GoogleUtilities_Environment",
  463. .product(name: "nanopb", package: "nanopb"),
  464. ],
  465. path: "FirebaseInAppMessaging/Sources",
  466. exclude: [
  467. "DefaultUI/CHANGELOG.md",
  468. "DefaultUI/README.md",
  469. ],
  470. resources: [.process("Resources")],
  471. publicHeadersPath: "Public",
  472. cSettings: [
  473. .headerSearchPath("../../"),
  474. .define("FIRInAppMessaging_LIB_VERSION", to: firebaseVersion),
  475. .define("PB_FIELD_32BIT", to: "1"),
  476. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  477. .define("PB_ENABLE_MALLOC", to: "1"),
  478. ]
  479. ),
  480. .target(
  481. name: "FirebaseInstanceID",
  482. dependencies: ["FirebaseCore", "FirebaseInstallations",
  483. "GoogleUtilities_Environment", "GoogleUtilities_UserDefaults"],
  484. path: "Firebase/InstanceID",
  485. exclude: [
  486. "CHANGELOG.md",
  487. ],
  488. publicHeadersPath: "Public",
  489. cSettings: [
  490. .headerSearchPath("../../"),
  491. .define("FIRInstanceID_LIB_VERSION", to: firebaseVersion),
  492. ]
  493. ),
  494. .target(
  495. name: "FirebaseInstallations",
  496. dependencies: ["FirebaseCore", .product(name: "FBLPromises", package: "Promises"),
  497. "GoogleUtilities_Environment", "GoogleUtilities_UserDefaults"],
  498. path: "FirebaseInstallations/Source/Library",
  499. publicHeadersPath: "Public",
  500. cSettings: [
  501. .headerSearchPath("../../../"),
  502. ],
  503. linkerSettings: [
  504. .linkedFramework("Security"),
  505. ]
  506. ),
  507. .target(
  508. name: "FirebaseMessaging",
  509. dependencies: [
  510. "FirebaseCore",
  511. "FirebaseInstanceID",
  512. "GoogleUtilities_AppDelegateSwizzler",
  513. "GoogleUtilities_Environment",
  514. "GoogleUtilities_Reachability",
  515. "GoogleUtilities_UserDefaults",
  516. ],
  517. path: "FirebaseMessaging/Sources",
  518. publicHeadersPath: "Public",
  519. cSettings: [
  520. .headerSearchPath("../../"),
  521. .define("FIRMessaging_LIB_VERSION", to: firebaseVersion),
  522. ],
  523. linkerSettings: [
  524. .linkedFramework("SystemConfiguration"),
  525. ]
  526. ),
  527. .testTarget(
  528. name: "MessagingUnit",
  529. dependencies: ["FirebaseMessaging", "OCMock"],
  530. path: "FirebaseMessaging/Tests/UnitTests",
  531. exclude: [
  532. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  533. ],
  534. cSettings: [
  535. .headerSearchPath("../../.."),
  536. ]
  537. ),
  538. .target(
  539. name: "SharedTestUtilities",
  540. dependencies: ["FirebaseCore", "OCMock"],
  541. path: "SharedTestUtilities",
  542. publicHeadersPath: "./",
  543. cSettings: [
  544. .headerSearchPath("../"),
  545. ]
  546. ),
  547. .target(
  548. name: "FirebaseRemoteConfig",
  549. dependencies: [
  550. "FirebaseCore",
  551. "FirebaseABTesting",
  552. "FirebaseInstallations",
  553. "GoogleUtilities_NSData",
  554. ],
  555. path: "FirebaseRemoteConfig/Sources",
  556. publicHeadersPath: "Public",
  557. cSettings: [
  558. .headerSearchPath("../../"),
  559. .define("FIRRemoteConfig_VERSION", to: firebaseVersion),
  560. ]
  561. ),
  562. .testTarget(
  563. name: "RemoteConfigUnit",
  564. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  565. path: "FirebaseRemoteConfig/Tests/Unit",
  566. exclude: [
  567. // Need to be evaluated/ported to RC V2.
  568. "RCNConfigAnalyticsTest.m",
  569. "RCNConfigSettingsTest.m",
  570. "RCNConfigTest.m",
  571. "RCNRemoteConfig+FIRAppTest.m",
  572. "RCNThrottlingTests.m",
  573. ],
  574. resources: [
  575. .process("SecondApp-GoogleService-Info.plist"),
  576. .process("Defaults-testInfo.plist"),
  577. .process("TestABTPayload.txt"),
  578. ],
  579. cSettings: [
  580. .headerSearchPath("../../.."),
  581. ]
  582. ),
  583. .target(
  584. name: "FirebaseStorage",
  585. dependencies: [
  586. "FirebaseCore",
  587. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  588. ],
  589. path: "FirebaseStorage/Sources",
  590. publicHeadersPath: "Public",
  591. cSettings: [
  592. .headerSearchPath("../../"),
  593. .define("FIRStorage_VERSION", to: firebaseVersion),
  594. ],
  595. linkerSettings: [
  596. .linkedFramework("MobileCoreServices", .when(platforms: .some([.iOS]))),
  597. .linkedFramework("CoreServices", .when(platforms: .some([.macOS]))),
  598. ]
  599. ),
  600. .testTarget(
  601. name: "StorageUnit",
  602. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  603. path: "FirebaseStorage/Tests/Unit",
  604. cSettings: [
  605. .headerSearchPath("../../.."),
  606. ]
  607. ),
  608. .target(
  609. name: "FirebaseStorageSwift",
  610. dependencies: ["FirebaseStorage"],
  611. path: "FirebaseStorageSwift/Sources"
  612. ),
  613. .target(
  614. name: "GoogleDataTransport",
  615. dependencies: [
  616. .product(name: "nanopb", package: "nanopb"),
  617. ],
  618. path: "GoogleDataTransport",
  619. exclude: [
  620. "CHANGELOG.md",
  621. "README.md",
  622. "generate_project.sh",
  623. "GDTCCTWatchOSTestApp/",
  624. "GDTWatchOSTestApp/",
  625. "GDTCCTTestApp/",
  626. "GDTTestApp/",
  627. "GDTCCTTests/",
  628. "GDTCORTests/",
  629. "ProtoSupport/",
  630. ],
  631. sources: [
  632. "GDTCORLibrary",
  633. "GDTCCTLibrary",
  634. ],
  635. publicHeadersPath: "GDTCORLibrary/Public",
  636. cSettings: [
  637. .headerSearchPath("../"),
  638. .define("GDTCOR_VERSION", to: "0.0.1"),
  639. .define("PB_FIELD_32BIT", to: "1"),
  640. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  641. .define("PB_ENABLE_MALLOC", to: "1"),
  642. ],
  643. linkerSettings: [
  644. .linkedFramework("SystemConfiguration"),
  645. .linkedFramework("CoreTelephony", .when(platforms: .some([.macOS, .iOS]))),
  646. ]
  647. ),
  648. .testTarget(
  649. name: "swift-test",
  650. dependencies: [
  651. "FirebaseAuth",
  652. "FirebaseABTesting",
  653. "Firebase",
  654. "FirebaseCrashlytics",
  655. "FirebaseCore",
  656. "FirebaseDatabase",
  657. "FirebaseDynamicLinks",
  658. "FirebaseFirestore",
  659. "FirebaseFirestoreSwift",
  660. "FirebaseFunctions",
  661. "FirebaseInAppMessaging",
  662. "FirebaseInstallations",
  663. "FirebaseMessaging",
  664. "FirebaseRemoteConfig",
  665. "FirebaseStorage",
  666. "FirebaseStorageSwift",
  667. "GoogleDataTransport",
  668. "GoogleUtilities_AppDelegateSwizzler",
  669. "GoogleUtilities_Environment",
  670. // "GoogleUtilities_ISASwizzler", // Build needs to disable ARC.
  671. "GoogleUtilities_Logger",
  672. "GoogleUtilities_MethodSwizzler",
  673. "GoogleUtilities_Network",
  674. "GoogleUtilities_NSData",
  675. "GoogleUtilities_Reachability",
  676. "GoogleUtilities_UserDefaults",
  677. .product(name: "nanopb", package: "nanopb"),
  678. ],
  679. path: "SwiftPMTests/swift-test"
  680. ),
  681. .testTarget(
  682. name: "analytics-import-test",
  683. dependencies: [
  684. "FirebaseAnalyticsWrapper",
  685. "Firebase",
  686. ],
  687. path: "SwiftPMTests/analytics-import-test"
  688. ),
  689. .testTarget(
  690. name: "objc-import-test",
  691. dependencies: [
  692. "FirebaseAuth",
  693. "FirebaseABTesting",
  694. "Firebase",
  695. "FirebaseCrashlytics",
  696. "FirebaseCore",
  697. "FirebaseDatabase",
  698. "FirebaseDynamicLinks",
  699. "FirebaseFirestore",
  700. "FirebaseFunctions",
  701. "FirebaseInAppMessaging",
  702. "FirebaseInstallations",
  703. "FirebaseMessaging",
  704. "FirebaseRemoteConfig",
  705. "FirebaseStorage",
  706. ],
  707. path: "SwiftPMTests/objc-import-test"
  708. ),
  709. .testTarget(
  710. name: "version-test",
  711. dependencies: [
  712. "FirebaseCore",
  713. ],
  714. path: "SwiftPMTests/version-test",
  715. cSettings: [
  716. .define("FIR_VERSION", to: firebaseVersion),
  717. ]
  718. ),
  719. .target(
  720. name: "GoogleUtilities_AppDelegateSwizzler",
  721. dependencies: ["GoogleUtilities_Environment", "GoogleUtilities_Logger",
  722. "GoogleUtilities_Network"],
  723. path: "GoogleUtilities",
  724. exclude: [
  725. "CHANGELOG.md",
  726. "CMakeLists.txt",
  727. "LICENSE",
  728. "README.md",
  729. "AppDelegateSwizzler/README.md",
  730. "Environment/",
  731. "Network/",
  732. "ISASwizzler/",
  733. "Logger/",
  734. "MethodSwizzler/",
  735. "NSData+zlib/",
  736. "Reachability",
  737. "SwizzlerTestHelpers/",
  738. "Tests",
  739. "UserDefaults/",
  740. ],
  741. sources: [
  742. "AppDelegateSwizzler/",
  743. "SceneDelegateSwizzler/",
  744. "Common/*.h",
  745. ],
  746. publicHeadersPath: "AppDelegateSwizzler/Public",
  747. cSettings: [
  748. .headerSearchPath("../"),
  749. ]
  750. ),
  751. .target(
  752. name: "GoogleUtilities_Environment",
  753. dependencies: [.product(name: "FBLPromises", package: "Promises")],
  754. path: "GoogleUtilities/Environment",
  755. exclude: ["third_party/LICENSE"],
  756. publicHeadersPath: "Public",
  757. cSettings: [
  758. .headerSearchPath("../../"),
  759. ]
  760. ),
  761. .target(
  762. name: "GoogleUtilities_Logger",
  763. dependencies: ["GoogleUtilities_Environment"],
  764. path: "GoogleUtilities/Logger",
  765. publicHeadersPath: "Public",
  766. cSettings: [
  767. .headerSearchPath("../../"),
  768. ]
  769. ),
  770. // TODO: ISA_Swizzler requires building without ARC.
  771. .target(
  772. name: "GoogleUtilities_MethodSwizzler",
  773. dependencies: ["GoogleUtilities_Logger"],
  774. path: "GoogleUtilities/MethodSwizzler",
  775. publicHeadersPath: "Public",
  776. cSettings: [
  777. .headerSearchPath("../../"),
  778. ]
  779. ),
  780. .target(
  781. name: "GoogleUtilities_Network",
  782. dependencies: ["GoogleUtilities_Logger", "GoogleUtilities_NSData",
  783. "GoogleUtilities_Reachability"],
  784. path: "GoogleUtilities/Network",
  785. publicHeadersPath: "Public",
  786. cSettings: [
  787. .headerSearchPath("../.."),
  788. ]
  789. ),
  790. .target(
  791. name: "GoogleUtilities_NSData",
  792. path: "GoogleUtilities/NSData+zlib",
  793. publicHeadersPath: "Public",
  794. cSettings: [
  795. .headerSearchPath("../.."),
  796. ],
  797. linkerSettings: [
  798. .linkedLibrary("z"),
  799. ]
  800. ),
  801. .target(
  802. name: "GoogleUtilities_Reachability",
  803. dependencies: ["GoogleUtilities_Logger"],
  804. path: "GoogleUtilities/Reachability",
  805. publicHeadersPath: "Public",
  806. cSettings: [
  807. .headerSearchPath("../../"),
  808. ]
  809. ),
  810. .target(
  811. name: "GoogleUtilities_UserDefaults",
  812. dependencies: ["GoogleUtilities_Logger"],
  813. path: "GoogleUtilities/UserDefaults",
  814. publicHeadersPath: "Public",
  815. cSettings: [
  816. .headerSearchPath("../../"),
  817. ]
  818. ),
  819. // TODO: - need to port Network/third_party/GTMHTTPServer.m to ARC.
  820. // .testTarget(
  821. // name: "UtilitiesUnit",
  822. // dependencies: [
  823. // "OCMock",
  824. // "GoogleUtilities_AppDelegateSwizzler",
  825. // "GoogleUtilities_Environment",
  826. // "GoogleUtilities_ISASwizzler", // Build needs to disable ARC.
  827. // "GoogleUtilities_Logger",
  828. // "GoogleUtilities_MethodSwizzler",
  829. // "GoogleUtilities_Network",
  830. // "GoogleUtilities_NSData",
  831. // "GoogleUtilities_Reachability",
  832. // "GoogleUtilities_UserDefaults",
  833. // ],
  834. // path: "GoogleUtilities/Tests/Unit",
  835. // exclude: [
  836. // "Network/third_party/LICENSE",
  837. // "Network/third_party/GTMHTTPServer.m", // Requires disabling ARC
  838. // ],
  839. // cSettings: [
  840. // .headerSearchPath("../../.."),
  841. // ]
  842. // ),
  843. ],
  844. cLanguageStandard: .c99,
  845. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  846. )