Package.swift 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  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 package = Package(
  22. name: "Firebase",
  23. platforms: [.iOS(.v9), .macOS(.v10_11), .tvOS(.v10)],
  24. products: [
  25. .library(
  26. name: "Firebase",
  27. targets: ["Firebase"]
  28. ),
  29. .library(
  30. name: "FirebaseCore",
  31. targets: ["FirebaseCore"]
  32. ),
  33. .library(
  34. name: "FirebaseAnalytics",
  35. targets: ["FirebaseAnalyticsWrapper"]
  36. ),
  37. .library(
  38. name: "FirebaseAuth",
  39. targets: ["FirebaseAuth"]
  40. ),
  41. .library(
  42. name: "FirebaseCrashlytics",
  43. targets: ["FirebaseCrashlytics"]
  44. ),
  45. .library(
  46. name: "FirebaseDatabase",
  47. targets: ["FirebaseDatabase"]
  48. ),
  49. .library(
  50. name: "FirebaseDynamicLinks",
  51. targets: ["FirebaseDynamicLinks"]
  52. ),
  53. .library(
  54. name: "FirebaseFirestore",
  55. targets: ["FirebaseFirestore"]
  56. ),
  57. .library(
  58. name: "FirebaseFirestoreSwift",
  59. targets: ["FirebaseFirestoreSwift"]
  60. ),
  61. .library(
  62. name: "FirebaseFunctions",
  63. targets: ["FirebaseFunctions"]
  64. ),
  65. .library(
  66. name: "FirebaseInAppMessaging-Beta",
  67. targets: ["FirebaseInAppMessaging"]
  68. ),
  69. .library(
  70. name: "FirebaseInstallations",
  71. targets: ["FirebaseInstallations"]
  72. ),
  73. // .library(
  74. // name: "FirebaseInstanceID",
  75. // targets: ["FirebaseInstanceID"]
  76. // ),
  77. .library(
  78. name: "FirebaseRemoteConfig",
  79. targets: ["FirebaseRemoteConfig"]
  80. ),
  81. .library(
  82. name: "FirebaseStorage",
  83. targets: ["FirebaseStorage"]
  84. ),
  85. .library(
  86. name: "FirebaseStorageSwift",
  87. targets: ["FirebaseStorageSwift"]
  88. ),
  89. // Not intended for public consumption, but needed for FirebaseUI.
  90. .library(
  91. name: "GoogleUtilities_UserDefaults",
  92. targets: ["GoogleUtilities_UserDefaults"]
  93. ),
  94. ],
  95. dependencies: [
  96. .package(name: "Promises", url: "https://github.com/google/promises.git", "1.2.8" ..< "1.3.0"),
  97. .package(
  98. name: "GTMSessionFetcher",
  99. url: "https://github.com/google/gtm-session-fetcher.git",
  100. "1.4.0" ..< "2.0.0"
  101. ),
  102. .package(
  103. name: "nanopb",
  104. url: "https://github.com/nanopb/nanopb.git",
  105. // This revision adds SPM enablement to the 0.3.9.6 release tag.
  106. .revision("3cfa21200eea012d8765239ad4c50d8a36c283f1")
  107. ),
  108. .package(
  109. name: "abseil",
  110. url: "https://github.com/firebase/abseil-cpp.git",
  111. .revision("d30bd7751ce343a05fca6413de0dec062163e5e9")
  112. ),
  113. .package(
  114. name: "gRPC",
  115. url: "https://github.com/firebase/grpc.git",
  116. .revision("cae939a8823bbc39912aa2990cf95e29ace381b3")
  117. ),
  118. .package(
  119. name: "OCMock",
  120. url: "https://github.com/firebase/ocmock.git",
  121. .revision("7291762d3551c5c7e31c49cce40a0e391a52e889")
  122. ),
  123. .package(
  124. name: "leveldb",
  125. url: "https://github.com/firebase/leveldb.git",
  126. .revision("3f046978ecffd57ea6eb9a0897cc8a3b45b44df8")
  127. ),
  128. // Branches need a force update with a run with the revision set like below.
  129. // .package(url: "https://github.com/paulb777/nanopb.git", .revision("564392bd87bd093c308a3aaed3997466efb95f74"))
  130. ],
  131. targets: [
  132. .target(
  133. name: "Firebase",
  134. path: "CoreOnly/Sources",
  135. publicHeadersPath: "./"
  136. ),
  137. .target(
  138. name: "FirebaseCore",
  139. dependencies: [
  140. "FirebaseCoreDiagnostics",
  141. "GoogleUtilities_Environment",
  142. "GoogleUtilities_Logger",
  143. ],
  144. path: "FirebaseCore/Sources",
  145. publicHeadersPath: "Public",
  146. cSettings: [
  147. .headerSearchPath("../.."),
  148. .define("FIRCore_VERSION", to: "0.0.1"), // TODO: Fix version
  149. .define("Firebase_VERSION", to: "0.0.1"), // TODO: Fix version
  150. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  151. ]
  152. ),
  153. .testTarget(
  154. name: "CoreUnit",
  155. dependencies: ["FirebaseCore", "OCMock"],
  156. path: "FirebaseCore/Tests/Unit",
  157. exclude: ["Resources/GoogleService-Info.plist"],
  158. cSettings: [
  159. .headerSearchPath("../../.."),
  160. ]
  161. ),
  162. .target(
  163. name: "FirebaseCoreDiagnostics",
  164. dependencies: [
  165. "GoogleDataTransport",
  166. "GoogleUtilities_Environment",
  167. "GoogleUtilities_Logger",
  168. .product(name: "nanopb", package: "nanopb"),
  169. ],
  170. path: "Firebase/CoreDiagnostics/FIRCDLibrary",
  171. publicHeadersPath: ".",
  172. cSettings: [
  173. .headerSearchPath("../../.."),
  174. .define("PB_FIELD_32BIT", to: "1"),
  175. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  176. .define("PB_ENABLE_MALLOC", to: "1"),
  177. ]
  178. ),
  179. .target(
  180. name: "FirebaseABTesting",
  181. dependencies: ["FirebaseCore"],
  182. path: "FirebaseABTesting/Sources",
  183. publicHeadersPath: "Public",
  184. cSettings: [
  185. .headerSearchPath("../../"),
  186. .define("FIRABTesting_VERSION", to: "0.0.1"), // TODO: Fix version
  187. ]
  188. ),
  189. .testTarget(
  190. name: "ABTestingUnit",
  191. dependencies: ["FirebaseABTesting", "OCMock"],
  192. path: "FirebaseABTesting/Tests/Unit",
  193. resources: [.process("Resources")],
  194. cSettings: [
  195. .headerSearchPath("../../.."),
  196. ]
  197. ),
  198. .target(
  199. name: "FirebaseAnalyticsWrapper",
  200. dependencies: [
  201. "FirebaseAnalytics",
  202. "FIRAnalyticsConnector",
  203. "GoogleAppMeasurement",
  204. "FirebaseCore",
  205. "FirebaseInstallations",
  206. "GoogleUtilities_AppDelegateSwizzler",
  207. "GoogleUtilities_MethodSwizzler",
  208. "GoogleUtilities_NSData",
  209. "GoogleUtilities_Network",
  210. .product(name: "nanopb", package: "nanopb"),
  211. ],
  212. path: "FirebaseAnalyticsWrapper",
  213. publicHeadersPath: "Public",
  214. linkerSettings: [
  215. .linkedLibrary("sqlite3"),
  216. .linkedLibrary("c++"),
  217. .linkedLibrary("z"),
  218. .linkedFramework("StoreKit"),
  219. ]
  220. ),
  221. .binaryTarget(
  222. name: "FirebaseAnalytics",
  223. url: "https://dl.google.com/firebase/ios/swiftpm/6.31.0/FirebaseAnalytics.zip",
  224. checksum: "533fae2d17c7224bf6f43485bff74e44c5f2fcdf4b56992167a6c5dbc43e5fdb"
  225. ),
  226. .binaryTarget(
  227. name: "FIRAnalyticsConnector",
  228. url: "https://dl.google.com/firebase/ios/swiftpm/6.31.0/FIRAnalyticsConnector.zip",
  229. checksum: "6b194824b7705ede04195364a2c0f2a70bdc6da274fb28ce7aa39853b3796e0d"
  230. ),
  231. .binaryTarget(
  232. name: "GoogleAppMeasurement",
  233. url: "https://dl.google.com/firebase/ios/swiftpm/6.31.0/GoogleAppMeasurement.zip",
  234. checksum: "f71ab5ca97f8763c67ab052ee083f21a0464867369e2223c0973fce38b677075"
  235. ),
  236. .target(
  237. name: "FirebaseAuth",
  238. dependencies: ["FirebaseCore",
  239. "GoogleUtilities_Environment",
  240. "GoogleUtilities_AppDelegateSwizzler",
  241. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher")],
  242. path: "FirebaseAuth/Sources",
  243. publicHeadersPath: "Public",
  244. cSettings: [
  245. .headerSearchPath("../../"),
  246. .define("FIRAuth_VERSION", to: "0.0.1"), // TODO: Fix version
  247. .define("FIRAuth_MINOR_VERSION", to: "1.1"), // TODO: Fix version
  248. ]
  249. ),
  250. .testTarget(
  251. name: "AuthUnit",
  252. dependencies: ["FirebaseAuth", "OCMock"],
  253. path: "FirebaseAuth/Tests/Unit",
  254. exclude: [
  255. "FIRAuthKeychainServicesTests.m", // TODO: figure out SPM keychain testing
  256. "FIRAuthTests.m",
  257. "FIRUserTests.m",
  258. ],
  259. cSettings: [
  260. .headerSearchPath("../../.."),
  261. ]
  262. ),
  263. .target(
  264. name: "FirebaseCrashlytics",
  265. dependencies: ["FirebaseCore", "FirebaseInstallations", "GoogleDataTransport",
  266. .product(name: "FBLPromises", package: "Promises"),
  267. .product(name: "nanopb", package: "nanopb")],
  268. path: "Crashlytics",
  269. exclude: [
  270. "run",
  271. "CHANGELOG.md",
  272. "LICENSE",
  273. "README.md",
  274. "Data/",
  275. "Protos/",
  276. "ProtoSupport/",
  277. "UnitTests/",
  278. "generate_project.sh",
  279. "upload-symbols",
  280. "third_party/libunwind/LICENSE",
  281. ],
  282. sources: [
  283. "Crashlytics/",
  284. "Protogen/",
  285. "Shared/",
  286. "third_party/libunwind/dwarf.h",
  287. ],
  288. publicHeadersPath: "Crashlytics/Public",
  289. cSettings: [
  290. .headerSearchPath(".."),
  291. .define("DISPLAY_VERSION", to: "0.0.1"), // TODO: Fix version
  292. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: .some([.iOS]))),
  293. .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: .some([.macOS]))),
  294. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: .some([.tvOS]))),
  295. .define("PB_FIELD_32BIT", to: "1"),
  296. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  297. .define("PB_ENABLE_MALLOC", to: "1"),
  298. ]
  299. ),
  300. .target(
  301. name: "FirebaseDatabase",
  302. dependencies: [
  303. "FirebaseCore",
  304. "leveldb",
  305. ],
  306. path: "FirebaseDatabase/Sources",
  307. exclude: [
  308. "third_party/Wrap-leveldb/LICENSE",
  309. "third_party/SocketRocket/LICENSE",
  310. "third_party/FImmutableSortedDictionary/LICENSE",
  311. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  312. ],
  313. publicHeadersPath: "Public",
  314. cSettings: [
  315. .headerSearchPath("../../"),
  316. .define("FIRDatabase_VERSION", to: "0.0.1"), // TODO: Fix version
  317. ]
  318. ),
  319. .testTarget(
  320. name: "DatabaseUnit",
  321. dependencies: ["FirebaseDatabase", "OCMock", "SharedTestUtilities"],
  322. path: "FirebaseDatabase/Tests/",
  323. exclude: [
  324. "Integration/",
  325. ],
  326. resources: [.process("Resources")],
  327. cSettings: [
  328. .headerSearchPath("../.."),
  329. ]
  330. ),
  331. .target(
  332. name: "FirebaseDynamicLinks",
  333. dependencies: ["FirebaseCore"],
  334. path: "FirebaseDynamicLinks/Sources",
  335. publicHeadersPath: "Public",
  336. cSettings: [
  337. .headerSearchPath("../../"),
  338. .define("FIRDynamicLinks3P", to: "1"),
  339. .define("GIN_SCION_LOGGING", to: "1"),
  340. .define("FIRDynamicLinks_VERSION", to: "0.0.1"), // TODO: Fix version
  341. ]
  342. ),
  343. .target(
  344. name: "FirebaseFirestore",
  345. dependencies: [
  346. "FirebaseCore",
  347. "leveldb",
  348. .product(name: "nanopb", package: "nanopb"),
  349. .product(name: "abseil", package: "abseil"),
  350. .product(name: "gRPC-cpp", package: "gRPC"),
  351. ],
  352. path: "Firestore",
  353. exclude: [
  354. "CHANGELOG.md",
  355. "CMakeLists.txt",
  356. "Example/",
  357. "Protos/CMakeLists.txt",
  358. "Protos/Podfile",
  359. "Protos/README.md",
  360. "Protos/build_protos.py",
  361. "Protos/cpp/",
  362. "Protos/lib/",
  363. "Protos/nanopb_cpp_generator.py",
  364. "Protos/protos/",
  365. "README.md",
  366. "Source/CMakeLists.txt",
  367. "Swift/",
  368. "core/CMakeLists.txt",
  369. "core/src/util/config_detected.h.in",
  370. "core/test/",
  371. "fuzzing/",
  372. "test.sh",
  373. "third_party/",
  374. // Exclude alternate implementations for other platforms
  375. "core/src/api/input_validation_std.cc",
  376. "core/src/remote/connectivity_monitor_noop.cc",
  377. "core/src/util/filesystem_win.cc",
  378. "core/src/util/hard_assert_stdio.cc",
  379. "core/src/util/log_stdio.cc",
  380. "core/src/util/secure_random_openssl.cc",
  381. ],
  382. sources: [
  383. "Source/",
  384. "Protos/nanopb/",
  385. "core/include/",
  386. "core/src",
  387. ],
  388. publicHeadersPath: "Source/Public",
  389. cSettings: [
  390. .headerSearchPath("../"),
  391. .headerSearchPath("Source/Public/FirebaseFirestore"),
  392. .headerSearchPath("Protos/nanopb"),
  393. .define("PB_FIELD_32BIT", to: "1"),
  394. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  395. .define("PB_ENABLE_MALLOC", to: "1"),
  396. .define("FIRFirestore_VERSION", to: "0.0.1"), // TODO: Fix version
  397. ]
  398. ),
  399. .target(
  400. name: "FirebaseFirestoreSwift",
  401. dependencies: ["FirebaseFirestore"],
  402. path: "Firestore",
  403. exclude: [
  404. "CHANGELOG.md",
  405. "CMakeLists.txt",
  406. "Example/",
  407. "Protos/",
  408. "README.md",
  409. "Source/",
  410. "core/",
  411. "fuzzing/",
  412. "test.sh",
  413. "Swift/CHANGELOG.md",
  414. "Swift/README.md",
  415. "Swift/Tests/",
  416. "third_party/FirestoreEncoder/LICENSE",
  417. "third_party/FirestoreEncoder/METADATA",
  418. ],
  419. sources: [
  420. "Swift/Source/",
  421. "third_party/FirestoreEncoder/",
  422. ]
  423. ),
  424. .target(
  425. name: "FirebaseFunctions",
  426. dependencies: [
  427. "FirebaseCore",
  428. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  429. ],
  430. path: "Functions/FirebaseFunctions",
  431. publicHeadersPath: "Public",
  432. cSettings: [
  433. .headerSearchPath("../../"),
  434. .define("FIRFunctions_VERSION", to: "0.0.1"), // TODO: Fix version
  435. ]
  436. ),
  437. .target(
  438. name: "FirebaseInAppMessaging",
  439. dependencies: [
  440. "FirebaseCore",
  441. "FirebaseInstallations",
  442. "FirebaseABTesting",
  443. "GoogleUtilities_Environment",
  444. .product(name: "nanopb", package: "nanopb"),
  445. ],
  446. path: "FirebaseInAppMessaging/Sources",
  447. exclude: [
  448. "DefaultUI/CHANGELOG.md",
  449. "DefaultUI/README.md",
  450. ],
  451. resources: [.process("Resources")],
  452. publicHeadersPath: "Public",
  453. cSettings: [
  454. .headerSearchPath("../../"),
  455. .define("FIRInAppMessaging_LIB_VERSION", to: "0.0.1"), // TODO: Fix version
  456. .define("PB_FIELD_32BIT", to: "1"),
  457. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  458. .define("PB_ENABLE_MALLOC", to: "1"),
  459. ]
  460. ),
  461. // .target(
  462. // name: "FirebaseInstanceID",
  463. // dependencies: ["FirebaseCore", "FirebaseInstallations",
  464. // "GoogleUtilities_Environment", "GoogleUtilities_UserDefaults"],
  465. // path: "Firebase/InstanceID",
  466. // publicHeadersPath: "Public",
  467. // cSettings: [
  468. // .headerSearchPath("../../"),
  469. // .define("FIRInstanceID_LIB_VERSION", to: "0.0.1"), // TODO: Fix version
  470. // ]
  471. // ),
  472. .target(
  473. name: "FirebaseInstallations",
  474. dependencies: ["FirebaseCore", .product(name: "FBLPromises", package: "Promises"),
  475. "GoogleUtilities_Environment", "GoogleUtilities_UserDefaults"],
  476. path: "FirebaseInstallations/Source/Library",
  477. publicHeadersPath: "Public",
  478. cSettings: [
  479. .headerSearchPath("../../../"),
  480. ]
  481. ),
  482. .target(
  483. name: "SharedTestUtilities",
  484. dependencies: ["FirebaseCore"],
  485. path: "SharedTestUtilities",
  486. publicHeadersPath: "./",
  487. cSettings: [
  488. .headerSearchPath("../"),
  489. ]
  490. ),
  491. .target(
  492. name: "FirebaseRemoteConfig",
  493. dependencies: [
  494. "FirebaseCore",
  495. "FirebaseABTesting",
  496. "FirebaseInstallations",
  497. "GoogleUtilities_NSData",
  498. ],
  499. path: "FirebaseRemoteConfig/Sources",
  500. publicHeadersPath: "Public",
  501. cSettings: [
  502. .headerSearchPath("../../"),
  503. .define("FIRRemoteConfig_VERSION", to: "0.0.1"), // TODO: Fix version
  504. ]
  505. ),
  506. .testTarget(
  507. name: "RemoteConfigUnit",
  508. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  509. path: "FirebaseRemoteConfig/Tests/Unit",
  510. exclude: [
  511. // Need to be evaluated/ported to RC V2.
  512. "RCNConfigAnalyticsTest.m",
  513. "RCNConfigSettingsTest.m",
  514. "RCNConfigTest.m",
  515. "RCNRemoteConfig+FIRAppTest.m",
  516. "RCNThrottlingTests.m",
  517. ],
  518. resources: [
  519. .process("SecondApp-GoogleService-Info.plist"),
  520. .process("Defaults-testInfo.plist"),
  521. .process("TestABTPayload.txt"),
  522. ],
  523. cSettings: [
  524. .headerSearchPath("../../.."),
  525. ]
  526. ),
  527. .target(
  528. name: "FirebaseStorage",
  529. dependencies: [
  530. "FirebaseCore",
  531. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  532. ],
  533. path: "FirebaseStorage/Sources",
  534. publicHeadersPath: "Public",
  535. cSettings: [
  536. .headerSearchPath("../../"),
  537. .define("FIRStorage_VERSION", to: "0.0.1"), // TODO: Fix version
  538. ]
  539. ),
  540. .testTarget(
  541. name: "StorageUnit",
  542. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  543. path: "FirebaseStorage/Tests/Unit",
  544. cSettings: [
  545. .headerSearchPath("../../.."),
  546. ]
  547. ),
  548. .target(
  549. name: "FirebaseStorageSwift",
  550. dependencies: ["FirebaseStorage"],
  551. path: "FirebaseStorageSwift/Sources"
  552. ),
  553. .target(
  554. name: "GoogleDataTransport",
  555. dependencies: [
  556. .product(name: "nanopb", package: "nanopb"),
  557. ],
  558. path: "GoogleDataTransport",
  559. exclude: [
  560. "CHANGELOG.md",
  561. "README.md",
  562. "generate_project.sh",
  563. "GDTCCTWatchOSTestApp/",
  564. "GDTWatchOSTestApp/",
  565. "GDTCCTTestApp/",
  566. "GDTTestApp/",
  567. "GDTCCTTests/",
  568. "GDTCORTests/",
  569. "ProtoSupport/",
  570. ],
  571. sources: [
  572. "GDTCORLibrary",
  573. "GDTCCTLibrary",
  574. ],
  575. publicHeadersPath: "GDTCORLibrary/Public",
  576. cSettings: [
  577. .headerSearchPath("../"),
  578. .define("GDTCOR_VERSION", to: "0.0.1"),
  579. .define("PB_FIELD_32BIT", to: "1"),
  580. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  581. .define("PB_ENABLE_MALLOC", to: "1"),
  582. ]
  583. ),
  584. .testTarget(
  585. name: "swift-test",
  586. dependencies: [
  587. "FirebaseAuth",
  588. "FirebaseABTesting",
  589. "Firebase",
  590. "FirebaseCrashlytics",
  591. "FirebaseCore",
  592. "FirebaseDatabase",
  593. "FirebaseDynamicLinks",
  594. "FirebaseFirestore",
  595. "FirebaseFirestoreSwift",
  596. "FirebaseFunctions",
  597. "FirebaseInAppMessaging",
  598. "FirebaseInstallations",
  599. // "FirebaseInstanceID",
  600. "FirebaseRemoteConfig",
  601. "FirebaseStorage",
  602. "FirebaseStorageSwift",
  603. "GoogleDataTransport",
  604. "GoogleUtilities_AppDelegateSwizzler",
  605. "GoogleUtilities_Environment",
  606. // "GoogleUtilities_ISASwizzler", // Build needs to disable ARC.
  607. "GoogleUtilities_Logger",
  608. "GoogleUtilities_MethodSwizzler",
  609. "GoogleUtilities_Network",
  610. "GoogleUtilities_NSData",
  611. "GoogleUtilities_Reachability",
  612. "GoogleUtilities_UserDefaults",
  613. .product(name: "nanopb", package: "nanopb"),
  614. ],
  615. path: "SwiftPMTests/swift-test"
  616. ),
  617. .testTarget(
  618. name: "objc-import-test",
  619. dependencies: [
  620. "FirebaseAuth",
  621. "FirebaseABTesting",
  622. "Firebase",
  623. "FirebaseCrashlytics",
  624. "FirebaseCore",
  625. "FirebaseDatabase",
  626. "FirebaseDynamicLinks",
  627. "FirebaseFirestore",
  628. "FirebaseFunctions",
  629. "FirebaseInAppMessaging",
  630. "FirebaseInstallations",
  631. "FirebaseRemoteConfig",
  632. "FirebaseStorage",
  633. ],
  634. path: "SwiftPMTests/objc-import-test"
  635. ),
  636. .target(
  637. name: "GoogleUtilities_AppDelegateSwizzler",
  638. dependencies: ["GoogleUtilities_Environment", "GoogleUtilities_Logger",
  639. "GoogleUtilities_Network"],
  640. path: "GoogleUtilities",
  641. exclude: [
  642. "CHANGELOG.md",
  643. "CMakeLists.txt",
  644. "LICENSE",
  645. "README.md",
  646. "AppDelegateSwizzler/README.md",
  647. "Environment/",
  648. "Network/",
  649. "ISASwizzler/",
  650. "Logger/",
  651. "MethodSwizzler/",
  652. "NSData+zlib/",
  653. "Reachability",
  654. "SwizzlerTestHelpers/",
  655. "Tests",
  656. "UserDefaults/",
  657. ],
  658. sources: [
  659. "AppDelegateSwizzler/",
  660. "SceneDelegateSwizzler/",
  661. "Common/*.h",
  662. ],
  663. publicHeadersPath: "AppDelegateSwizzler/Public",
  664. cSettings: [
  665. .headerSearchPath("../"),
  666. ]
  667. ),
  668. .target(
  669. name: "GoogleUtilities_Environment",
  670. dependencies: [.product(name: "FBLPromises", package: "Promises")],
  671. path: "GoogleUtilities/Environment",
  672. exclude: ["third_party/LICENSE"],
  673. publicHeadersPath: "Private",
  674. cSettings: [
  675. .headerSearchPath("../../"),
  676. ]
  677. ),
  678. .target(
  679. name: "GoogleUtilities_Logger",
  680. dependencies: ["GoogleUtilities_Environment"],
  681. path: "GoogleUtilities/Logger",
  682. publicHeadersPath: "Public",
  683. cSettings: [
  684. .headerSearchPath("../../"),
  685. ]
  686. ),
  687. // TODO: ISA_Swizzler requires building without ARC.
  688. .target(
  689. name: "GoogleUtilities_MethodSwizzler",
  690. dependencies: ["GoogleUtilities_Logger"],
  691. path: "GoogleUtilities/MethodSwizzler",
  692. publicHeadersPath: "Private",
  693. cSettings: [
  694. .headerSearchPath("../../"),
  695. ]
  696. ),
  697. .target(
  698. name: "GoogleUtilities_Network",
  699. dependencies: ["GoogleUtilities_Logger", "GoogleUtilities_NSData",
  700. "GoogleUtilities_Reachability"],
  701. path: "GoogleUtilities/Network",
  702. publicHeadersPath: "Public",
  703. cSettings: [
  704. .headerSearchPath("../.."),
  705. ]
  706. ),
  707. .target(
  708. name: "GoogleUtilities_NSData",
  709. path: "GoogleUtilities/NSData+zlib",
  710. publicHeadersPath: "Public",
  711. cSettings: [
  712. .headerSearchPath("../.."),
  713. ],
  714. linkerSettings: [
  715. .linkedLibrary("z"),
  716. ]
  717. ),
  718. .target(
  719. name: "GoogleUtilities_Reachability",
  720. dependencies: ["GoogleUtilities_Logger"],
  721. path: "GoogleUtilities/Reachability",
  722. publicHeadersPath: "Private",
  723. cSettings: [
  724. .headerSearchPath("../../"),
  725. ]
  726. ),
  727. .target(
  728. name: "GoogleUtilities_UserDefaults",
  729. dependencies: ["GoogleUtilities_Logger"],
  730. path: "GoogleUtilities/UserDefaults",
  731. publicHeadersPath: "Private",
  732. cSettings: [
  733. .headerSearchPath("../../"),
  734. ]
  735. ),
  736. // TODO: - need to port Network/third_party/GTMHTTPServer.m to ARC.
  737. // .testTarget(
  738. // name: "UtilitiesUnit",
  739. // dependencies: [
  740. // "OCMock",
  741. // "GoogleUtilities_AppDelegateSwizzler",
  742. // "GoogleUtilities_Environment",
  743. // // "GoogleUtilities_ISASwizzler", // Build needs to disable ARC.
  744. // "GoogleUtilities_Logger",
  745. // "GoogleUtilities_MethodSwizzler",
  746. // "GoogleUtilities_Network",
  747. // "GoogleUtilities_NSData",
  748. // "GoogleUtilities_Reachability",
  749. // "GoogleUtilities_UserDefaults",
  750. // ],
  751. // path: "GoogleUtilities/Tests/Unit",
  752. // exclude: [
  753. // "Network/third_party/LICENSE",
  754. // "Network/third_party/GTMHTTPServer.m", // Requires disabling ARC
  755. // ],
  756. // cSettings: [
  757. // .headerSearchPath("../../.."),
  758. // ]
  759. // ),
  760. ],
  761. cLanguageStandard: .c99,
  762. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  763. )