Package.swift 31 KB

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