Package.swift 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012
  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.1.1"
  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.1.1")
  139. ),
  140. .package(
  141. name: "GoogleDataTransport",
  142. url: "https://github.com/google/GoogleDataTransport.git",
  143. "8.4.0" ..< "9.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.1.1/FirebaseAnalytics.zip",
  285. checksum: "e1327203fc41fafe9d5dc7e49ce078763387046e82a7a50ba1bf3e6329130d21"
  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: "FBLPromises", package: "Promises"),
  415. .product(name: "nanopb", package: "nanopb")],
  416. path: "Crashlytics",
  417. exclude: [
  418. "run",
  419. "CHANGELOG.md",
  420. "LICENSE",
  421. "README.md",
  422. "Data/",
  423. "Protos/",
  424. "ProtoSupport/",
  425. "UnitTests/",
  426. "generate_project.sh",
  427. "upload-symbols",
  428. "third_party/libunwind/LICENSE",
  429. ],
  430. sources: [
  431. "Crashlytics/",
  432. "Protogen/",
  433. "Shared/",
  434. "third_party/libunwind/dwarf.h",
  435. ],
  436. publicHeadersPath: "Crashlytics/Public",
  437. cSettings: [
  438. .headerSearchPath(".."),
  439. .define("DISPLAY_VERSION", to: firebaseVersion),
  440. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  441. .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: [.macOS])),
  442. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  443. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  444. .define("PB_FIELD_32BIT", to: "1"),
  445. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  446. .define("PB_ENABLE_MALLOC", to: "1"),
  447. ],
  448. linkerSettings: [
  449. .linkedFramework("Security"),
  450. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  451. ]
  452. ),
  453. .target(
  454. name: "FirebaseDatabase",
  455. dependencies: [
  456. "FirebaseCore",
  457. "leveldb",
  458. ],
  459. path: "FirebaseDatabase/Sources",
  460. exclude: [
  461. "third_party/Wrap-leveldb/LICENSE",
  462. "third_party/SocketRocket/LICENSE",
  463. "third_party/FImmutableSortedDictionary/LICENSE",
  464. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  465. ],
  466. publicHeadersPath: "Public",
  467. cSettings: [
  468. .headerSearchPath("../../"),
  469. ],
  470. linkerSettings: [
  471. .linkedFramework("CFNetwork"),
  472. .linkedFramework("Security"),
  473. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  474. .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
  475. ]
  476. ),
  477. .testTarget(
  478. name: "DatabaseUnit",
  479. dependencies: ["FirebaseDatabase", "OCMock", "SharedTestUtilities"],
  480. path: "FirebaseDatabase/Tests/",
  481. exclude: [
  482. "Integration/",
  483. ],
  484. resources: [.process("Resources")],
  485. cSettings: [
  486. .headerSearchPath("../.."),
  487. ]
  488. ),
  489. .target(
  490. name: "FirebaseDatabaseSwift",
  491. dependencies: ["FirebaseDatabase"],
  492. path: "FirebaseDatabaseSwift/Sources",
  493. exclude: [
  494. "third_party/RTDBEncoder/LICENSE",
  495. "third_party/RTDBEncoder/METADATA",
  496. ]
  497. ),
  498. .testTarget(
  499. name: "FirebaseDatabaseSwiftTests",
  500. dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
  501. path: "FirebaseDatabaseSwift/Tests/"
  502. ),
  503. .target(
  504. name: "FirebaseDynamicLinksTarget",
  505. dependencies: [.target(name: "FirebaseDynamicLinks",
  506. condition: .when(platforms: [.iOS]))],
  507. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  508. ),
  509. .target(
  510. name: "FirebaseDynamicLinks",
  511. dependencies: ["FirebaseCore"],
  512. path: "FirebaseDynamicLinks/Sources",
  513. publicHeadersPath: "Public",
  514. cSettings: [
  515. .headerSearchPath("../../"),
  516. .define("FIRDynamicLinks3P", to: "1"),
  517. .define("GIN_SCION_LOGGING", to: "1"),
  518. ],
  519. linkerSettings: [
  520. .linkedFramework("QuartzCore"),
  521. ]
  522. ),
  523. .target(
  524. name: "FirebaseFirestoreTarget",
  525. dependencies: [.target(name: "FirebaseFirestore",
  526. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  527. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  528. ),
  529. .target(
  530. name: "FirebaseFirestore",
  531. dependencies: [
  532. "FirebaseCore",
  533. "leveldb",
  534. .product(name: "nanopb", package: "nanopb"),
  535. .product(name: "abseil", package: "abseil"),
  536. .product(name: "gRPC-cpp", package: "gRPC"),
  537. ],
  538. path: "Firestore",
  539. exclude: [
  540. "CHANGELOG.md",
  541. "CMakeLists.txt",
  542. "Example/",
  543. "Protos/CMakeLists.txt",
  544. "Protos/Podfile",
  545. "Protos/README.md",
  546. "Protos/build_protos.py",
  547. "Protos/cpp/",
  548. "Protos/lib/",
  549. "Protos/nanopb_cpp_generator.py",
  550. "Protos/protos/",
  551. "README.md",
  552. "Source/CMakeLists.txt",
  553. "Swift/",
  554. "core/CMakeLists.txt",
  555. "core/src/util/config_detected.h.in",
  556. "core/test/",
  557. "fuzzing/",
  558. "test.sh",
  559. // Swift PM doesn't recognize hpp files, so we're relying on search paths
  560. // to find third_party/nlohmann_json/json.hpp.
  561. "third_party/",
  562. // Exclude alternate implementations for other platforms
  563. "core/src/api/input_validation_std.cc",
  564. "core/src/remote/connectivity_monitor_noop.cc",
  565. "core/src/util/filesystem_win.cc",
  566. "core/src/util/hard_assert_stdio.cc",
  567. "core/src/util/log_stdio.cc",
  568. "core/src/util/secure_random_openssl.cc",
  569. ],
  570. sources: [
  571. "Source/",
  572. "Protos/nanopb/",
  573. "core/include/",
  574. "core/src",
  575. ],
  576. publicHeadersPath: "Source/Public",
  577. cSettings: [
  578. .headerSearchPath("../"),
  579. .headerSearchPath("Source/Public/FirebaseFirestore"),
  580. .headerSearchPath("Protos/nanopb"),
  581. .define("PB_FIELD_32BIT", to: "1"),
  582. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  583. .define("PB_ENABLE_MALLOC", to: "1"),
  584. .define("FIRFirestore_VERSION", to: firebaseVersion),
  585. ],
  586. linkerSettings: [
  587. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  588. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  589. .linkedLibrary("c++"),
  590. ]
  591. ),
  592. .target(
  593. name: "FirebaseFirestoreSwiftTarget",
  594. dependencies: [.target(name: "FirebaseFirestoreSwift",
  595. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  596. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  597. ),
  598. .target(
  599. name: "FirebaseFirestoreSwift",
  600. dependencies: ["FirebaseFirestore"],
  601. path: "Firestore",
  602. exclude: [
  603. "CHANGELOG.md",
  604. "CMakeLists.txt",
  605. "Example/",
  606. "Protos/",
  607. "README.md",
  608. "Source/",
  609. "core/",
  610. "fuzzing/",
  611. "test.sh",
  612. "Swift/CHANGELOG.md",
  613. "Swift/README.md",
  614. "Swift/Tests/",
  615. "third_party/nlohmann_json",
  616. "third_party/FirestoreEncoder/LICENSE",
  617. "third_party/FirestoreEncoder/METADATA",
  618. ],
  619. sources: [
  620. "Swift/Source/",
  621. "third_party/FirestoreEncoder/",
  622. ]
  623. ),
  624. // MARK: Firebase Functions
  625. .target(
  626. name: "FirebaseFunctionsTarget",
  627. dependencies: [.target(name: "FirebaseFunctions",
  628. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  629. path: "SwiftPM-PlatformExclude/FirebaseFunctionsWrap"
  630. ),
  631. .target(
  632. name: "FirebaseFunctions",
  633. dependencies: [
  634. "FirebaseCore",
  635. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  636. ],
  637. path: "Functions/FirebaseFunctions",
  638. publicHeadersPath: "Public",
  639. cSettings: [
  640. .headerSearchPath("../../"),
  641. ]
  642. ),
  643. .target(
  644. name: "FirebaseFunctionsCombineSwift",
  645. dependencies: ["FirebaseFunctions"],
  646. path: "FirebaseCombineSwift/Sources/Functions"
  647. ),
  648. .testTarget(
  649. name: "FunctionsCombineUnit",
  650. dependencies: ["FirebaseFunctionsCombineSwift",
  651. "FirebaseFunctionsTestingSupport",
  652. "SharedTestUtilities"],
  653. path: "Functions/Tests/CombineUnit"
  654. ),
  655. .target(
  656. name: "FirebaseFunctionsTestingSupport",
  657. dependencies: ["FirebaseFunctions"],
  658. path: "FirebaseTestingSupport/Functions/Sources",
  659. publicHeadersPath: "Public",
  660. cSettings: [
  661. .headerSearchPath("../../.."),
  662. ]
  663. ),
  664. .target(
  665. name: "FirebaseInAppMessagingTarget",
  666. dependencies: [
  667. .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
  668. ],
  669. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  670. ),
  671. .target(
  672. name: "FirebaseInAppMessaging",
  673. dependencies: [
  674. "FirebaseCore",
  675. "FirebaseInstallations",
  676. "FirebaseABTesting",
  677. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  678. .product(name: "nanopb", package: "nanopb"),
  679. .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
  680. ],
  681. path: "FirebaseInAppMessaging/Sources",
  682. exclude: [
  683. "DefaultUI/CHANGELOG.md",
  684. "DefaultUI/README.md",
  685. ],
  686. publicHeadersPath: "Public",
  687. cSettings: [
  688. .headerSearchPath("../../"),
  689. .define("PB_FIELD_32BIT", to: "1"),
  690. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  691. .define("PB_ENABLE_MALLOC", to: "1"),
  692. ]
  693. ),
  694. .target(
  695. name: "FirebaseInAppMessaging_iOS",
  696. path: "FirebaseInAppMessaging/iOS",
  697. resources: [.process("Resources")]
  698. ),
  699. .target(
  700. name: "FirebaseInAppMessagingSwift",
  701. dependencies: ["FirebaseInAppMessaging"],
  702. path: "FirebaseInAppMessaging/Swift/Source"
  703. ),
  704. .target(
  705. name: "FirebaseInstallations",
  706. dependencies: [
  707. "FirebaseCore",
  708. .product(name: "FBLPromises", package: "Promises"),
  709. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  710. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  711. ],
  712. path: "FirebaseInstallations/Source/Library",
  713. publicHeadersPath: "Public",
  714. cSettings: [
  715. .headerSearchPath("../../../"),
  716. ],
  717. linkerSettings: [
  718. .linkedFramework("Security"),
  719. ]
  720. ),
  721. .target(
  722. name: "FirebaseMLModelDownloader",
  723. dependencies: [
  724. "FirebaseCore",
  725. "FirebaseInstallations",
  726. .product(name: "GULLogger", package: "GoogleUtilities"),
  727. "SwiftProtobuf",
  728. ],
  729. path: "FirebaseMLModelDownloader/Sources",
  730. exclude: [
  731. "proto/firebase_ml_log_sdk.proto",
  732. ],
  733. cSettings: [
  734. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  735. ]
  736. ),
  737. .testTarget(
  738. name: "FirebaseMLModelDownloaderUnit",
  739. dependencies: ["FirebaseMLModelDownloader"],
  740. path: "FirebaseMLModelDownloader/Tests/Unit"
  741. ),
  742. .target(
  743. name: "FirebaseMessaging",
  744. dependencies: [
  745. "FirebaseCore",
  746. "FirebaseInstallations",
  747. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  748. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  749. .product(name: "GULReachability", package: "GoogleUtilities"),
  750. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  751. ],
  752. path: "FirebaseMessaging/Sources",
  753. publicHeadersPath: "Public",
  754. cSettings: [
  755. .headerSearchPath("../../"),
  756. ],
  757. linkerSettings: [
  758. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  759. ]
  760. ),
  761. .testTarget(
  762. name: "MessagingUnit",
  763. dependencies: ["FirebaseMessaging", "SharedTestUtilities", "OCMock"],
  764. path: "FirebaseMessaging/Tests/UnitTests",
  765. exclude: [
  766. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  767. ],
  768. cSettings: [
  769. .headerSearchPath("../../.."),
  770. ]
  771. ),
  772. .target(
  773. name: "SharedTestUtilities",
  774. dependencies: ["FirebaseCore", "OCMock"],
  775. path: "SharedTestUtilities",
  776. publicHeadersPath: "./",
  777. cSettings: [
  778. .headerSearchPath("../"),
  779. ]
  780. ),
  781. .target(
  782. name: "FirebaseRemoteConfig",
  783. dependencies: [
  784. "FirebaseCore",
  785. "FirebaseABTesting",
  786. "FirebaseInstallations",
  787. .product(name: "GULNSData", package: "GoogleUtilities"),
  788. ],
  789. path: "FirebaseRemoteConfig/Sources",
  790. publicHeadersPath: "Public",
  791. cSettings: [
  792. .headerSearchPath("../../"),
  793. ]
  794. ),
  795. .testTarget(
  796. name: "RemoteConfigUnit",
  797. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  798. path: "FirebaseRemoteConfig/Tests/Unit",
  799. exclude: [
  800. // Need to be evaluated/ported to RC V2.
  801. "RCNConfigAnalyticsTest.m",
  802. "RCNConfigSettingsTest.m",
  803. "RCNConfigTest.m",
  804. "RCNRemoteConfig+FIRAppTest.m",
  805. "RCNThrottlingTests.m",
  806. ],
  807. resources: [
  808. .process("SecondApp-GoogleService-Info.plist"),
  809. .process("Defaults-testInfo.plist"),
  810. .process("TestABTPayload.txt"),
  811. ],
  812. cSettings: [
  813. .headerSearchPath("../../.."),
  814. ]
  815. ),
  816. .target(
  817. name: "FirebaseStorage",
  818. dependencies: [
  819. "FirebaseCore",
  820. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  821. ],
  822. path: "FirebaseStorage/Sources",
  823. publicHeadersPath: "Public",
  824. cSettings: [
  825. .headerSearchPath("../../"),
  826. ],
  827. linkerSettings: [
  828. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS])),
  829. .linkedFramework("CoreServices", .when(platforms: [.macOS])),
  830. ]
  831. ),
  832. .testTarget(
  833. name: "StorageUnit",
  834. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  835. path: "FirebaseStorage/Tests/Unit",
  836. cSettings: [
  837. .headerSearchPath("../../.."),
  838. ]
  839. ),
  840. .target(
  841. name: "FirebaseStorageSwift",
  842. dependencies: ["FirebaseStorage"],
  843. path: "FirebaseStorageSwift/Sources"
  844. ),
  845. .testTarget(
  846. name: "swift-test",
  847. dependencies: [
  848. "FirebaseAuth",
  849. "FirebaseABTesting",
  850. .target(name: "FirebaseAppDistribution",
  851. condition: .when(platforms: [.iOS])),
  852. "Firebase",
  853. "FirebaseCombineSwift",
  854. "FirebaseCrashlytics",
  855. "FirebaseCore",
  856. "FirebaseDatabase",
  857. "FirebaseDynamicLinks",
  858. "FirebaseFirestore",
  859. "FirebaseFirestoreSwift",
  860. "FirebaseFunctions",
  861. "FirebaseInAppMessaging",
  862. .target(name: "FirebaseInAppMessagingSwift",
  863. condition: .when(platforms: [.iOS, .tvOS])),
  864. "FirebaseInstallations",
  865. "FirebaseMessaging",
  866. "FirebaseRemoteConfig",
  867. "FirebaseStorage",
  868. "FirebaseStorageSwift",
  869. .product(name: "nanopb", package: "nanopb"),
  870. ],
  871. path: "SwiftPMTests/swift-test"
  872. ),
  873. .testTarget(
  874. name: "analytics-import-test",
  875. dependencies: [
  876. "FirebaseAnalyticsSwiftTarget",
  877. "FirebaseAnalyticsWrapper",
  878. "Firebase",
  879. ],
  880. path: "SwiftPMTests/analytics-import-test"
  881. ),
  882. .testTarget(
  883. name: "objc-import-test",
  884. dependencies: [
  885. "FirebaseAuth",
  886. "FirebaseABTesting",
  887. .target(name: "FirebaseAppDistribution",
  888. condition: .when(platforms: [.iOS])),
  889. "Firebase",
  890. "FirebaseCrashlytics",
  891. "FirebaseCore",
  892. "FirebaseDatabase",
  893. "FirebaseDynamicLinks",
  894. "FirebaseFirestore",
  895. "FirebaseFunctions",
  896. "FirebaseInAppMessaging",
  897. "FirebaseInstallations",
  898. "FirebaseMessaging",
  899. "FirebaseRemoteConfig",
  900. "FirebaseStorage",
  901. ],
  902. path: "SwiftPMTests/objc-import-test"
  903. ),
  904. .testTarget(
  905. name: "version-test",
  906. dependencies: [
  907. "FirebaseCore",
  908. ],
  909. path: "SwiftPMTests/version-test",
  910. cSettings: [
  911. .define("FIR_VERSION", to: firebaseVersion),
  912. ]
  913. ),
  914. // MARK: - Firebase App Check
  915. .target(name: "FirebaseAppCheck",
  916. dependencies: [
  917. "FirebaseCore",
  918. .product(name: "FBLPromises", package: "Promises"),
  919. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  920. ],
  921. path: "FirebaseAppCheck/Sources",
  922. publicHeadersPath: "Public",
  923. cSettings: [
  924. .headerSearchPath("../.."),
  925. ],
  926. linkerSettings: [
  927. .linkedFramework("DeviceCheck"),
  928. ]),
  929. .testTarget(
  930. name: "AppCheckUnit",
  931. dependencies: ["FirebaseAppCheck", "OCMock", "SharedTestUtilities"],
  932. path: "FirebaseAppCheck/Tests",
  933. exclude: [
  934. // Disable Swift tests as mixed targets are not supported (Xcode 12.3).
  935. "Unit/Swift",
  936. // Disable Keychain dependent tests as they require a host application on iOS.
  937. "Integration",
  938. "Unit/Core/FIRAppCheckIntegrationTests.m",
  939. "Unit/Core/FIRAppCheckStorageTests.m",
  940. ],
  941. resources: [
  942. .process("Fixture"),
  943. ],
  944. cSettings: [
  945. .headerSearchPath("../.."),
  946. ]
  947. ),
  948. .testTarget(
  949. name: "AppCheckUnitSwift",
  950. dependencies: ["FirebaseAppCheck"],
  951. path: "FirebaseAppCheck/Tests/Unit/Swift",
  952. cSettings: [
  953. .headerSearchPath("../.."),
  954. ]
  955. ),
  956. // MARK: Testing support
  957. .target(
  958. name: "FirebaseFirestoreTestingSupport",
  959. dependencies: ["FirebaseFirestore"],
  960. path: "FirebaseTestingSupport/Firestore/Sources",
  961. publicHeadersPath: "./",
  962. cSettings: [
  963. .headerSearchPath("../../.."),
  964. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  965. ]
  966. ),
  967. .testTarget(
  968. name: "FirestoreTestingSupportTests",
  969. dependencies: ["FirebaseFirestoreTestingSupport"],
  970. path: "FirebaseTestingSupport/Firestore/Tests",
  971. cSettings: [
  972. .headerSearchPath("../../.."),
  973. ]
  974. ),
  975. ],
  976. cLanguageStandard: .c99,
  977. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  978. )