Package.swift 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  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.33.0"
  22. let package = Package(
  23. name: "Firebase",
  24. platforms: [.iOS(.v9), .macOS(.v10_11), .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: "FirebaseInstanceID",
  68. // targets: ["FirebaseInstanceID"]
  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", "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.33.0/FirebaseAnalytics.zip",
  221. checksum: "d3f88b6144311d2c7c1e9663b8357511db12fed794d091ea751fdcabdffab21f"
  222. ),
  223. .binaryTarget(
  224. name: "FIRAnalyticsConnector",
  225. url: "https://dl.google.com/firebase/ios/swiftpm/6.33.0/FIRAnalyticsConnector.zip",
  226. checksum: "56c9a3f43fe77bb8f523ac1ed0ead6068ed74e6f5545948f9c2924a0351cdf50"
  227. ),
  228. .binaryTarget(
  229. name: "GoogleAppMeasurement",
  230. url: "https://dl.google.com/firebase/ios/swiftpm/6.33.0/GoogleAppMeasurement.zip",
  231. checksum: "fc01f32a3bd2d624bd1532245f3661bc0cf2d577c300b52ef8ed981b5bde7478"
  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. // publicHeadersPath: "Public",
  486. // cSettings: [
  487. // .headerSearchPath("../../"),
  488. // .define("FIRInstanceID_LIB_VERSION", to: firebaseVersion),
  489. // ]
  490. // ),
  491. .target(
  492. name: "FirebaseInstallations",
  493. dependencies: ["FirebaseCore", .product(name: "FBLPromises", package: "Promises"),
  494. "GoogleUtilities_Environment", "GoogleUtilities_UserDefaults"],
  495. path: "FirebaseInstallations/Source/Library",
  496. publicHeadersPath: "Public",
  497. cSettings: [
  498. .headerSearchPath("../../../"),
  499. ],
  500. linkerSettings: [
  501. .linkedFramework("Security"),
  502. ]
  503. ),
  504. .target(
  505. name: "SharedTestUtilities",
  506. dependencies: ["FirebaseCore"],
  507. path: "SharedTestUtilities",
  508. publicHeadersPath: "./",
  509. cSettings: [
  510. .headerSearchPath("../"),
  511. ]
  512. ),
  513. .target(
  514. name: "FirebaseRemoteConfig",
  515. dependencies: [
  516. "FirebaseCore",
  517. "FirebaseABTesting",
  518. "FirebaseInstallations",
  519. "GoogleUtilities_NSData",
  520. ],
  521. path: "FirebaseRemoteConfig/Sources",
  522. publicHeadersPath: "Public",
  523. cSettings: [
  524. .headerSearchPath("../../"),
  525. .define("FIRRemoteConfig_VERSION", to: firebaseVersion),
  526. ]
  527. ),
  528. .testTarget(
  529. name: "RemoteConfigUnit",
  530. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  531. path: "FirebaseRemoteConfig/Tests/Unit",
  532. exclude: [
  533. // Need to be evaluated/ported to RC V2.
  534. "RCNConfigAnalyticsTest.m",
  535. "RCNConfigSettingsTest.m",
  536. "RCNConfigTest.m",
  537. "RCNRemoteConfig+FIRAppTest.m",
  538. "RCNThrottlingTests.m",
  539. ],
  540. resources: [
  541. .process("SecondApp-GoogleService-Info.plist"),
  542. .process("Defaults-testInfo.plist"),
  543. .process("TestABTPayload.txt"),
  544. ],
  545. cSettings: [
  546. .headerSearchPath("../../.."),
  547. ]
  548. ),
  549. .target(
  550. name: "FirebaseStorage",
  551. dependencies: [
  552. "FirebaseCore",
  553. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  554. ],
  555. path: "FirebaseStorage/Sources",
  556. publicHeadersPath: "Public",
  557. cSettings: [
  558. .headerSearchPath("../../"),
  559. .define("FIRStorage_VERSION", to: firebaseVersion),
  560. ],
  561. linkerSettings: [
  562. .linkedFramework("MobileCoreServices", .when(platforms: .some([.iOS]))),
  563. .linkedFramework("CoreServices", .when(platforms: .some([.macOS]))),
  564. ]
  565. ),
  566. .testTarget(
  567. name: "StorageUnit",
  568. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  569. path: "FirebaseStorage/Tests/Unit",
  570. cSettings: [
  571. .headerSearchPath("../../.."),
  572. ]
  573. ),
  574. .target(
  575. name: "FirebaseStorageSwift",
  576. dependencies: ["FirebaseStorage"],
  577. path: "FirebaseStorageSwift/Sources"
  578. ),
  579. .target(
  580. name: "GoogleDataTransport",
  581. dependencies: [
  582. .product(name: "nanopb", package: "nanopb"),
  583. ],
  584. path: "GoogleDataTransport",
  585. exclude: [
  586. "CHANGELOG.md",
  587. "README.md",
  588. "generate_project.sh",
  589. "GDTCCTWatchOSTestApp/",
  590. "GDTWatchOSTestApp/",
  591. "GDTCCTTestApp/",
  592. "GDTTestApp/",
  593. "GDTCCTTests/",
  594. "GDTCORTests/",
  595. "ProtoSupport/",
  596. ],
  597. sources: [
  598. "GDTCORLibrary",
  599. "GDTCCTLibrary",
  600. ],
  601. publicHeadersPath: "GDTCORLibrary/Public",
  602. cSettings: [
  603. .headerSearchPath("../"),
  604. .define("GDTCOR_VERSION", to: "0.0.1"),
  605. .define("PB_FIELD_32BIT", to: "1"),
  606. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  607. .define("PB_ENABLE_MALLOC", to: "1"),
  608. ],
  609. linkerSettings: [
  610. .linkedFramework("SystemConfiguration"),
  611. .linkedFramework("CoreTelephony", .when(platforms: .some([.macOS, .iOS]))),
  612. ]
  613. ),
  614. .testTarget(
  615. name: "swift-test",
  616. dependencies: [
  617. "FirebaseAuth",
  618. "FirebaseABTesting",
  619. "Firebase",
  620. "FirebaseCrashlytics",
  621. "FirebaseCore",
  622. "FirebaseDatabase",
  623. "FirebaseDynamicLinks",
  624. "FirebaseFirestore",
  625. "FirebaseFirestoreSwift",
  626. "FirebaseFunctions",
  627. "FirebaseInAppMessaging",
  628. "FirebaseInstallations",
  629. // "FirebaseInstanceID",
  630. "FirebaseRemoteConfig",
  631. "FirebaseStorage",
  632. "FirebaseStorageSwift",
  633. "GoogleDataTransport",
  634. "GoogleUtilities_AppDelegateSwizzler",
  635. "GoogleUtilities_Environment",
  636. // "GoogleUtilities_ISASwizzler", // Build needs to disable ARC.
  637. "GoogleUtilities_Logger",
  638. "GoogleUtilities_MethodSwizzler",
  639. "GoogleUtilities_Network",
  640. "GoogleUtilities_NSData",
  641. "GoogleUtilities_Reachability",
  642. "GoogleUtilities_UserDefaults",
  643. .product(name: "nanopb", package: "nanopb"),
  644. ],
  645. path: "SwiftPMTests/swift-test"
  646. ),
  647. .testTarget(
  648. name: "analytics-import-test",
  649. dependencies: [
  650. "FirebaseAnalyticsWrapper",
  651. "Firebase",
  652. ],
  653. path: "SwiftPMTests/analytics-import-test"
  654. ),
  655. .testTarget(
  656. name: "objc-import-test",
  657. dependencies: [
  658. "FirebaseAuth",
  659. "FirebaseABTesting",
  660. "Firebase",
  661. "FirebaseCrashlytics",
  662. "FirebaseCore",
  663. "FirebaseDatabase",
  664. "FirebaseDynamicLinks",
  665. "FirebaseFirestore",
  666. "FirebaseFunctions",
  667. "FirebaseInAppMessaging",
  668. "FirebaseInstallations",
  669. "FirebaseRemoteConfig",
  670. "FirebaseStorage",
  671. ],
  672. path: "SwiftPMTests/objc-import-test"
  673. ),
  674. .testTarget(
  675. name: "version-test",
  676. dependencies: [
  677. "FirebaseCore",
  678. ],
  679. path: "SwiftPMTests/version-test",
  680. cSettings: [
  681. .define("FIR_VERSION", to: firebaseVersion),
  682. ]
  683. ),
  684. .target(
  685. name: "GoogleUtilities_AppDelegateSwizzler",
  686. dependencies: ["GoogleUtilities_Environment", "GoogleUtilities_Logger",
  687. "GoogleUtilities_Network"],
  688. path: "GoogleUtilities",
  689. exclude: [
  690. "CHANGELOG.md",
  691. "CMakeLists.txt",
  692. "LICENSE",
  693. "README.md",
  694. "AppDelegateSwizzler/README.md",
  695. "Environment/",
  696. "Network/",
  697. "ISASwizzler/",
  698. "Logger/",
  699. "MethodSwizzler/",
  700. "NSData+zlib/",
  701. "Reachability",
  702. "SwizzlerTestHelpers/",
  703. "Tests",
  704. "UserDefaults/",
  705. ],
  706. sources: [
  707. "AppDelegateSwizzler/",
  708. "SceneDelegateSwizzler/",
  709. "Common/*.h",
  710. ],
  711. publicHeadersPath: "AppDelegateSwizzler/Public",
  712. cSettings: [
  713. .headerSearchPath("../"),
  714. ]
  715. ),
  716. .target(
  717. name: "GoogleUtilities_Environment",
  718. dependencies: [.product(name: "FBLPromises", package: "Promises")],
  719. path: "GoogleUtilities/Environment",
  720. exclude: ["third_party/LICENSE"],
  721. publicHeadersPath: "Private",
  722. cSettings: [
  723. .headerSearchPath("../../"),
  724. ]
  725. ),
  726. .target(
  727. name: "GoogleUtilities_Logger",
  728. dependencies: ["GoogleUtilities_Environment"],
  729. path: "GoogleUtilities/Logger",
  730. publicHeadersPath: "Public",
  731. cSettings: [
  732. .headerSearchPath("../../"),
  733. ]
  734. ),
  735. // TODO: ISA_Swizzler requires building without ARC.
  736. .target(
  737. name: "GoogleUtilities_MethodSwizzler",
  738. dependencies: ["GoogleUtilities_Logger"],
  739. path: "GoogleUtilities/MethodSwizzler",
  740. publicHeadersPath: "Private",
  741. cSettings: [
  742. .headerSearchPath("../../"),
  743. ]
  744. ),
  745. .target(
  746. name: "GoogleUtilities_Network",
  747. dependencies: ["GoogleUtilities_Logger", "GoogleUtilities_NSData",
  748. "GoogleUtilities_Reachability"],
  749. path: "GoogleUtilities/Network",
  750. publicHeadersPath: "Public",
  751. cSettings: [
  752. .headerSearchPath("../.."),
  753. ]
  754. ),
  755. .target(
  756. name: "GoogleUtilities_NSData",
  757. path: "GoogleUtilities/NSData+zlib",
  758. publicHeadersPath: "Public",
  759. cSettings: [
  760. .headerSearchPath("../.."),
  761. ],
  762. linkerSettings: [
  763. .linkedLibrary("z"),
  764. ]
  765. ),
  766. .target(
  767. name: "GoogleUtilities_Reachability",
  768. dependencies: ["GoogleUtilities_Logger"],
  769. path: "GoogleUtilities/Reachability",
  770. publicHeadersPath: "Private",
  771. cSettings: [
  772. .headerSearchPath("../../"),
  773. ]
  774. ),
  775. .target(
  776. name: "GoogleUtilities_UserDefaults",
  777. dependencies: ["GoogleUtilities_Logger"],
  778. path: "GoogleUtilities/UserDefaults",
  779. publicHeadersPath: "Private",
  780. cSettings: [
  781. .headerSearchPath("../../"),
  782. ]
  783. ),
  784. // TODO: - need to port Network/third_party/GTMHTTPServer.m to ARC.
  785. // .testTarget(
  786. // name: "UtilitiesUnit",
  787. // dependencies: [
  788. // "OCMock",
  789. // "GoogleUtilities_AppDelegateSwizzler",
  790. // "GoogleUtilities_Environment",
  791. // "GoogleUtilities_ISASwizzler", // Build needs to disable ARC.
  792. // "GoogleUtilities_Logger",
  793. // "GoogleUtilities_MethodSwizzler",
  794. // "GoogleUtilities_Network",
  795. // "GoogleUtilities_NSData",
  796. // "GoogleUtilities_Reachability",
  797. // "GoogleUtilities_UserDefaults",
  798. // ],
  799. // path: "GoogleUtilities/Tests/Unit",
  800. // exclude: [
  801. // "Network/third_party/LICENSE",
  802. // "Network/third_party/GTMHTTPServer.m", // Requires disabling ARC
  803. // ],
  804. // cSettings: [
  805. // .headerSearchPath("../../.."),
  806. // ]
  807. // ),
  808. ],
  809. cLanguageStandard: .c99,
  810. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  811. )