Package.swift 26 KB

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