Package.swift 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567
  1. // swift-tools-version:5.7.1
  2. // The swift-tools-version declares the minimum version of Swift required to
  3. // build this package.
  4. // Copyright 2020 Google LLC
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License");
  7. // you may not use this file except in compliance with the License.
  8. // You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. import class Foundation.ProcessInfo
  18. import PackageDescription
  19. let firebaseVersion = "10.23.0"
  20. let package = Package(
  21. name: "Firebase",
  22. platforms: [.iOS(.v11), .macCatalyst(.v13), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v7)],
  23. products: [
  24. .library(
  25. name: "FirebaseABTesting",
  26. targets: ["FirebaseABTesting"]
  27. ),
  28. .library(
  29. name: "FirebaseAnalytics",
  30. targets: ["FirebaseAnalyticsTarget"]
  31. ),
  32. // Adding this library to your project is enough for it to take effect. The module
  33. // does not need to be imported into any source files.
  34. .library(
  35. name: "FirebaseAnalyticsWithoutAdIdSupport",
  36. targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"]
  37. ),
  38. // Adding this library to your project is enough for it to take effect. The module
  39. // does not need to be imported into any source files.
  40. .library(
  41. name: "FirebaseAnalyticsOnDeviceConversion",
  42. targets: ["FirebaseAnalyticsOnDeviceConversionTarget"]
  43. ),
  44. .library(
  45. name: "FirebaseAnalyticsSwift",
  46. targets: ["FirebaseAnalyticsSwiftTarget"]
  47. ),
  48. .library(
  49. name: "FirebaseAuth",
  50. targets: ["FirebaseAuth"]
  51. ),
  52. .library(
  53. name: "FirebaseAppCheck",
  54. targets: ["FirebaseAppCheck"]
  55. ),
  56. .library(
  57. name: "FirebaseAppDistribution-Beta",
  58. targets: ["FirebaseAppDistributionTarget"]
  59. ),
  60. .library(
  61. name: "FirebaseAuthCombine-Community",
  62. targets: ["FirebaseAuthCombineSwift"]
  63. ),
  64. .library(
  65. name: "FirebaseFirestoreCombine-Community",
  66. targets: ["FirebaseFirestoreCombineSwift"]
  67. ),
  68. .library(
  69. name: "FirebaseFunctionsCombine-Community",
  70. targets: ["FirebaseFunctionsCombineSwift"]
  71. ),
  72. .library(
  73. name: "FirebaseStorageCombine-Community",
  74. targets: ["FirebaseStorageCombineSwift"]
  75. ),
  76. .library(
  77. name: "FirebaseCrashlytics",
  78. targets: ["FirebaseCrashlytics"]
  79. ),
  80. .library(
  81. name: "FirebaseDatabase",
  82. targets: ["FirebaseDatabase"]
  83. ),
  84. .library(
  85. name: "FirebaseDatabaseSwift",
  86. targets: ["FirebaseDatabaseSwift"]
  87. ),
  88. .library(
  89. name: "FirebaseDynamicLinks",
  90. targets: ["FirebaseDynamicLinksTarget"]
  91. ),
  92. .library(
  93. name: "FirebaseFirestore",
  94. targets: ["FirebaseFirestoreTarget"]
  95. ),
  96. .library(
  97. name: "FirebaseFirestoreSwift",
  98. targets: ["FirebaseFirestoreSwiftTarget"]
  99. ),
  100. .library(
  101. name: "FirebaseFunctions",
  102. targets: ["FirebaseFunctions"]
  103. ),
  104. .library(
  105. name: "FirebaseInAppMessaging-Beta",
  106. targets: ["FirebaseInAppMessagingTarget"]
  107. ),
  108. .library(
  109. name: "FirebaseInAppMessagingSwift-Beta",
  110. targets: ["FirebaseInAppMessagingSwift"]
  111. ),
  112. .library(
  113. name: "FirebaseInstallations",
  114. targets: ["FirebaseInstallations"]
  115. ),
  116. .library(
  117. name: "FirebaseMessaging",
  118. targets: ["FirebaseMessaging"]
  119. ),
  120. .library(
  121. name: "FirebaseMLModelDownloader",
  122. targets: ["FirebaseMLModelDownloader"]
  123. ),
  124. .library(
  125. name: "FirebasePerformance",
  126. targets: ["FirebasePerformanceTarget"]
  127. ),
  128. .library(
  129. name: "FirebaseRemoteConfig",
  130. targets: ["FirebaseRemoteConfig"]
  131. ),
  132. .library(
  133. name: "FirebaseRemoteConfigSwift",
  134. targets: ["FirebaseRemoteConfigSwift"]
  135. ),
  136. .library(
  137. name: "FirebaseStorage",
  138. targets: ["FirebaseStorage"]
  139. ),
  140. ],
  141. dependencies: [
  142. .package(
  143. url: "https://github.com/google/promises.git",
  144. "2.1.0" ..< "3.0.0"
  145. ),
  146. .package(
  147. url: "https://github.com/apple/swift-protobuf.git",
  148. "1.19.0" ..< "2.0.0"
  149. ),
  150. googleAppMeasurementDependency(),
  151. .package(
  152. url: "https://github.com/google/GoogleDataTransport.git",
  153. "9.3.0" ..< "10.0.0"
  154. ),
  155. .package(
  156. url: "https://github.com/google/GoogleUtilities.git",
  157. "7.12.1" ..< "8.0.0"
  158. ),
  159. .package(
  160. url: "https://github.com/google/gtm-session-fetcher.git",
  161. "2.1.0" ..< "4.0.0"
  162. ),
  163. .package(
  164. url: "https://github.com/firebase/nanopb.git",
  165. "2.30909.0" ..< "2.30911.0"
  166. ),
  167. abseilDependency(),
  168. grpcDependency(),
  169. .package(
  170. url: "https://github.com/erikdoe/ocmock.git",
  171. revision: "c5eeaa6dde7c308a5ce48ae4d4530462dd3a1110"
  172. ),
  173. .package(
  174. url: "https://github.com/firebase/leveldb.git",
  175. "1.22.2" ..< "1.23.0"
  176. ),
  177. .package(
  178. url: "https://github.com/SlaunchaMan/GCDWebServer.git",
  179. revision: "935e2736044e71e5341663c3cc9a335ba6867a2b"
  180. ),
  181. .package(
  182. url: "https://github.com/google/interop-ios-for-google-sdks.git",
  183. "100.0.0" ..< "101.0.0"
  184. ),
  185. .package(url: "https://github.com/google/app-check.git", "10.18.0" ..< "11.0.0"),
  186. ],
  187. targets: [
  188. .target(
  189. name: "Firebase",
  190. path: "CoreOnly/Sources",
  191. publicHeadersPath: "./"
  192. ),
  193. .target(
  194. name: "FirebaseCore",
  195. dependencies: [
  196. "Firebase",
  197. "FirebaseCoreInternal",
  198. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  199. .product(name: "GULLogger", package: "GoogleUtilities"),
  200. ],
  201. path: "FirebaseCore/Sources",
  202. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  203. publicHeadersPath: "Public",
  204. cSettings: [
  205. .headerSearchPath("../.."),
  206. .define("Firebase_VERSION", to: firebaseVersion),
  207. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  208. ],
  209. linkerSettings: [
  210. .linkedFramework("UIKit", .when(platforms: [.iOS, .macCatalyst, .tvOS])),
  211. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  212. ]
  213. ),
  214. .testTarget(
  215. name: "CoreUnit",
  216. dependencies: [
  217. "FirebaseCore",
  218. "SharedTestUtilities",
  219. .product(name: "OCMock", package: "ocmock"),
  220. ],
  221. path: "FirebaseCore/Tests/Unit",
  222. exclude: ["Resources/GoogleService-Info.plist"],
  223. cSettings: [
  224. .headerSearchPath("../../.."),
  225. ]
  226. ),
  227. // MARK: - Firebase Core Extension
  228. // Extension of FirebaseCore for consuming by Swift product SDKs.
  229. // When depending on `FirebaseCoreExtension`, also depend on `FirebaseCore`
  230. // to avoid potential linker issues.
  231. .target(
  232. name: "FirebaseCoreExtension",
  233. path: "FirebaseCore/Extension",
  234. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  235. publicHeadersPath: ".",
  236. cSettings: [
  237. .headerSearchPath("../../"),
  238. ]
  239. ),
  240. // MARK: - Firebase Core Internal
  241. // Shared collection of APIs for internal FirebaseCore usage.
  242. .target(
  243. name: "FirebaseCoreInternal",
  244. dependencies: [
  245. .product(name: "GULNSData", package: "GoogleUtilities"),
  246. ],
  247. path: "FirebaseCore/Internal/Sources",
  248. resources: [.process("Resources/PrivacyInfo.xcprivacy")]
  249. ),
  250. .testTarget(
  251. name: "FirebaseCoreInternalTests",
  252. dependencies: [
  253. "FirebaseCoreInternal",
  254. ],
  255. path: "FirebaseCore/Internal/Tests"
  256. ),
  257. .target(
  258. name: "FirebaseABTesting",
  259. dependencies: ["FirebaseCore"],
  260. path: "FirebaseABTesting/Sources",
  261. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  262. publicHeadersPath: "Public",
  263. cSettings: [
  264. .headerSearchPath("../../"),
  265. ]
  266. ),
  267. .testTarget(
  268. name: "ABTestingUnit",
  269. dependencies: ["FirebaseABTesting", .product(name: "OCMock", package: "ocmock")],
  270. path: "FirebaseABTesting/Tests/Unit",
  271. resources: [.process("Resources")],
  272. cSettings: [
  273. .headerSearchPath("../../.."),
  274. ]
  275. ),
  276. .target(
  277. name: "FirebaseAnalyticsTarget",
  278. dependencies: [.target(name: "FirebaseAnalyticsWrapper",
  279. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  280. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
  281. ),
  282. .target(
  283. name: "FirebaseAnalyticsWrapper",
  284. dependencies: [
  285. .target(
  286. name: "FirebaseAnalytics",
  287. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  288. ),
  289. .product(name: "GoogleAppMeasurement",
  290. package: "GoogleAppMeasurement",
  291. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
  292. "FirebaseCore",
  293. "FirebaseInstallations",
  294. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  295. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  296. .product(name: "GULNSData", package: "GoogleUtilities"),
  297. .product(name: "GULNetwork", package: "GoogleUtilities"),
  298. .product(name: "nanopb", package: "nanopb"),
  299. ],
  300. path: "FirebaseAnalyticsWrapper",
  301. linkerSettings: [
  302. .linkedLibrary("sqlite3"),
  303. .linkedLibrary("c++"),
  304. .linkedLibrary("z"),
  305. .linkedFramework("StoreKit"),
  306. ]
  307. ),
  308. .binaryTarget(
  309. name: "FirebaseAnalytics",
  310. url: "https://dl.google.com/firebase/ios/swiftpm/10.22.0/FirebaseAnalytics-rc1.zip",
  311. checksum: "78ce96a59962a8946f5df8dd57c7d0d83fd3cf0e14f3efab65c8c65fbdf03a8a"
  312. ),
  313. .target(
  314. name: "FirebaseAnalyticsSwiftTarget",
  315. dependencies: [.target(name: "FirebaseAnalyticsSwift",
  316. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  317. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
  318. ),
  319. .target(
  320. name: "FirebaseAnalyticsSwift",
  321. dependencies: ["FirebaseAnalyticsWrapper"],
  322. path: "FirebaseAnalyticsSwift/Sources"
  323. ),
  324. .testTarget(
  325. name: "AnalyticsSwiftUnit",
  326. dependencies: ["FirebaseAnalyticsSwift"],
  327. path: "FirebaseAnalyticsSwift/Tests/SwiftUnit"
  328. ),
  329. .testTarget(
  330. name: "AnalyticsObjCAPI",
  331. dependencies: ["FirebaseAnalyticsSwift"],
  332. path: "FirebaseAnalyticsSwift/Tests/ObjCAPI"
  333. ),
  334. .target(
  335. name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
  336. dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  337. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  338. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
  339. ),
  340. .target(
  341. name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  342. dependencies: [
  343. .target(
  344. name: "FirebaseAnalytics",
  345. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  346. ),
  347. .product(name: "GoogleAppMeasurementWithoutAdIdSupport",
  348. package: "GoogleAppMeasurement",
  349. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
  350. "FirebaseCore",
  351. "FirebaseInstallations",
  352. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  353. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  354. .product(name: "GULNSData", package: "GoogleUtilities"),
  355. .product(name: "GULNetwork", package: "GoogleUtilities"),
  356. .product(name: "nanopb", package: "nanopb"),
  357. ],
  358. path: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  359. linkerSettings: [
  360. .linkedLibrary("sqlite3"),
  361. .linkedLibrary("c++"),
  362. .linkedLibrary("z"),
  363. .linkedFramework("StoreKit"),
  364. ]
  365. ),
  366. .target(
  367. name: "FirebaseAnalyticsOnDeviceConversionTarget",
  368. dependencies: [
  369. .product(name: "GoogleAppMeasurementOnDeviceConversion",
  370. package: "GoogleAppMeasurement",
  371. condition: .when(platforms: [.iOS])),
  372. ],
  373. path: "FirebaseAnalyticsOnDeviceConversionWrapper",
  374. linkerSettings: [
  375. .linkedLibrary("c++"),
  376. ]
  377. ),
  378. .target(
  379. name: "FirebaseAppDistributionTarget",
  380. dependencies: [.target(name: "FirebaseAppDistribution",
  381. condition: .when(platforms: [.iOS]))],
  382. path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
  383. ),
  384. .target(
  385. name: "FirebaseAppDistribution",
  386. dependencies: [
  387. "FirebaseCore",
  388. "FirebaseInstallations",
  389. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  390. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  391. ],
  392. path: "FirebaseAppDistribution/Sources",
  393. publicHeadersPath: "Public",
  394. cSettings: [
  395. .headerSearchPath("../../"),
  396. ]
  397. ),
  398. .testTarget(
  399. name: "AppDistributionUnit",
  400. dependencies: ["FirebaseAppDistribution", .product(name: "OCMock", package: "ocmock")],
  401. path: "FirebaseAppDistribution/Tests/Unit",
  402. exclude: ["Swift/"],
  403. resources: [.process("Resources")],
  404. cSettings: [
  405. .headerSearchPath("../../.."),
  406. ]
  407. ),
  408. .testTarget(
  409. name: "AppDistributionUnitSwift",
  410. dependencies: ["FirebaseAppDistribution"],
  411. path: "FirebaseAppDistribution/Tests/Unit/Swift",
  412. cSettings: [
  413. .headerSearchPath("../../../.."),
  414. ]
  415. ),
  416. .target(
  417. name: "FirebaseAuth",
  418. dependencies: [
  419. "FirebaseAppCheckInterop",
  420. "FirebaseCore",
  421. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  422. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  423. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  424. .product(name: "RecaptchaInterop", package: "interop-ios-for-google-sdks"),
  425. ],
  426. path: "FirebaseAuth/Sources",
  427. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  428. publicHeadersPath: "Public",
  429. cSettings: [
  430. .headerSearchPath("../../"),
  431. ],
  432. linkerSettings: [
  433. .linkedFramework("Security"),
  434. .linkedFramework("SafariServices", .when(platforms: [.iOS])),
  435. ]
  436. ),
  437. // Internal headers only for consuming from Swift.
  438. .target(
  439. name: "FirebaseAuthInterop",
  440. path: "FirebaseAuth/Interop",
  441. exclude: [
  442. "CMakeLists.txt",
  443. ],
  444. publicHeadersPath: ".",
  445. cSettings: [
  446. .headerSearchPath("../../"),
  447. ]
  448. ),
  449. .testTarget(
  450. name: "AuthUnit",
  451. dependencies: [
  452. "FirebaseAuth",
  453. .product(name: "OCMock", package: "ocmock"),
  454. ],
  455. path: "FirebaseAuth/Tests/Unit",
  456. exclude: [
  457. "FIRAuthKeychainServicesTests.m", // TODO: figure out SPM keychain testing
  458. "FIRAuthTests.m",
  459. "FIRUserTests.m",
  460. "SwiftAPI.swift", // Only builds via CocoaPods testing until Swift source update.
  461. "SwiftGlobalTests.swift", // Only builds via CocoaPods testing until Swift source update.
  462. ],
  463. cSettings: [
  464. .headerSearchPath("../../.."),
  465. ]
  466. ),
  467. .target(
  468. name: "FirebaseAuthCombineSwift",
  469. dependencies: ["FirebaseAuth"],
  470. path: "FirebaseCombineSwift/Sources/Auth"
  471. ),
  472. .target(
  473. name: "FirebaseFirestoreCombineSwift",
  474. dependencies: [
  475. "FirebaseFirestoreTarget",
  476. "FirebaseFirestoreSwift",
  477. ],
  478. path: "FirebaseCombineSwift/Sources/Firestore"
  479. ),
  480. .target(
  481. name: "FirebaseStorageCombineSwift",
  482. dependencies: [
  483. "FirebaseStorage",
  484. ],
  485. path: "FirebaseCombineSwift/Sources/Storage"
  486. ),
  487. .target(
  488. name: "FirebaseCrashlytics",
  489. dependencies: ["FirebaseCore", "FirebaseInstallations", "FirebaseSessions",
  490. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  491. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  492. .product(name: "FBLPromises", package: "Promises"),
  493. .product(name: "nanopb", package: "nanopb")],
  494. path: "Crashlytics",
  495. exclude: [
  496. "run",
  497. "CHANGELOG.md",
  498. "LICENSE",
  499. "README.md",
  500. "ProtoSupport/",
  501. "UnitTests/",
  502. "generate_project.sh",
  503. "upload-symbols",
  504. "CrashlyticsInputFiles.xcfilelist",
  505. "third_party/libunwind/LICENSE",
  506. ],
  507. sources: [
  508. "Crashlytics/",
  509. "Protogen/",
  510. "Shared/",
  511. "third_party/libunwind/dwarf.h",
  512. ],
  513. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  514. publicHeadersPath: "Crashlytics/Public",
  515. cSettings: [
  516. .headerSearchPath(".."),
  517. .define("DISPLAY_VERSION", to: firebaseVersion),
  518. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  519. .define(
  520. "CLS_SDK_NAME",
  521. to: "Crashlytics macOS SDK",
  522. .when(platforms: [.macOS, .macCatalyst])
  523. ),
  524. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  525. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  526. .define("PB_FIELD_32BIT", to: "1"),
  527. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  528. .define("PB_ENABLE_MALLOC", to: "1"),
  529. ],
  530. linkerSettings: [
  531. .linkedFramework("Security"),
  532. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  533. ]
  534. ),
  535. .testTarget(
  536. name: "FirebaseCrashlyticsUnit",
  537. dependencies: ["FirebaseCrashlytics", .product(name: "OCMock", package: "ocmock")],
  538. path: "Crashlytics/UnitTests",
  539. resources: [
  540. .copy("FIRCLSMachO/machO_data"),
  541. .copy("Data"),
  542. ],
  543. cSettings: [
  544. .headerSearchPath("../.."),
  545. .define("DISPLAY_VERSION", to: firebaseVersion),
  546. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  547. .define(
  548. "CLS_SDK_NAME",
  549. to: "Crashlytics macOS SDK",
  550. .when(platforms: [.macOS, .macCatalyst])
  551. ),
  552. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  553. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  554. ]
  555. ),
  556. .target(
  557. name: "FirebaseDatabaseInternal",
  558. dependencies: [
  559. "FirebaseAppCheckInterop",
  560. "FirebaseCore",
  561. "leveldb",
  562. ],
  563. path: "FirebaseDatabase/Sources",
  564. exclude: [
  565. "third_party/Wrap-leveldb/LICENSE",
  566. "third_party/SocketRocket/LICENSE",
  567. "third_party/FImmutableSortedDictionary/LICENSE",
  568. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  569. ],
  570. publicHeadersPath: "Public",
  571. cSettings: [
  572. .headerSearchPath("../../"),
  573. ],
  574. linkerSettings: [
  575. .linkedFramework("CFNetwork"),
  576. .linkedFramework("Security"),
  577. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  578. .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
  579. ]
  580. ),
  581. .testTarget(
  582. name: "DatabaseUnit",
  583. dependencies: [
  584. "FirebaseDatabase",
  585. "SharedTestUtilities",
  586. .product(name: "OCMock", package: "ocmock"),
  587. ],
  588. path: "FirebaseDatabase/Tests/",
  589. exclude: [
  590. // Disable Swift tests as mixed targets are not supported (Xcode 12.4).
  591. "Unit/Swift",
  592. "Integration/",
  593. ],
  594. resources: [.process("Resources")],
  595. cSettings: [
  596. .headerSearchPath("../.."),
  597. ]
  598. ),
  599. .testTarget(
  600. name: "DatabaseUnitSwift",
  601. dependencies: ["FirebaseDatabase"],
  602. path: "FirebaseDatabase/Tests/Unit/Swift",
  603. cSettings: [
  604. .headerSearchPath("../.."),
  605. ]
  606. ),
  607. .target(
  608. name: "FirebaseDatabase",
  609. dependencies: ["FirebaseDatabaseInternal", "FirebaseSharedSwift"],
  610. path: "FirebaseDatabase/Swift/Sources"
  611. ),
  612. .target(
  613. name: "FirebaseDatabaseSwift",
  614. dependencies: ["FirebaseDatabase"],
  615. path: "FirebaseDatabaseSwift/Sources"
  616. ),
  617. .testTarget(
  618. name: "FirebaseDatabaseSwiftTests",
  619. dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
  620. path: "FirebaseDatabaseSwift/Tests/"
  621. ),
  622. .target(
  623. name: "FirebaseSharedSwift",
  624. path: "FirebaseSharedSwift/Sources",
  625. exclude: [
  626. "third_party/FirebaseDataEncoder/LICENSE",
  627. "third_party/FirebaseDataEncoder/METADATA",
  628. ]
  629. ),
  630. .testTarget(
  631. name: "FirebaseSharedSwiftTests",
  632. dependencies: ["FirebaseSharedSwift"],
  633. path: "FirebaseSharedSwift/Tests/"
  634. ),
  635. .target(
  636. name: "FirebaseDynamicLinksTarget",
  637. dependencies: [.target(name: "FirebaseDynamicLinks",
  638. condition: .when(platforms: [.iOS]))],
  639. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  640. ),
  641. .target(
  642. name: "FirebaseDynamicLinks",
  643. dependencies: ["FirebaseCore"],
  644. path: "FirebaseDynamicLinks/Sources",
  645. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  646. publicHeadersPath: "Public",
  647. cSettings: [
  648. .headerSearchPath("../../"),
  649. .define("FIRDynamicLinks3P", to: "1"),
  650. .define("GIN_SCION_LOGGING", to: "1"),
  651. ],
  652. linkerSettings: [
  653. .linkedFramework("QuartzCore"),
  654. ]
  655. ),
  656. firestoreWrapperTarget(),
  657. .target(
  658. name: "FirebaseFirestoreSwiftTarget",
  659. dependencies: [.target(name: "FirebaseFirestoreSwift",
  660. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS,
  661. .firebaseVisionOS]))],
  662. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  663. ),
  664. .target(
  665. name: "FirebaseFirestoreSwift",
  666. dependencies: [
  667. "FirebaseFirestoreTarget",
  668. ],
  669. path: "FirebaseFirestoreSwift/Sources"
  670. ),
  671. // MARK: - Firebase Functions
  672. .target(
  673. name: "FirebaseFunctions",
  674. dependencies: [
  675. "FirebaseAppCheckInterop",
  676. "FirebaseAuthInterop",
  677. "FirebaseCore",
  678. "FirebaseCoreExtension",
  679. "FirebaseMessagingInterop",
  680. "FirebaseSharedSwift",
  681. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  682. ],
  683. path: "FirebaseFunctions/Sources"
  684. ),
  685. .testTarget(
  686. name: "FirebaseFunctionsUnit",
  687. dependencies: ["FirebaseFunctions",
  688. "FirebaseAppCheckInterop",
  689. "FirebaseAuthInterop",
  690. "FirebaseMessagingInterop",
  691. "SharedTestUtilities"],
  692. path: "FirebaseFunctions/Tests/Unit",
  693. cSettings: [
  694. .headerSearchPath("../../../"),
  695. ]
  696. ),
  697. .testTarget(
  698. name: "FirebaseFunctionsIntegration",
  699. dependencies: ["FirebaseFunctions",
  700. "SharedTestUtilities"],
  701. path: "FirebaseFunctions/Tests/Integration"
  702. ),
  703. .testTarget(
  704. name: "FirebaseFunctionsObjCIntegration",
  705. dependencies: ["FirebaseFunctions",
  706. "SharedTestUtilities"],
  707. path: "FirebaseFunctions/Tests/ObjCIntegration",
  708. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  709. exclude: [
  710. "ObjCPPAPITests.mm",
  711. ],
  712. cSettings: [
  713. .headerSearchPath("../../.."),
  714. ]
  715. ),
  716. .target(
  717. name: "FirebaseFunctionsCombineSwift",
  718. dependencies: ["FirebaseFunctions"],
  719. path: "FirebaseCombineSwift/Sources/Functions"
  720. ),
  721. .testTarget(
  722. name: "FunctionsCombineUnit",
  723. dependencies: ["FirebaseFunctionsCombineSwift",
  724. "SharedTestUtilities"],
  725. path: "FirebaseFunctions/Tests/CombineUnit"
  726. ),
  727. // MARK: - Firebase In App Messaging
  728. .target(
  729. name: "FirebaseInAppMessagingTarget",
  730. dependencies: [
  731. .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
  732. ],
  733. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  734. ),
  735. .target(
  736. name: "FirebaseInAppMessagingInternal",
  737. dependencies: [
  738. "FirebaseCore",
  739. "FirebaseInstallations",
  740. "FirebaseABTesting",
  741. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  742. .product(name: "nanopb", package: "nanopb"),
  743. .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
  744. ],
  745. path: "FirebaseInAppMessaging/Sources",
  746. exclude: [
  747. "DefaultUI/CHANGELOG.md",
  748. "DefaultUI/README.md",
  749. ],
  750. publicHeadersPath: "Public",
  751. cSettings: [
  752. .headerSearchPath("../../"),
  753. .define("PB_FIELD_32BIT", to: "1"),
  754. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  755. .define("PB_ENABLE_MALLOC", to: "1"),
  756. ]
  757. ),
  758. .target(
  759. name: "FirebaseInAppMessaging_iOS",
  760. path: "FirebaseInAppMessaging/iOS",
  761. resources: [.process("Resources")]
  762. ),
  763. .target(
  764. name: "FirebaseInAppMessaging",
  765. dependencies: ["FirebaseInAppMessagingInternal"],
  766. path: "FirebaseInAppMessaging/Swift/Source"
  767. ),
  768. .target(
  769. name: "FirebaseInAppMessagingSwift",
  770. dependencies: ["FirebaseInAppMessaging"],
  771. path: "FirebaseInAppMessagingSwift/Sources"
  772. ),
  773. .target(
  774. name: "FirebaseInstallations",
  775. dependencies: [
  776. "FirebaseCore",
  777. .product(name: "FBLPromises", package: "Promises"),
  778. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  779. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  780. ],
  781. path: "FirebaseInstallations/Source/Library",
  782. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  783. publicHeadersPath: "Public",
  784. cSettings: [
  785. .headerSearchPath("../../../"),
  786. ],
  787. linkerSettings: [
  788. .linkedFramework("Security"),
  789. ]
  790. ),
  791. .target(
  792. name: "FirebaseMLModelDownloader",
  793. dependencies: [
  794. "FirebaseCore",
  795. "FirebaseInstallations",
  796. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  797. .product(name: "GULLogger", package: "GoogleUtilities"),
  798. .product(name: "SwiftProtobuf", package: "swift-protobuf"),
  799. ],
  800. path: "FirebaseMLModelDownloader/Sources",
  801. exclude: [
  802. "proto/firebase_ml_log_sdk.proto",
  803. ],
  804. cSettings: [
  805. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  806. ]
  807. ),
  808. .testTarget(
  809. name: "FirebaseMLModelDownloaderUnit",
  810. dependencies: ["FirebaseMLModelDownloader"],
  811. path: "FirebaseMLModelDownloader/Tests/Unit"
  812. ),
  813. .target(
  814. name: "FirebaseMessaging",
  815. dependencies: [
  816. "FirebaseCore",
  817. "FirebaseInstallations",
  818. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  819. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  820. .product(name: "GULReachability", package: "GoogleUtilities"),
  821. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  822. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  823. .product(name: "nanopb", package: "nanopb"),
  824. ],
  825. path: "FirebaseMessaging/Sources",
  826. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  827. publicHeadersPath: "Public",
  828. cSettings: [
  829. .headerSearchPath("../../"),
  830. .define("PB_FIELD_32BIT", to: "1"),
  831. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  832. .define("PB_ENABLE_MALLOC", to: "1"),
  833. ],
  834. linkerSettings: [
  835. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  836. ]
  837. ),
  838. // Internal headers only for consuming from Swift.
  839. .target(
  840. name: "FirebaseMessagingInterop",
  841. path: "FirebaseMessaging/Interop",
  842. publicHeadersPath: ".",
  843. cSettings: [
  844. .headerSearchPath("../../"),
  845. ]
  846. ),
  847. .testTarget(
  848. name: "MessagingUnit",
  849. dependencies: [
  850. "FirebaseMessaging",
  851. "SharedTestUtilities",
  852. .product(name: "OCMock", package: "ocmock"),
  853. ],
  854. path: "FirebaseMessaging/Tests/UnitTests",
  855. exclude: [
  856. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  857. ],
  858. cSettings: [
  859. .headerSearchPath("../../.."),
  860. ]
  861. ),
  862. .target(
  863. name: "FirebasePerformanceTarget",
  864. dependencies: [.target(name: "FirebasePerformance",
  865. condition: .when(platforms: [.iOS, .tvOS, .firebaseVisionOS]))],
  866. path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
  867. ),
  868. .target(
  869. name: "FirebasePerformance",
  870. dependencies: [
  871. "FirebaseCore",
  872. "FirebaseInstallations",
  873. // Performance depends on the Obj-C target of FirebaseRemoteConfig to
  874. // avoid including Swift code from the `FirebaseRemoteConfig` target
  875. // that is unneeded.
  876. "FirebaseRemoteConfigInternal",
  877. "FirebaseSessions",
  878. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  879. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  880. .product(name: "GULISASwizzler", package: "GoogleUtilities"),
  881. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  882. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  883. .product(name: "nanopb", package: "nanopb"),
  884. ],
  885. path: "FirebasePerformance/Sources",
  886. publicHeadersPath: "Public",
  887. cSettings: [
  888. .headerSearchPath("../../"),
  889. .define("PB_FIELD_32BIT", to: "1"),
  890. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  891. .define("PB_ENABLE_MALLOC", to: "1"),
  892. .define("FIRPerformance_LIB_VERSION", to: firebaseVersion),
  893. ],
  894. linkerSettings: [
  895. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .tvOS])),
  896. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .tvOS])),
  897. .linkedFramework("QuartzCore", .when(platforms: [.iOS, .tvOS])),
  898. ]
  899. ),
  900. .testTarget(
  901. name: "PerformanceUnit",
  902. dependencies: [
  903. "FirebasePerformanceTarget",
  904. "SharedTestUtilities",
  905. "GCDWebServer",
  906. .product(name: "OCMock", package: "ocmock"),
  907. ],
  908. path: "FirebasePerformance/Tests/Unit",
  909. resources: [
  910. .process("FPRURLFilterTests-Info.plist"),
  911. .process("Server/smallDownloadFile"),
  912. .process("Server/bigDownloadFile"),
  913. ],
  914. cSettings: [
  915. .headerSearchPath("../../.."),
  916. .define("PB_FIELD_32BIT", to: "1"),
  917. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  918. .define("PB_ENABLE_MALLOC", to: "1"),
  919. ]
  920. ),
  921. .target(
  922. name: "SharedTestUtilities",
  923. dependencies: ["FirebaseCore",
  924. "FirebaseAppCheckInterop",
  925. "FirebaseAuthInterop",
  926. "FirebaseMessagingInterop",
  927. "GoogleDataTransport",
  928. .product(name: "OCMock", package: "ocmock")],
  929. path: "SharedTestUtilities",
  930. publicHeadersPath: "./",
  931. cSettings: [
  932. .headerSearchPath("../"),
  933. ]
  934. ),
  935. // MARK: - Firebase Remote Config
  936. .target(
  937. name: "FirebaseRemoteConfigInternal",
  938. dependencies: [
  939. "FirebaseCore",
  940. "FirebaseABTesting",
  941. "FirebaseInstallations",
  942. .product(name: "GULNSData", package: "GoogleUtilities"),
  943. ],
  944. path: "FirebaseRemoteConfig/Sources",
  945. publicHeadersPath: "Public",
  946. cSettings: [
  947. .headerSearchPath("../../"),
  948. ]
  949. ),
  950. .testTarget(
  951. name: "RemoteConfigUnit",
  952. dependencies: ["FirebaseRemoteConfigInternal", .product(name: "OCMock", package: "ocmock")],
  953. path: "FirebaseRemoteConfig/Tests/Unit",
  954. exclude: [
  955. // Need to be evaluated/ported to RC V2.
  956. "RCNConfigAnalyticsTest.m",
  957. "RCNConfigSettingsTest.m",
  958. "RCNConfigTest.m",
  959. "RCNRemoteConfig+FIRAppTest.m",
  960. "RCNThrottlingTests.m",
  961. ],
  962. resources: [
  963. .process("SecondApp-GoogleService-Info.plist"),
  964. .process("Defaults-testInfo.plist"),
  965. .process("TestABTPayload.txt"),
  966. ],
  967. cSettings: [
  968. .headerSearchPath("../../.."),
  969. ]
  970. ),
  971. .target(
  972. name: "FirebaseRemoteConfig",
  973. dependencies: [
  974. "FirebaseRemoteConfigInternal",
  975. "FirebaseSharedSwift",
  976. ],
  977. path: "FirebaseRemoteConfig/Swift",
  978. resources: [.process("Resources/PrivacyInfo.xcprivacy")]
  979. ),
  980. .target(
  981. name: "FirebaseRemoteConfigSwift",
  982. dependencies: [
  983. "FirebaseRemoteConfig",
  984. ],
  985. path: "FirebaseRemoteConfigSwift/Sources"
  986. ),
  987. .testTarget(
  988. name: "RemoteConfigFakeConsole",
  989. dependencies: ["FirebaseRemoteConfig",
  990. "FirebaseRemoteConfigSwift",
  991. "RemoteConfigFakeConsoleObjC"],
  992. path: "FirebaseRemoteConfigSwift/Tests",
  993. exclude: [
  994. "AccessToken.json",
  995. "README.md",
  996. "ObjC/",
  997. ],
  998. resources: [
  999. .process("Defaults-testInfo.plist"),
  1000. ],
  1001. cSettings: [
  1002. .headerSearchPath("../../"),
  1003. ]
  1004. ),
  1005. .target(
  1006. name: "RemoteConfigFakeConsoleObjC",
  1007. dependencies: [.product(name: "OCMock", package: "ocmock")],
  1008. path: "FirebaseRemoteConfigSwift/Tests/ObjC",
  1009. publicHeadersPath: ".",
  1010. cSettings: [
  1011. .headerSearchPath("../../../"),
  1012. ]
  1013. ),
  1014. // MARK: - Firebase Sessions
  1015. .target(
  1016. name: "FirebaseSessions",
  1017. dependencies: [
  1018. "FirebaseCore",
  1019. "FirebaseInstallations",
  1020. "FirebaseCoreExtension",
  1021. "FirebaseSessionsObjC",
  1022. .product(name: "Promises", package: "Promises"),
  1023. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  1024. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1025. ],
  1026. path: "FirebaseSessions/Sources",
  1027. cSettings: [
  1028. .headerSearchPath(".."),
  1029. .define("DISPLAY_VERSION", to: firebaseVersion),
  1030. .define("PB_FIELD_32BIT", to: "1"),
  1031. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  1032. .define("PB_ENABLE_MALLOC", to: "1"),
  1033. ],
  1034. linkerSettings: [
  1035. .linkedFramework("Security"),
  1036. .linkedFramework(
  1037. "SystemConfiguration",
  1038. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1039. ),
  1040. ]
  1041. ),
  1042. // The Sessions SDK is Swift-first with Objective-C code to support
  1043. // nanopb. Because Swift Package Manager doesn't support mixed
  1044. // language targets, the ObjC code has been extracted out into
  1045. // a separate target.
  1046. .target(
  1047. name: "FirebaseSessionsObjC",
  1048. dependencies: [
  1049. "FirebaseCore",
  1050. "FirebaseCoreExtension",
  1051. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1052. .product(name: "nanopb", package: "nanopb"),
  1053. ],
  1054. path: "FirebaseSessions",
  1055. exclude: [
  1056. "README.md",
  1057. "Sources/",
  1058. "Tests/",
  1059. "ProtoSupport/",
  1060. "generate_project.sh",
  1061. "generate_protos.sh",
  1062. "generate_testapp.sh",
  1063. ],
  1064. publicHeadersPath: "SourcesObjC",
  1065. cSettings: [
  1066. .headerSearchPath(".."),
  1067. .define("DISPLAY_VERSION", to: firebaseVersion),
  1068. .define("PB_FIELD_32BIT", to: "1"),
  1069. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  1070. .define("PB_ENABLE_MALLOC", to: "1"),
  1071. ],
  1072. linkerSettings: [
  1073. .linkedFramework("Security"),
  1074. .linkedFramework(
  1075. "SystemConfiguration",
  1076. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1077. ),
  1078. ]
  1079. ),
  1080. .testTarget(
  1081. name: "FirebaseSessionsUnit",
  1082. dependencies: ["FirebaseSessions"],
  1083. path: "FirebaseSessions/Tests/Unit"
  1084. ),
  1085. // MARK: - Firebase Storage
  1086. .target(
  1087. name: "FirebaseStorage",
  1088. dependencies: [
  1089. "FirebaseAppCheckInterop",
  1090. "FirebaseAuthInterop",
  1091. "FirebaseCore",
  1092. "FirebaseCoreExtension",
  1093. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  1094. ],
  1095. path: "FirebaseStorage/Sources"
  1096. ),
  1097. .testTarget(
  1098. name: "FirebaseStorageUnit",
  1099. dependencies: ["FirebaseStorage",
  1100. "SharedTestUtilities"],
  1101. path: "FirebaseStorage/Tests/Unit",
  1102. cSettings: [
  1103. .headerSearchPath("../../../"),
  1104. ]
  1105. ),
  1106. .testTarget(
  1107. name: "StorageObjCIntegration",
  1108. dependencies: ["FirebaseStorage"],
  1109. path: "FirebaseStorage/Tests/ObjCIntegration",
  1110. exclude: [
  1111. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  1112. "FIRStorageIntegrationTests.m",
  1113. "ObjCPPAPITests.mm",
  1114. "Credentials.h",
  1115. ],
  1116. cSettings: [
  1117. .headerSearchPath("../../.."),
  1118. ]
  1119. ),
  1120. .testTarget(
  1121. name: "swift-test",
  1122. dependencies: [
  1123. "Firebase",
  1124. "FirebaseAuth",
  1125. "FirebaseAppCheck",
  1126. "FirebaseABTesting",
  1127. "FirebaseAnalytics",
  1128. "FirebaseAnalyticsSwift",
  1129. .target(name: "FirebaseAppDistribution",
  1130. condition: .when(platforms: [.iOS])),
  1131. "FirebaseAuthCombineSwift",
  1132. "FirebaseFirestoreCombineSwift",
  1133. "FirebaseFunctionsCombineSwift",
  1134. "FirebaseStorageCombineSwift",
  1135. "FirebaseCrashlytics",
  1136. "FirebaseCore",
  1137. "FirebaseDatabase",
  1138. "FirebaseDynamicLinks",
  1139. "FirebaseFirestoreTarget",
  1140. "FirebaseFirestoreSwift",
  1141. "FirebaseFunctions",
  1142. .target(name: "FirebaseInAppMessaging",
  1143. condition: .when(platforms: [.iOS, .tvOS])),
  1144. .target(name: "FirebaseInAppMessagingSwift",
  1145. condition: .when(platforms: [.iOS, .tvOS])),
  1146. "FirebaseInstallations",
  1147. "FirebaseMessaging",
  1148. .target(name: "FirebasePerformance",
  1149. condition: .when(platforms: [.iOS, .tvOS])),
  1150. "FirebaseRemoteConfig",
  1151. "FirebaseSessions",
  1152. "FirebaseStorage",
  1153. .product(name: "nanopb", package: "nanopb"),
  1154. ],
  1155. path: "SwiftPMTests/swift-test"
  1156. ),
  1157. .testTarget(
  1158. name: "analytics-import-test",
  1159. dependencies: [
  1160. "FirebaseAnalyticsSwiftTarget",
  1161. "FirebaseAnalyticsWrapper",
  1162. "Firebase",
  1163. ],
  1164. path: "SwiftPMTests/analytics-import-test"
  1165. ),
  1166. .testTarget(
  1167. name: "objc-import-test",
  1168. dependencies: [
  1169. "Firebase",
  1170. "FirebaseAuth",
  1171. "FirebaseABTesting",
  1172. "FirebaseAppCheck",
  1173. .target(name: "FirebaseAppDistribution",
  1174. condition: .when(platforms: [.iOS])),
  1175. "FirebaseCrashlytics",
  1176. "FirebaseCore",
  1177. "FirebaseDatabase",
  1178. "FirebaseDynamicLinks",
  1179. "FirebaseFirestoreTarget",
  1180. "FirebaseFunctions",
  1181. .target(name: "FirebaseInAppMessaging",
  1182. condition: .when(platforms: [.iOS, .tvOS])),
  1183. "FirebaseInstallations",
  1184. "FirebaseMessaging",
  1185. .target(name: "FirebasePerformance",
  1186. condition: .when(platforms: [.iOS, .tvOS])),
  1187. "FirebaseRemoteConfig",
  1188. "FirebaseStorage",
  1189. ],
  1190. path: "SwiftPMTests/objc-import-test"
  1191. ),
  1192. .testTarget(
  1193. name: "version-test",
  1194. dependencies: [
  1195. "FirebaseCore",
  1196. ],
  1197. path: "SwiftPMTests/version-test",
  1198. cSettings: [
  1199. .define("FIR_VERSION", to: firebaseVersion),
  1200. ]
  1201. ),
  1202. // MARK: - Firebase App Check
  1203. .target(name: "FirebaseAppCheck",
  1204. dependencies: [
  1205. "FirebaseAppCheckInterop",
  1206. "FirebaseCore",
  1207. .product(name: "AppCheckCore", package: "app-check"),
  1208. .product(name: "FBLPromises", package: "Promises"),
  1209. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1210. ],
  1211. path: "FirebaseAppCheck/Sources",
  1212. publicHeadersPath: "Public",
  1213. cSettings: [
  1214. .headerSearchPath("../.."),
  1215. ],
  1216. linkerSettings: [
  1217. .linkedFramework(
  1218. "DeviceCheck",
  1219. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1220. ),
  1221. ]),
  1222. // Internal headers only for consuming from Swift.
  1223. .target(
  1224. name: "FirebaseAppCheckInterop",
  1225. path: "FirebaseAppCheck/Interop",
  1226. exclude: [
  1227. "CMakeLists.txt",
  1228. ],
  1229. publicHeadersPath: "Public",
  1230. cSettings: [
  1231. .headerSearchPath("../../"),
  1232. ]
  1233. ),
  1234. .testTarget(
  1235. name: "FirebaseAppCheckUnit",
  1236. dependencies: [
  1237. "FirebaseAppCheck",
  1238. "SharedTestUtilities",
  1239. .product(name: "OCMock", package: "ocmock"),
  1240. ],
  1241. path: "FirebaseAppCheck/Tests/Unit",
  1242. exclude: [
  1243. // Swift tests are in the target `FirebaseAppCheckUnitSwift` since mixed language targets
  1244. // are not supported (as of Xcode 15.0).
  1245. "Swift",
  1246. ],
  1247. cSettings: [
  1248. .headerSearchPath("../../.."),
  1249. ]
  1250. ),
  1251. .testTarget(
  1252. name: "FirebaseAppCheckUnitSwift",
  1253. dependencies: ["FirebaseAppCheck"],
  1254. path: "FirebaseAppCheck/Tests/Unit/Swift"
  1255. ),
  1256. // MARK: Testing support
  1257. .target(
  1258. name: "FirebaseFirestoreTestingSupport",
  1259. dependencies: ["FirebaseFirestoreTarget"],
  1260. path: "FirebaseTestingSupport/Firestore/Sources",
  1261. publicHeadersPath: "./",
  1262. cSettings: [
  1263. .headerSearchPath("../../.."),
  1264. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  1265. ]
  1266. ),
  1267. .testTarget(
  1268. name: "FirestoreTestingSupportTests",
  1269. dependencies: ["FirebaseFirestoreTestingSupport"],
  1270. path: "FirebaseTestingSupport/Firestore/Tests",
  1271. cSettings: [
  1272. .headerSearchPath("../../.."),
  1273. ]
  1274. ),
  1275. ] + firestoreTargets(),
  1276. cLanguageStandard: .c99,
  1277. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  1278. )
  1279. // MARK: - Helper Functions
  1280. func googleAppMeasurementDependency() -> Package.Dependency {
  1281. let appMeasurementURL = "https://github.com/google/GoogleAppMeasurement.git"
  1282. // Point SPM CI to the tip of main of https://github.com/google/GoogleAppMeasurement so that the
  1283. // release process can defer publishing the GoogleAppMeasurement tag until after testing.
  1284. if ProcessInfo.processInfo.environment["FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT"] != nil {
  1285. return .package(url: appMeasurementURL, branch: "main")
  1286. }
  1287. return .package(url: appMeasurementURL, exact: "10.22.0")
  1288. }
  1289. func abseilDependency() -> Package.Dependency {
  1290. let packageInfo: (url: String, range: Range<Version>)
  1291. // If building Firestore from source, abseil will need to be built as source
  1292. // as the headers in the binary version of abseil are unusable.
  1293. if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
  1294. packageInfo = (
  1295. "https://github.com/firebase/abseil-cpp-SwiftPM.git",
  1296. "0.20220623.0" ..< "0.20220624.0"
  1297. )
  1298. } else {
  1299. packageInfo = (
  1300. "https://github.com/google/abseil-cpp-binary.git",
  1301. "1.2022062300.0" ..< "1.2022062400.0"
  1302. )
  1303. }
  1304. return .package(url: packageInfo.url, packageInfo.range)
  1305. }
  1306. func grpcDependency() -> Package.Dependency {
  1307. let packageInfo: (url: String, range: Range<Version>)
  1308. // If building Firestore from source, abseil will need to be built as source
  1309. // as the headers in the binary version of abseil are unusable.
  1310. if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
  1311. packageInfo = ("https://github.com/grpc/grpc-ios.git", "1.49.1" ..< "1.50.0")
  1312. } else {
  1313. packageInfo = ("https://github.com/google/grpc-binary.git", "1.49.1" ..< "1.50.0")
  1314. }
  1315. return .package(url: packageInfo.url, packageInfo.range)
  1316. }
  1317. func firestoreWrapperTarget() -> Target {
  1318. if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
  1319. return .target(
  1320. name: "FirebaseFirestoreTarget",
  1321. dependencies: [.target(name: "FirebaseFirestore",
  1322. condition: .when(platforms: [.iOS, .tvOS, .macOS,
  1323. .firebaseVisionOS]))],
  1324. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  1325. )
  1326. }
  1327. return .target(
  1328. name: "FirebaseFirestoreTarget",
  1329. dependencies: [.target(name: "FirebaseFirestore",
  1330. condition: .when(platforms: [.iOS, .tvOS, .macOS, .macCatalyst]))],
  1331. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap",
  1332. cSettings: [.define("FIREBASE_BINARY_FIRESTORE", to: "1")]
  1333. )
  1334. }
  1335. func firestoreTargets() -> [Target] {
  1336. if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
  1337. return [
  1338. .target(
  1339. name: "FirebaseFirestoreInternalWrapper",
  1340. dependencies: [
  1341. "FirebaseAppCheckInterop",
  1342. "FirebaseCore",
  1343. "leveldb",
  1344. .product(name: "nanopb", package: "nanopb"),
  1345. .product(name: "abseil", package: "abseil-cpp-SwiftPM"),
  1346. .product(name: "gRPC-cpp", package: "grpc-ios"),
  1347. ],
  1348. path: "Firestore",
  1349. exclude: [
  1350. "CHANGELOG.md",
  1351. "CMakeLists.txt",
  1352. "Example/",
  1353. "LICENSE",
  1354. "Protos/CMakeLists.txt",
  1355. "Protos/Podfile",
  1356. "Protos/README.md",
  1357. "Protos/build_protos.py",
  1358. "Protos/cpp/",
  1359. "Protos/lib/",
  1360. "Protos/nanopb_cpp_generator.py",
  1361. "Protos/protos/",
  1362. "README.md",
  1363. "Source/CMakeLists.txt",
  1364. "Swift/",
  1365. "core/CMakeLists.txt",
  1366. "core/src/util/config_detected.h.in",
  1367. "core/test/",
  1368. "fuzzing/",
  1369. "test.sh",
  1370. // Swift PM doesn't recognize hpp files, so we're relying on search paths
  1371. // to find third_party/nlohmann_json/json.hpp.
  1372. "third_party/",
  1373. // Exclude alternate implementations for other platforms
  1374. "core/src/remote/connectivity_monitor_noop.cc",
  1375. "core/src/util/filesystem_win.cc",
  1376. "core/src/util/log_stdio.cc",
  1377. "core/src/util/secure_random_openssl.cc",
  1378. ],
  1379. sources: [
  1380. "Source/",
  1381. "Protos/nanopb/",
  1382. "core/include/",
  1383. "core/src",
  1384. ],
  1385. publicHeadersPath: "Source/Public",
  1386. cSettings: [
  1387. .headerSearchPath("../"),
  1388. .headerSearchPath("Source/Public/FirebaseFirestore"),
  1389. .headerSearchPath("Protos/nanopb"),
  1390. .define("PB_FIELD_32BIT", to: "1"),
  1391. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  1392. .define("PB_ENABLE_MALLOC", to: "1"),
  1393. .define("FIRFirestore_VERSION", to: firebaseVersion),
  1394. ],
  1395. linkerSettings: [
  1396. .linkedFramework(
  1397. "SystemConfiguration",
  1398. .when(platforms: [.iOS, .macOS, .tvOS, .firebaseVisionOS])
  1399. ),
  1400. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS, .firebaseVisionOS])),
  1401. .linkedLibrary("c++"),
  1402. ]
  1403. ),
  1404. .target(
  1405. name: "FirebaseFirestore",
  1406. dependencies: [
  1407. "FirebaseCore",
  1408. "FirebaseCoreExtension",
  1409. "FirebaseFirestoreInternalWrapper",
  1410. "FirebaseSharedSwift",
  1411. ],
  1412. path: "Firestore",
  1413. exclude: [
  1414. "CHANGELOG.md",
  1415. "CMakeLists.txt",
  1416. "Example/",
  1417. "LICENSE",
  1418. "Protos/",
  1419. "README.md",
  1420. "Source/",
  1421. "core/",
  1422. "fuzzing/",
  1423. "test.sh",
  1424. "Swift/CHANGELOG.md",
  1425. "Swift/Tests/",
  1426. "third_party/nlohmann_json",
  1427. ],
  1428. sources: [
  1429. "Swift/Source/",
  1430. ],
  1431. resources: [.process("Source/Resources/PrivacyInfo.xcprivacy")]
  1432. ),
  1433. ]
  1434. }
  1435. let firestoreInternalTarget: Target = {
  1436. if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil {
  1437. // This is set when running `scripts/check_firestore_symbols.sh`.
  1438. return .binaryTarget(
  1439. name: "FirebaseFirestoreInternal",
  1440. // The `xcframework` should be moved to the root of the repo.
  1441. path: "FirebaseFirestoreInternal.xcframework"
  1442. )
  1443. } else {
  1444. return .binaryTarget(
  1445. name: "FirebaseFirestoreInternal",
  1446. url: "https://dl.google.com/firebase/ios/bin/firestore/10.22.0/FirebaseFirestoreInternal.zip",
  1447. checksum: "35c02539c6bbd43ec1c3b58f894984e48ff8c560db0c799fb8f6377b59c96099"
  1448. )
  1449. }
  1450. }()
  1451. return [
  1452. .target(
  1453. name: "FirebaseFirestore",
  1454. dependencies: [
  1455. .target(
  1456. name: "FirebaseFirestoreInternalWrapper",
  1457. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
  1458. ),
  1459. .product(
  1460. name: "abseil",
  1461. package: "abseil-cpp-binary",
  1462. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
  1463. ),
  1464. .product(
  1465. name: "gRPC-C++",
  1466. package: "grpc-binary",
  1467. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
  1468. ),
  1469. .product(name: "nanopb", package: "nanopb"),
  1470. "FirebaseAppCheckInterop",
  1471. "FirebaseCore",
  1472. "FirebaseCoreExtension",
  1473. "leveldb",
  1474. "FirebaseSharedSwift",
  1475. ],
  1476. path: "Firestore/Swift/Source",
  1477. resources: [.process("Resources/PrivacyInfo.xcprivacy")],
  1478. linkerSettings: [
  1479. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  1480. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  1481. .linkedLibrary("c++"),
  1482. ]
  1483. ),
  1484. .target(
  1485. name: "FirebaseFirestoreInternalWrapper",
  1486. dependencies: [.target(
  1487. name: "FirebaseFirestoreInternal",
  1488. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
  1489. )],
  1490. path: "FirebaseFirestoreInternal",
  1491. publicHeadersPath: "."
  1492. ),
  1493. firestoreInternalTarget,
  1494. ]
  1495. }
  1496. extension Platform {
  1497. // Xcode dependent value for the visionOS platform. Namespaced with
  1498. // "firebase" prefix to prevent any API collisions (such issues should not
  1499. // arise as the manifest APIs should be confined to the `Package.swift`).
  1500. static var firebaseVisionOS: Self {
  1501. #if swift(>=5.9)
  1502. // For Xcode 15, return the available `visionOS` platform.
  1503. return .visionOS
  1504. #else
  1505. // For Xcode 14, return `iOS` as visionOS is unavailable. Since all targets
  1506. // support iOS, this acts as a no-op.
  1507. return .iOS
  1508. #endif // swift(>=5.9)
  1509. }
  1510. }