Package.swift 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  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. import PackageDescription
  17. let firebaseVersion = "8.3.0"
  18. let package = Package(
  19. name: "Firebase",
  20. platforms: [.iOS(.v11), .macOS(.v10_12), .tvOS(.v10), .watchOS(.v7)],
  21. products: [
  22. .library(
  23. name: "FirebaseAnalytics",
  24. targets: ["FirebaseAnalyticsTarget"]
  25. ),
  26. .library(
  27. name: "FirebaseAnalyticsWithoutAdIdSupport",
  28. targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"]
  29. ),
  30. .library(
  31. name: "FirebaseAnalyticsSwift-Beta",
  32. targets: ["FirebaseAnalyticsSwiftTarget"]
  33. ),
  34. .library(
  35. name: "FirebaseAuth",
  36. targets: ["FirebaseAuth"]
  37. ),
  38. .library(
  39. name: "FirebaseAppCheck",
  40. targets: ["FirebaseAppCheck"]
  41. ),
  42. .library(
  43. name: "FirebaseAppDistribution-Beta",
  44. targets: ["FirebaseAppDistributionTarget"]
  45. ),
  46. // TODO: Re-enable after API review passes.
  47. // .library(
  48. // name: "FirebaseCombineSwift-Beta",
  49. // targets: ["FirebaseCombineSwift"]
  50. // ),
  51. // .library(
  52. // name: "FirebaseAuthCombineSwift-Beta",
  53. // targets: ["FirebaseAuthCombineSwift"]
  54. // ),
  55. // .library(
  56. // name: "FirebaseFunctionsCombineSwift-Beta",
  57. // targets: ["FirebaseFunctionsCombineSwift"]
  58. // ),
  59. // .library(
  60. // name: "FirebaseStorageCombineSwift-Beta",
  61. // targets: ["FirebaseStorageCombineSwift"]
  62. // ),
  63. .library(
  64. name: "FirebaseCrashlytics",
  65. targets: ["FirebaseCrashlytics"]
  66. ),
  67. .library(
  68. name: "FirebaseDatabase",
  69. targets: ["FirebaseDatabase"]
  70. ),
  71. .library(
  72. name: "FirebaseDatabaseSwift-Beta",
  73. targets: ["FirebaseDatabaseSwift"]
  74. ),
  75. .library(
  76. name: "FirebaseDynamicLinks",
  77. targets: ["FirebaseDynamicLinksTarget"]
  78. ),
  79. .library(
  80. name: "FirebaseFirestore",
  81. targets: ["FirebaseFirestoreTarget"]
  82. ),
  83. .library(
  84. name: "FirebaseFirestoreSwift-Beta",
  85. targets: ["FirebaseFirestoreSwiftTarget"]
  86. ),
  87. .library(
  88. name: "FirebaseFunctions",
  89. targets: ["FirebaseFunctionsTarget"]
  90. ),
  91. .library(
  92. name: "FirebaseInAppMessaging-Beta",
  93. targets: ["FirebaseInAppMessagingTarget"]
  94. ),
  95. .library(
  96. name: "FirebaseInAppMessagingSwift-Beta",
  97. targets: ["FirebaseInAppMessagingSwift"]
  98. ),
  99. .library(
  100. name: "FirebaseInstallations",
  101. targets: ["FirebaseInstallations"]
  102. ),
  103. .library(
  104. name: "FirebaseMessaging",
  105. targets: ["FirebaseMessaging"]
  106. ),
  107. .library(
  108. name: "FirebaseMLModelDownloader",
  109. targets: ["FirebaseMLModelDownloader"]
  110. ),
  111. .library(
  112. name: "FirebaseRemoteConfig",
  113. targets: ["FirebaseRemoteConfig"]
  114. ),
  115. .library(
  116. name: "FirebaseStorage",
  117. targets: ["FirebaseStorage"]
  118. ),
  119. .library(
  120. name: "FirebaseStorageSwift-Beta",
  121. targets: ["FirebaseStorageSwift"]
  122. ),
  123. ],
  124. dependencies: [
  125. .package(
  126. name: "Promises",
  127. url: "https://github.com/google/promises.git",
  128. "1.2.8" ..< "1.3.0"
  129. ),
  130. .package(
  131. name: "SwiftProtobuf",
  132. url: "https://github.com/apple/swift-protobuf.git",
  133. "1.15.0" ..< "2.0.0"
  134. ),
  135. .package(
  136. name: "GoogleAppMeasurement",
  137. url: "https://github.com/google/GoogleAppMeasurement.git",
  138. .exact("8.3.1")
  139. ),
  140. .package(
  141. name: "GoogleDataTransport",
  142. url: "https://github.com/google/GoogleDataTransport.git",
  143. "9.0.0" ..< "10.0.0"
  144. ),
  145. .package(
  146. name: "GoogleUtilities",
  147. url: "https://github.com/google/GoogleUtilities.git",
  148. "7.4.0" ..< "8.0.0"
  149. ),
  150. .package(
  151. name: "GTMSessionFetcher",
  152. url: "https://github.com/google/gtm-session-fetcher.git",
  153. "1.5.0" ..< "2.0.0"
  154. ),
  155. .package(
  156. name: "nanopb",
  157. url: "https://github.com/firebase/nanopb.git",
  158. "2.30908.0" ..< "2.30909.0"
  159. ),
  160. .package(
  161. name: "abseil",
  162. url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
  163. "0.20200225.3" ..< "0.20200226.0"
  164. ),
  165. .package(
  166. name: "gRPC",
  167. url: "https://github.com/firebase/grpc-SwiftPM.git",
  168. "1.28.4" ..< "1.29.0"
  169. ),
  170. .package(
  171. name: "OCMock",
  172. url: "https://github.com/erikdoe/ocmock.git",
  173. .revision("21cce26d223d49a9ab5ae47f28864f422bfe3951")
  174. ),
  175. .package(
  176. name: "leveldb",
  177. url: "https://github.com/firebase/leveldb.git",
  178. "1.22.2" ..< "1.23.0"
  179. ),
  180. // Branches need a force update with a run with the revision set like below.
  181. // .package(url: "https://github.com/paulb777/nanopb.git", .revision("564392bd87bd093c308a3aaed3997466efb95f74"))
  182. ],
  183. targets: [
  184. .target(
  185. name: "Firebase",
  186. path: "CoreOnly/Sources",
  187. publicHeadersPath: "./"
  188. ),
  189. .target(
  190. name: "FirebaseCore",
  191. dependencies: [
  192. "Firebase",
  193. "FirebaseCoreDiagnostics",
  194. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  195. .product(name: "GULLogger", package: "GoogleUtilities"),
  196. ],
  197. path: "FirebaseCore/Sources",
  198. publicHeadersPath: "Public",
  199. cSettings: [
  200. .headerSearchPath("../.."),
  201. .define("Firebase_VERSION", to: firebaseVersion),
  202. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  203. ],
  204. linkerSettings: [
  205. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  206. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  207. ]
  208. ),
  209. .testTarget(
  210. name: "CoreUnit",
  211. dependencies: ["FirebaseCore", "SharedTestUtilities", "OCMock"],
  212. path: "FirebaseCore/Tests/Unit",
  213. exclude: ["Resources/GoogleService-Info.plist"],
  214. cSettings: [
  215. .headerSearchPath("../../.."),
  216. ]
  217. ),
  218. .target(
  219. name: "FirebaseCoreDiagnostics",
  220. dependencies: [
  221. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  222. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  223. .product(name: "GULLogger", package: "GoogleUtilities"),
  224. .product(name: "nanopb", package: "nanopb"),
  225. ],
  226. path: "Firebase/CoreDiagnostics/FIRCDLibrary",
  227. publicHeadersPath: ".",
  228. cSettings: [
  229. .headerSearchPath("../../.."),
  230. .define("PB_FIELD_32BIT", to: "1"),
  231. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  232. .define("PB_ENABLE_MALLOC", to: "1"),
  233. ]
  234. ),
  235. .target(
  236. name: "FirebaseABTesting",
  237. dependencies: ["FirebaseCore"],
  238. path: "FirebaseABTesting/Sources",
  239. publicHeadersPath: "Public",
  240. cSettings: [
  241. .headerSearchPath("../../"),
  242. ]
  243. ),
  244. .testTarget(
  245. name: "ABTestingUnit",
  246. dependencies: ["FirebaseABTesting", "OCMock"],
  247. path: "FirebaseABTesting/Tests/Unit",
  248. resources: [.process("Resources")],
  249. cSettings: [
  250. .headerSearchPath("../../.."),
  251. ]
  252. ),
  253. .target(
  254. name: "FirebaseAnalyticsTarget",
  255. dependencies: [.target(name: "FirebaseAnalyticsWrapper",
  256. condition: .when(platforms: [.iOS]))],
  257. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
  258. ),
  259. .target(
  260. name: "FirebaseAnalyticsWrapper",
  261. dependencies: [
  262. .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS])),
  263. .product(name: "GoogleAppMeasurement",
  264. package: "GoogleAppMeasurement",
  265. condition: .when(platforms: [.iOS])),
  266. "FirebaseCore",
  267. "FirebaseInstallations",
  268. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  269. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  270. .product(name: "GULNSData", package: "GoogleUtilities"),
  271. .product(name: "GULNetwork", package: "GoogleUtilities"),
  272. .product(name: "nanopb", package: "nanopb"),
  273. ],
  274. path: "FirebaseAnalyticsWrapper",
  275. linkerSettings: [
  276. .linkedLibrary("sqlite3"),
  277. .linkedLibrary("c++"),
  278. .linkedLibrary("z"),
  279. .linkedFramework("StoreKit"),
  280. ]
  281. ),
  282. .binaryTarget(
  283. name: "FirebaseAnalytics",
  284. url: "https://dl.google.com/firebase/ios/swiftpm/8.3.0/FirebaseAnalytics.zip",
  285. checksum: "3225b785ef2884889b41216150d000ccac3aa9d5e9bebbd993a63725503949e5"
  286. ),
  287. .target(
  288. name: "FirebaseAnalyticsSwiftTarget",
  289. dependencies: [.target(name: "FirebaseAnalyticsSwift",
  290. condition: .when(platforms: [.iOS]))],
  291. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
  292. ),
  293. .target(
  294. name: "FirebaseAnalyticsSwift",
  295. dependencies: ["FirebaseAnalyticsWrapper"],
  296. path: "FirebaseAnalyticsSwift/Sources"
  297. ),
  298. .target(
  299. name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
  300. dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  301. condition: .when(platforms: [.iOS]))],
  302. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
  303. ),
  304. .target(
  305. name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  306. dependencies: [
  307. .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS])),
  308. .product(name: "GoogleAppMeasurementWithoutAdIdSupport",
  309. package: "GoogleAppMeasurement",
  310. condition: .when(platforms: [.iOS])),
  311. "FirebaseCore",
  312. "FirebaseInstallations",
  313. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  314. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  315. .product(name: "GULNSData", package: "GoogleUtilities"),
  316. .product(name: "GULNetwork", package: "GoogleUtilities"),
  317. .product(name: "nanopb", package: "nanopb"),
  318. ],
  319. path: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  320. linkerSettings: [
  321. .linkedLibrary("sqlite3"),
  322. .linkedLibrary("c++"),
  323. .linkedLibrary("z"),
  324. .linkedFramework("StoreKit"),
  325. ]
  326. ),
  327. .target(
  328. name: "FirebaseAppDistributionTarget",
  329. dependencies: [.target(name: "FirebaseAppDistribution",
  330. condition: .when(platforms: [.iOS]))],
  331. path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
  332. ),
  333. .target(
  334. name: "FirebaseAppDistribution",
  335. dependencies: [
  336. "FirebaseCore",
  337. "FirebaseInstallations",
  338. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  339. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  340. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  341. ],
  342. path: "FirebaseAppDistribution/Sources",
  343. publicHeadersPath: "Public",
  344. cSettings: [
  345. .headerSearchPath("../../"),
  346. ]
  347. ),
  348. .testTarget(
  349. name: "AppDistributionUnit",
  350. dependencies: ["FirebaseAppDistribution", "OCMock"],
  351. path: "FirebaseAppDistribution/Tests/Unit",
  352. resources: [.process("Resources")],
  353. cSettings: [
  354. .headerSearchPath("../../.."),
  355. ]
  356. ),
  357. .target(
  358. name: "FirebaseAuth",
  359. dependencies: [
  360. "FirebaseCore",
  361. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  362. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  363. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  364. ],
  365. path: "FirebaseAuth/Sources",
  366. publicHeadersPath: "Public",
  367. cSettings: [
  368. .headerSearchPath("../../"),
  369. ],
  370. linkerSettings: [
  371. .linkedFramework("Security"),
  372. .linkedFramework("SafariServices", .when(platforms: [.iOS])),
  373. ]
  374. ),
  375. .testTarget(
  376. name: "AuthUnit",
  377. dependencies: ["FirebaseAuth", "OCMock"],
  378. path: "FirebaseAuth/Tests/Unit",
  379. exclude: [
  380. "FIRAuthKeychainServicesTests.m", // TODO: figure out SPM keychain testing
  381. "FIRAuthTests.m",
  382. "FIRUserTests.m",
  383. ],
  384. cSettings: [
  385. .headerSearchPath("../../.."),
  386. ]
  387. ),
  388. .target(
  389. name: "FirebaseCombineSwift",
  390. dependencies: [
  391. "FirebaseAuthCombineSwift",
  392. "FirebaseFunctionsCombineSwift",
  393. "FirebaseStorageCombineSwift",
  394. ],
  395. path: "FirebaseCombineSwift/Sources/Core"
  396. ),
  397. .target(
  398. name: "FirebaseAuthCombineSwift",
  399. dependencies: ["FirebaseAuth"],
  400. path: "FirebaseCombineSwift/Sources/Auth"
  401. ),
  402. .target(
  403. name: "FirebaseStorageCombineSwift",
  404. dependencies: [
  405. "FirebaseStorage",
  406. "FirebaseStorageSwift",
  407. ],
  408. path: "FirebaseCombineSwift/Sources/Storage"
  409. ),
  410. .target(
  411. name: "FirebaseCrashlytics",
  412. dependencies: ["FirebaseCore", "FirebaseInstallations",
  413. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  414. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  415. .product(name: "FBLPromises", package: "Promises"),
  416. .product(name: "nanopb", package: "nanopb")],
  417. path: "Crashlytics",
  418. exclude: [
  419. "run",
  420. "CHANGELOG.md",
  421. "LICENSE",
  422. "README.md",
  423. "ProtoSupport/",
  424. "UnitTests/",
  425. "generate_project.sh",
  426. "upload-symbols",
  427. "third_party/libunwind/LICENSE",
  428. ],
  429. sources: [
  430. "Crashlytics/",
  431. "Protogen/",
  432. "Shared/",
  433. "third_party/libunwind/dwarf.h",
  434. ],
  435. publicHeadersPath: "Crashlytics/Public",
  436. cSettings: [
  437. .headerSearchPath(".."),
  438. .define("DISPLAY_VERSION", to: firebaseVersion),
  439. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  440. .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: [.macOS])),
  441. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  442. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  443. .define("PB_FIELD_32BIT", to: "1"),
  444. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  445. .define("PB_ENABLE_MALLOC", to: "1"),
  446. ],
  447. linkerSettings: [
  448. .linkedFramework("Security"),
  449. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  450. ]
  451. ),
  452. .target(
  453. name: "FirebaseDatabase",
  454. dependencies: [
  455. "FirebaseCore",
  456. "leveldb",
  457. ],
  458. path: "FirebaseDatabase/Sources",
  459. exclude: [
  460. "third_party/Wrap-leveldb/LICENSE",
  461. "third_party/SocketRocket/LICENSE",
  462. "third_party/FImmutableSortedDictionary/LICENSE",
  463. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  464. ],
  465. publicHeadersPath: "Public",
  466. cSettings: [
  467. .headerSearchPath("../../"),
  468. ],
  469. linkerSettings: [
  470. .linkedFramework("CFNetwork"),
  471. .linkedFramework("Security"),
  472. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  473. .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
  474. ]
  475. ),
  476. .testTarget(
  477. name: "DatabaseUnit",
  478. dependencies: ["FirebaseDatabase", "OCMock", "SharedTestUtilities"],
  479. path: "FirebaseDatabase/Tests/",
  480. exclude: [
  481. "Integration/",
  482. ],
  483. resources: [.process("Resources")],
  484. cSettings: [
  485. .headerSearchPath("../.."),
  486. ]
  487. ),
  488. .target(
  489. name: "FirebaseDatabaseSwift",
  490. dependencies: ["FirebaseDatabase"],
  491. path: "FirebaseDatabaseSwift/Sources",
  492. exclude: [
  493. "third_party/RTDBEncoder/LICENSE",
  494. "third_party/RTDBEncoder/METADATA",
  495. ]
  496. ),
  497. .testTarget(
  498. name: "FirebaseDatabaseSwiftTests",
  499. dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
  500. path: "FirebaseDatabaseSwift/Tests/"
  501. ),
  502. .target(
  503. name: "FirebaseDynamicLinksTarget",
  504. dependencies: [.target(name: "FirebaseDynamicLinks",
  505. condition: .when(platforms: [.iOS]))],
  506. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  507. ),
  508. .target(
  509. name: "FirebaseDynamicLinks",
  510. dependencies: ["FirebaseCore"],
  511. path: "FirebaseDynamicLinks/Sources",
  512. publicHeadersPath: "Public",
  513. cSettings: [
  514. .headerSearchPath("../../"),
  515. .define("FIRDynamicLinks3P", to: "1"),
  516. .define("GIN_SCION_LOGGING", to: "1"),
  517. ],
  518. linkerSettings: [
  519. .linkedFramework("QuartzCore"),
  520. ]
  521. ),
  522. .target(
  523. name: "FirebaseFirestoreTarget",
  524. dependencies: [.target(name: "FirebaseFirestore",
  525. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  526. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  527. ),
  528. .target(
  529. name: "FirebaseFirestore",
  530. dependencies: [
  531. "FirebaseCore",
  532. "leveldb",
  533. .product(name: "nanopb", package: "nanopb"),
  534. .product(name: "abseil", package: "abseil"),
  535. .product(name: "gRPC-cpp", package: "gRPC"),
  536. ],
  537. path: "Firestore",
  538. exclude: [
  539. "CHANGELOG.md",
  540. "CMakeLists.txt",
  541. "Example/",
  542. "Protos/CMakeLists.txt",
  543. "Protos/Podfile",
  544. "Protos/README.md",
  545. "Protos/build_protos.py",
  546. "Protos/cpp/",
  547. "Protos/lib/",
  548. "Protos/nanopb_cpp_generator.py",
  549. "Protos/protos/",
  550. "README.md",
  551. "Source/CMakeLists.txt",
  552. "Swift/",
  553. "core/CMakeLists.txt",
  554. "core/src/util/config_detected.h.in",
  555. "core/test/",
  556. "fuzzing/",
  557. "test.sh",
  558. // Swift PM doesn't recognize hpp files, so we're relying on search paths
  559. // to find third_party/nlohmann_json/json.hpp.
  560. "third_party/",
  561. // Exclude alternate implementations for other platforms
  562. "core/src/remote/connectivity_monitor_noop.cc",
  563. "core/src/util/filesystem_win.cc",
  564. "core/src/util/log_stdio.cc",
  565. "core/src/util/secure_random_openssl.cc",
  566. ],
  567. sources: [
  568. "Source/",
  569. "Protos/nanopb/",
  570. "core/include/",
  571. "core/src",
  572. ],
  573. publicHeadersPath: "Source/Public",
  574. cSettings: [
  575. .headerSearchPath("../"),
  576. .headerSearchPath("Source/Public/FirebaseFirestore"),
  577. .headerSearchPath("Protos/nanopb"),
  578. .define("PB_FIELD_32BIT", to: "1"),
  579. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  580. .define("PB_ENABLE_MALLOC", to: "1"),
  581. .define("FIRFirestore_VERSION", to: firebaseVersion),
  582. ],
  583. linkerSettings: [
  584. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  585. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  586. .linkedLibrary("c++"),
  587. ]
  588. ),
  589. .target(
  590. name: "FirebaseFirestoreSwiftTarget",
  591. dependencies: [.target(name: "FirebaseFirestoreSwift",
  592. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  593. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  594. ),
  595. .target(
  596. name: "FirebaseFirestoreSwift",
  597. dependencies: ["FirebaseFirestore"],
  598. path: "Firestore",
  599. exclude: [
  600. "CHANGELOG.md",
  601. "CMakeLists.txt",
  602. "Example/",
  603. "Protos/",
  604. "README.md",
  605. "Source/",
  606. "core/",
  607. "fuzzing/",
  608. "test.sh",
  609. "Swift/CHANGELOG.md",
  610. "Swift/README.md",
  611. "Swift/Tests/",
  612. "third_party/nlohmann_json",
  613. "third_party/FirestoreEncoder/LICENSE",
  614. "third_party/FirestoreEncoder/METADATA",
  615. ],
  616. sources: [
  617. "Swift/Source/",
  618. "third_party/FirestoreEncoder/",
  619. ]
  620. ),
  621. // MARK: Firebase Functions
  622. .target(
  623. name: "FirebaseFunctionsTarget",
  624. dependencies: [.target(name: "FirebaseFunctions",
  625. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  626. path: "SwiftPM-PlatformExclude/FirebaseFunctionsWrap"
  627. ),
  628. .target(
  629. name: "FirebaseFunctions",
  630. dependencies: [
  631. "FirebaseCore",
  632. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  633. ],
  634. path: "Functions/FirebaseFunctions",
  635. publicHeadersPath: "Public",
  636. cSettings: [
  637. .headerSearchPath("../../"),
  638. ]
  639. ),
  640. .target(
  641. name: "FirebaseFunctionsCombineSwift",
  642. dependencies: ["FirebaseFunctions"],
  643. path: "FirebaseCombineSwift/Sources/Functions"
  644. ),
  645. .testTarget(
  646. name: "FunctionsCombineUnit",
  647. dependencies: ["FirebaseFunctionsCombineSwift",
  648. "FirebaseFunctionsTestingSupport",
  649. "SharedTestUtilities"],
  650. path: "Functions/Tests/CombineUnit"
  651. ),
  652. .target(
  653. name: "FirebaseFunctionsTestingSupport",
  654. dependencies: ["FirebaseFunctions"],
  655. path: "FirebaseTestingSupport/Functions/Sources",
  656. publicHeadersPath: "Public",
  657. cSettings: [
  658. .headerSearchPath("../../.."),
  659. ]
  660. ),
  661. .target(
  662. name: "FirebaseInAppMessagingTarget",
  663. dependencies: [
  664. .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
  665. ],
  666. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  667. ),
  668. .target(
  669. name: "FirebaseInAppMessaging",
  670. dependencies: [
  671. "FirebaseCore",
  672. "FirebaseInstallations",
  673. "FirebaseABTesting",
  674. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  675. .product(name: "nanopb", package: "nanopb"),
  676. .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
  677. ],
  678. path: "FirebaseInAppMessaging/Sources",
  679. exclude: [
  680. "DefaultUI/CHANGELOG.md",
  681. "DefaultUI/README.md",
  682. ],
  683. publicHeadersPath: "Public",
  684. cSettings: [
  685. .headerSearchPath("../../"),
  686. .define("PB_FIELD_32BIT", to: "1"),
  687. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  688. .define("PB_ENABLE_MALLOC", to: "1"),
  689. ]
  690. ),
  691. .target(
  692. name: "FirebaseInAppMessaging_iOS",
  693. path: "FirebaseInAppMessaging/iOS",
  694. resources: [.process("Resources")]
  695. ),
  696. .target(
  697. name: "FirebaseInAppMessagingSwift",
  698. dependencies: ["FirebaseInAppMessaging"],
  699. path: "FirebaseInAppMessaging/Swift/Source"
  700. ),
  701. .target(
  702. name: "FirebaseInstallations",
  703. dependencies: [
  704. "FirebaseCore",
  705. .product(name: "FBLPromises", package: "Promises"),
  706. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  707. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  708. ],
  709. path: "FirebaseInstallations/Source/Library",
  710. publicHeadersPath: "Public",
  711. cSettings: [
  712. .headerSearchPath("../../../"),
  713. ],
  714. linkerSettings: [
  715. .linkedFramework("Security"),
  716. ]
  717. ),
  718. .target(
  719. name: "FirebaseMLModelDownloader",
  720. dependencies: [
  721. "FirebaseCore",
  722. "FirebaseInstallations",
  723. .product(name: "GULLogger", package: "GoogleUtilities"),
  724. "SwiftProtobuf",
  725. ],
  726. path: "FirebaseMLModelDownloader/Sources",
  727. exclude: [
  728. "proto/firebase_ml_log_sdk.proto",
  729. ],
  730. cSettings: [
  731. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  732. ]
  733. ),
  734. .testTarget(
  735. name: "FirebaseMLModelDownloaderUnit",
  736. dependencies: ["FirebaseMLModelDownloader"],
  737. path: "FirebaseMLModelDownloader/Tests/Unit"
  738. ),
  739. .target(
  740. name: "FirebaseMessaging",
  741. dependencies: [
  742. "FirebaseCore",
  743. "FirebaseInstallations",
  744. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  745. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  746. .product(name: "GULReachability", package: "GoogleUtilities"),
  747. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  748. ],
  749. path: "FirebaseMessaging/Sources",
  750. publicHeadersPath: "Public",
  751. cSettings: [
  752. .headerSearchPath("../../"),
  753. ],
  754. linkerSettings: [
  755. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  756. ]
  757. ),
  758. .testTarget(
  759. name: "MessagingUnit",
  760. dependencies: ["FirebaseMessaging", "SharedTestUtilities", "OCMock"],
  761. path: "FirebaseMessaging/Tests/UnitTests",
  762. exclude: [
  763. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  764. ],
  765. cSettings: [
  766. .headerSearchPath("../../.."),
  767. ]
  768. ),
  769. .target(
  770. name: "SharedTestUtilities",
  771. dependencies: ["FirebaseCore", "OCMock"],
  772. path: "SharedTestUtilities",
  773. publicHeadersPath: "./",
  774. cSettings: [
  775. .headerSearchPath("../"),
  776. ]
  777. ),
  778. .target(
  779. name: "FirebaseRemoteConfig",
  780. dependencies: [
  781. "FirebaseCore",
  782. "FirebaseABTesting",
  783. "FirebaseInstallations",
  784. .product(name: "GULNSData", package: "GoogleUtilities"),
  785. ],
  786. path: "FirebaseRemoteConfig/Sources",
  787. publicHeadersPath: "Public",
  788. cSettings: [
  789. .headerSearchPath("../../"),
  790. ]
  791. ),
  792. .testTarget(
  793. name: "RemoteConfigUnit",
  794. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  795. path: "FirebaseRemoteConfig/Tests/Unit",
  796. exclude: [
  797. // Need to be evaluated/ported to RC V2.
  798. "RCNConfigAnalyticsTest.m",
  799. "RCNConfigSettingsTest.m",
  800. "RCNConfigTest.m",
  801. "RCNRemoteConfig+FIRAppTest.m",
  802. "RCNThrottlingTests.m",
  803. ],
  804. resources: [
  805. .process("SecondApp-GoogleService-Info.plist"),
  806. .process("Defaults-testInfo.plist"),
  807. .process("TestABTPayload.txt"),
  808. ],
  809. cSettings: [
  810. .headerSearchPath("../../.."),
  811. ]
  812. ),
  813. .target(
  814. name: "FirebaseStorage",
  815. dependencies: [
  816. "FirebaseCore",
  817. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  818. ],
  819. path: "FirebaseStorage/Sources",
  820. publicHeadersPath: "Public",
  821. cSettings: [
  822. .headerSearchPath("../../"),
  823. ],
  824. linkerSettings: [
  825. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS])),
  826. .linkedFramework("CoreServices", .when(platforms: [.macOS])),
  827. ]
  828. ),
  829. .testTarget(
  830. name: "StorageUnit",
  831. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  832. path: "FirebaseStorage/Tests/Unit",
  833. cSettings: [
  834. .headerSearchPath("../../.."),
  835. ]
  836. ),
  837. .target(
  838. name: "FirebaseStorageSwift",
  839. dependencies: ["FirebaseStorage"],
  840. path: "FirebaseStorageSwift/Sources"
  841. ),
  842. .testTarget(
  843. name: "swift-test",
  844. dependencies: [
  845. "FirebaseAuth",
  846. "FirebaseABTesting",
  847. .target(name: "FirebaseAppDistribution",
  848. condition: .when(platforms: [.iOS])),
  849. "Firebase",
  850. "FirebaseCombineSwift",
  851. "FirebaseCrashlytics",
  852. "FirebaseCore",
  853. "FirebaseDatabase",
  854. "FirebaseDynamicLinks",
  855. "FirebaseFirestore",
  856. "FirebaseFirestoreSwift",
  857. "FirebaseFunctions",
  858. "FirebaseInAppMessaging",
  859. .target(name: "FirebaseInAppMessagingSwift",
  860. condition: .when(platforms: [.iOS, .tvOS])),
  861. "FirebaseInstallations",
  862. "FirebaseMessaging",
  863. "FirebaseRemoteConfig",
  864. "FirebaseStorage",
  865. "FirebaseStorageSwift",
  866. .product(name: "nanopb", package: "nanopb"),
  867. ],
  868. path: "SwiftPMTests/swift-test"
  869. ),
  870. .testTarget(
  871. name: "analytics-import-test",
  872. dependencies: [
  873. "FirebaseAnalyticsSwiftTarget",
  874. "FirebaseAnalyticsWrapper",
  875. "Firebase",
  876. ],
  877. path: "SwiftPMTests/analytics-import-test"
  878. ),
  879. .testTarget(
  880. name: "objc-import-test",
  881. dependencies: [
  882. "FirebaseAuth",
  883. "FirebaseABTesting",
  884. .target(name: "FirebaseAppDistribution",
  885. condition: .when(platforms: [.iOS])),
  886. "Firebase",
  887. "FirebaseCrashlytics",
  888. "FirebaseCore",
  889. "FirebaseDatabase",
  890. "FirebaseDynamicLinks",
  891. "FirebaseFirestore",
  892. "FirebaseFunctions",
  893. "FirebaseInAppMessaging",
  894. "FirebaseInstallations",
  895. "FirebaseMessaging",
  896. "FirebaseRemoteConfig",
  897. "FirebaseStorage",
  898. ],
  899. path: "SwiftPMTests/objc-import-test"
  900. ),
  901. .testTarget(
  902. name: "version-test",
  903. dependencies: [
  904. "FirebaseCore",
  905. ],
  906. path: "SwiftPMTests/version-test",
  907. cSettings: [
  908. .define("FIR_VERSION", to: firebaseVersion),
  909. ]
  910. ),
  911. // MARK: - Firebase App Check
  912. .target(name: "FirebaseAppCheck",
  913. dependencies: [
  914. "FirebaseCore",
  915. .product(name: "FBLPromises", package: "Promises"),
  916. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  917. ],
  918. path: "FirebaseAppCheck/Sources",
  919. publicHeadersPath: "Public",
  920. cSettings: [
  921. .headerSearchPath("../.."),
  922. ],
  923. linkerSettings: [
  924. .linkedFramework("DeviceCheck"),
  925. ]),
  926. .testTarget(
  927. name: "AppCheckUnit",
  928. dependencies: ["FirebaseAppCheck", "OCMock", "SharedTestUtilities"],
  929. path: "FirebaseAppCheck/Tests",
  930. exclude: [
  931. // Disable Swift tests as mixed targets are not supported (Xcode 12.3).
  932. "Unit/Swift",
  933. // Disable Keychain dependent tests as they require a host application on iOS.
  934. "Integration",
  935. "Unit/AppAttestProvider/Storage/FIRAppAttestArtifactStorageTests.m",
  936. "Unit/Core/FIRAppCheckIntegrationTests.m",
  937. "Unit/Core/FIRAppCheckStorageTests.m",
  938. ],
  939. resources: [
  940. .process("Fixture"),
  941. ],
  942. cSettings: [
  943. .headerSearchPath("../.."),
  944. ]
  945. ),
  946. .testTarget(
  947. name: "AppCheckUnitSwift",
  948. dependencies: ["FirebaseAppCheck"],
  949. path: "FirebaseAppCheck/Tests/Unit/Swift",
  950. cSettings: [
  951. .headerSearchPath("../.."),
  952. ]
  953. ),
  954. // MARK: Testing support
  955. .target(
  956. name: "FirebaseFirestoreTestingSupport",
  957. dependencies: ["FirebaseFirestore"],
  958. path: "FirebaseTestingSupport/Firestore/Sources",
  959. publicHeadersPath: "./",
  960. cSettings: [
  961. .headerSearchPath("../../.."),
  962. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  963. ]
  964. ),
  965. .testTarget(
  966. name: "FirestoreTestingSupportTests",
  967. dependencies: ["FirebaseFirestoreTestingSupport"],
  968. path: "FirebaseTestingSupport/Firestore/Tests",
  969. cSettings: [
  970. .headerSearchPath("../../.."),
  971. ]
  972. ),
  973. ],
  974. cLanguageStandard: .c99,
  975. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  976. )