Package.swift 50 KB

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