Package.swift 25 KB

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