Package.swift 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349
  1. // swift-tools-version:5.6
  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 PackageDescription
  18. import class Foundation.ProcessInfo
  19. let firebaseVersion = "10.11.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. // This library is not designed to be imported into client source code.
  29. .library(
  30. name: "FirebaseAnalyticsWithoutAdIdSupport",
  31. targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"]
  32. ),
  33. // This library is not designed to be imported into client source code.
  34. .library(
  35. name: "FirebaseAnalyticsOnDeviceConversion",
  36. targets: ["FirebaseAnalyticsOnDeviceConversionTarget"]
  37. ),
  38. .library(
  39. name: "FirebaseAnalyticsSwift",
  40. targets: ["FirebaseAnalyticsSwiftTarget"]
  41. ),
  42. .library(
  43. name: "FirebaseAuth",
  44. targets: ["FirebaseAuth"]
  45. ),
  46. .library(
  47. name: "FirebaseAppCheck",
  48. targets: ["FirebaseAppCheck"]
  49. ),
  50. .library(
  51. name: "FirebaseAppDistribution-Beta",
  52. targets: ["FirebaseAppDistributionTarget"]
  53. ),
  54. .library(
  55. name: "FirebaseAuthCombine-Community",
  56. targets: ["FirebaseAuthCombineSwift"]
  57. ),
  58. .library(
  59. name: "FirebaseFirestoreCombine-Community",
  60. targets: ["FirebaseFirestoreCombineSwift"]
  61. ),
  62. .library(
  63. name: "FirebaseFunctionsCombine-Community",
  64. targets: ["FirebaseFunctionsCombineSwift"]
  65. ),
  66. .library(
  67. name: "FirebaseStorageCombine-Community",
  68. targets: ["FirebaseStorageCombineSwift"]
  69. ),
  70. .library(
  71. name: "FirebaseCrashlytics",
  72. targets: ["FirebaseCrashlytics"]
  73. ),
  74. .library(
  75. name: "FirebaseDatabase",
  76. targets: ["FirebaseDatabase"]
  77. ),
  78. .library(
  79. name: "FirebaseDatabaseSwift",
  80. targets: ["FirebaseDatabaseSwift"]
  81. ),
  82. .library(
  83. name: "FirebaseDynamicLinks",
  84. targets: ["FirebaseDynamicLinksTarget"]
  85. ),
  86. .library(
  87. name: "FirebaseFirestore",
  88. targets: ["FirebaseFirestoreTarget"]
  89. ),
  90. .library(
  91. name: "FirebaseFirestoreSwift",
  92. targets: ["FirebaseFirestoreSwiftTarget"]
  93. ),
  94. .library(
  95. name: "FirebaseFunctions",
  96. targets: ["FirebaseFunctions"]
  97. ),
  98. .library(
  99. name: "FirebaseInAppMessaging-Beta",
  100. targets: ["FirebaseInAppMessagingTarget"]
  101. ),
  102. .library(
  103. name: "FirebaseInAppMessagingSwift-Beta",
  104. targets: ["FirebaseInAppMessagingSwift"]
  105. ),
  106. .library(
  107. name: "FirebaseInstallations",
  108. targets: ["FirebaseInstallations"]
  109. ),
  110. .library(
  111. name: "FirebaseMessaging",
  112. targets: ["FirebaseMessaging"]
  113. ),
  114. .library(
  115. name: "FirebaseMLModelDownloader",
  116. targets: ["FirebaseMLModelDownloader"]
  117. ),
  118. .library(
  119. name: "FirebasePerformance",
  120. targets: ["FirebasePerformanceTarget"]
  121. ),
  122. .library(
  123. name: "FirebaseRemoteConfig",
  124. targets: ["FirebaseRemoteConfig"]
  125. ),
  126. .library(
  127. name: "FirebaseRemoteConfigSwift",
  128. targets: ["FirebaseRemoteConfigSwift"]
  129. ),
  130. .library(
  131. name: "FirebaseStorage",
  132. targets: ["FirebaseStorage"]
  133. ),
  134. ],
  135. dependencies: [
  136. .package(
  137. url: "https://github.com/google/promises.git",
  138. "2.1.0" ..< "3.0.0"
  139. ),
  140. .package(
  141. url: "https://github.com/apple/swift-protobuf.git",
  142. "1.19.0" ..< "2.0.0"
  143. ),
  144. googleAppMeasurementDependency(),
  145. .package(
  146. url: "https://github.com/google/GoogleDataTransport.git",
  147. "9.2.0" ..< "10.0.0"
  148. ),
  149. .package(
  150. url: "https://github.com/google/GoogleUtilities.git",
  151. "7.11.0" ..< "8.0.0"
  152. ),
  153. .package(
  154. url: "https://github.com/google/gtm-session-fetcher.git",
  155. "2.1.0" ..< "4.0.0"
  156. ),
  157. .package(
  158. url: "https://github.com/firebase/nanopb.git",
  159. "2.30909.0" ..< "2.30910.0"
  160. ),
  161. .package(
  162. url: "https://github.com/google/abseil-cpp-binary.git",
  163. "1.2022062300.0" ..< "1.2022062400.0"
  164. ),
  165. .package(
  166. url: "https://github.com/google/grpc-binary.git",
  167. "1.50.1" ..< "1.51.0"
  168. ),
  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. ],
  182. targets: [
  183. .target(
  184. name: "Firebase",
  185. path: "CoreOnly/Sources",
  186. publicHeadersPath: "./"
  187. ),
  188. .target(
  189. name: "FirebaseCore",
  190. dependencies: [
  191. "Firebase",
  192. "FirebaseCoreInternal",
  193. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  194. .product(name: "GULLogger", package: "GoogleUtilities"),
  195. ],
  196. path: "FirebaseCore/Sources",
  197. publicHeadersPath: "Public",
  198. cSettings: [
  199. .headerSearchPath("../.."),
  200. .define("Firebase_VERSION", to: firebaseVersion),
  201. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  202. ],
  203. linkerSettings: [
  204. .linkedFramework("UIKit", .when(platforms: [.iOS, .macCatalyst, .tvOS])),
  205. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  206. ]
  207. ),
  208. .testTarget(
  209. name: "CoreUnit",
  210. dependencies: [
  211. "FirebaseCore",
  212. "SharedTestUtilities",
  213. .product(name: "OCMock", package: "ocmock"),
  214. ],
  215. path: "FirebaseCore/Tests/Unit",
  216. exclude: ["Resources/GoogleService-Info.plist"],
  217. cSettings: [
  218. .headerSearchPath("../../.."),
  219. ]
  220. ),
  221. // MARK: - Firebase Core Extension
  222. // Extension of FirebaseCore for consuming by Swift product SDKs.
  223. // When depending on `FirebaseCoreExtension`, also depend on `FirebaseCore`
  224. // to avoid potential linker issues.
  225. .target(
  226. name: "FirebaseCoreExtension",
  227. path: "FirebaseCore/Extension",
  228. publicHeadersPath: ".",
  229. cSettings: [
  230. .headerSearchPath("../../"),
  231. ]
  232. ),
  233. // MARK: - Firebase Core Internal
  234. // Shared collection of APIs for internal FirebaseCore usage.
  235. .target(
  236. name: "FirebaseCoreInternal",
  237. dependencies: [
  238. .product(name: "GULNSData", package: "GoogleUtilities"),
  239. ],
  240. path: "FirebaseCore/Internal/Sources"
  241. ),
  242. .testTarget(
  243. name: "FirebaseCoreInternalTests",
  244. dependencies: [
  245. "FirebaseCoreInternal",
  246. ],
  247. path: "FirebaseCore/Internal/Tests"
  248. ),
  249. .target(
  250. name: "FirebaseABTesting",
  251. dependencies: ["FirebaseCore"],
  252. path: "FirebaseABTesting/Sources",
  253. publicHeadersPath: "Public",
  254. cSettings: [
  255. .headerSearchPath("../../"),
  256. ]
  257. ),
  258. .testTarget(
  259. name: "ABTestingUnit",
  260. dependencies: ["FirebaseABTesting", .product(name: "OCMock", package: "ocmock")],
  261. path: "FirebaseABTesting/Tests/Unit",
  262. resources: [.process("Resources")],
  263. cSettings: [
  264. .headerSearchPath("../../.."),
  265. ]
  266. ),
  267. .target(
  268. name: "FirebaseAnalyticsTarget",
  269. dependencies: [.target(name: "FirebaseAnalyticsWrapper",
  270. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  271. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
  272. ),
  273. .target(
  274. name: "FirebaseAnalyticsWrapper",
  275. dependencies: [
  276. .target(
  277. name: "FirebaseAnalytics",
  278. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  279. ),
  280. .product(name: "GoogleAppMeasurement",
  281. package: "GoogleAppMeasurement",
  282. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
  283. "FirebaseCore",
  284. "FirebaseInstallations",
  285. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  286. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  287. .product(name: "GULNSData", package: "GoogleUtilities"),
  288. .product(name: "GULNetwork", package: "GoogleUtilities"),
  289. .product(name: "nanopb", package: "nanopb"),
  290. ],
  291. path: "FirebaseAnalyticsWrapper",
  292. linkerSettings: [
  293. .linkedLibrary("sqlite3"),
  294. .linkedLibrary("c++"),
  295. .linkedLibrary("z"),
  296. .linkedFramework("StoreKit"),
  297. ]
  298. ),
  299. .binaryTarget(
  300. name: "FirebaseAnalytics",
  301. url: "https://dl.google.com/firebase/ios/swiftpm/10.11.0/FirebaseAnalytics.zip",
  302. checksum: "986032391d024536568c028890debdd1a175715be7c778863bc88a7e5a0edf7d"
  303. ),
  304. .target(
  305. name: "FirebaseAnalyticsSwiftTarget",
  306. dependencies: [.target(name: "FirebaseAnalyticsSwift",
  307. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  308. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
  309. ),
  310. .target(
  311. name: "FirebaseAnalyticsSwift",
  312. dependencies: ["FirebaseAnalyticsWrapper"],
  313. path: "FirebaseAnalyticsSwift/Sources"
  314. ),
  315. .testTarget(
  316. name: "AnalyticsSwiftUnit",
  317. dependencies: ["FirebaseAnalyticsSwift"],
  318. path: "FirebaseAnalyticsSwift/Tests/SwiftUnit"
  319. ),
  320. .testTarget(
  321. name: "AnalyticsObjCAPI",
  322. dependencies: ["FirebaseAnalyticsSwift"],
  323. path: "FirebaseAnalyticsSwift/Tests/ObjCAPI"
  324. ),
  325. .target(
  326. name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
  327. dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  328. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS]))],
  329. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
  330. ),
  331. .target(
  332. name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  333. dependencies: [
  334. .target(
  335. name: "FirebaseAnalytics",
  336. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  337. ),
  338. .product(name: "GoogleAppMeasurementWithoutAdIdSupport",
  339. package: "GoogleAppMeasurement",
  340. condition: .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])),
  341. "FirebaseCore",
  342. "FirebaseInstallations",
  343. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  344. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  345. .product(name: "GULNSData", package: "GoogleUtilities"),
  346. .product(name: "GULNetwork", package: "GoogleUtilities"),
  347. .product(name: "nanopb", package: "nanopb"),
  348. ],
  349. path: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  350. linkerSettings: [
  351. .linkedLibrary("sqlite3"),
  352. .linkedLibrary("c++"),
  353. .linkedLibrary("z"),
  354. .linkedFramework("StoreKit"),
  355. ]
  356. ),
  357. .target(
  358. name: "FirebaseAnalyticsOnDeviceConversionTarget",
  359. dependencies: [
  360. .product(name: "GoogleAppMeasurementOnDeviceConversion",
  361. package: "GoogleAppMeasurement",
  362. condition: .when(platforms: [.iOS])),
  363. ],
  364. path: "FirebaseAnalyticsOnDeviceConversionWrapper",
  365. linkerSettings: [
  366. .linkedLibrary("c++"),
  367. ]
  368. ),
  369. .target(
  370. name: "FirebaseAppDistributionTarget",
  371. dependencies: [.target(name: "FirebaseAppDistribution",
  372. condition: .when(platforms: [.iOS]))],
  373. path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
  374. ),
  375. .target(
  376. name: "FirebaseAppDistribution",
  377. dependencies: [
  378. "FirebaseCore",
  379. "FirebaseInstallations",
  380. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  381. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  382. ],
  383. path: "FirebaseAppDistribution/Sources",
  384. publicHeadersPath: "Public",
  385. cSettings: [
  386. .headerSearchPath("../../"),
  387. ]
  388. ),
  389. .testTarget(
  390. name: "AppDistributionUnit",
  391. dependencies: ["FirebaseAppDistribution", .product(name: "OCMock", package: "ocmock")],
  392. path: "FirebaseAppDistribution/Tests/Unit",
  393. exclude: ["Swift/"],
  394. resources: [.process("Resources")],
  395. cSettings: [
  396. .headerSearchPath("../../.."),
  397. ]
  398. ),
  399. .testTarget(
  400. name: "AppDistributionUnitSwift",
  401. dependencies: ["FirebaseAppDistribution"],
  402. path: "FirebaseAppDistribution/Tests/Unit/Swift",
  403. cSettings: [
  404. .headerSearchPath("../../../.."),
  405. ]
  406. ),
  407. .target(
  408. name: "FirebaseAuth",
  409. dependencies: [
  410. "FirebaseCore",
  411. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  412. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  413. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  414. ],
  415. path: "FirebaseAuth/Sources",
  416. publicHeadersPath: "Public",
  417. cSettings: [
  418. .headerSearchPath("../../"),
  419. ],
  420. linkerSettings: [
  421. .linkedFramework("Security"),
  422. .linkedFramework("SafariServices", .when(platforms: [.iOS])),
  423. ]
  424. ),
  425. // Internal headers only for consuming from Swift.
  426. .target(
  427. name: "FirebaseAuthInterop",
  428. path: "FirebaseAuth/Interop",
  429. exclude: [
  430. "CMakeLists.txt",
  431. ],
  432. publicHeadersPath: ".",
  433. cSettings: [
  434. .headerSearchPath("../../"),
  435. ]
  436. ),
  437. .testTarget(
  438. name: "AuthUnit",
  439. dependencies: [
  440. "FirebaseAuth",
  441. .product(name: "OCMock", package: "ocmock"),
  442. ],
  443. path: "FirebaseAuth/Tests/Unit",
  444. exclude: [
  445. "FIRAuthKeychainServicesTests.m", // TODO: figure out SPM keychain testing
  446. "FIRAuthTests.m",
  447. "FIRUserTests.m",
  448. ],
  449. cSettings: [
  450. .headerSearchPath("../../.."),
  451. ]
  452. ),
  453. .target(
  454. name: "FirebaseAuthCombineSwift",
  455. dependencies: ["FirebaseAuth"],
  456. path: "FirebaseCombineSwift/Sources/Auth"
  457. ),
  458. .target(
  459. name: "FirebaseFirestoreCombineSwift",
  460. dependencies: [
  461. "FirebaseFirestoreTarget",
  462. "FirebaseFirestoreSwift",
  463. ],
  464. path: "FirebaseCombineSwift/Sources/Firestore"
  465. ),
  466. .target(
  467. name: "FirebaseStorageCombineSwift",
  468. dependencies: [
  469. "FirebaseStorage",
  470. ],
  471. path: "FirebaseCombineSwift/Sources/Storage"
  472. ),
  473. .target(
  474. name: "FirebaseCrashlytics",
  475. dependencies: ["FirebaseCore", "FirebaseInstallations", "FirebaseSessions",
  476. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  477. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  478. .product(name: "FBLPromises", package: "Promises"),
  479. .product(name: "nanopb", package: "nanopb")],
  480. path: "Crashlytics",
  481. exclude: [
  482. "run",
  483. "CHANGELOG.md",
  484. "LICENSE",
  485. "README.md",
  486. "ProtoSupport/",
  487. "UnitTests/",
  488. "generate_project.sh",
  489. "upload-symbols",
  490. "third_party/libunwind/LICENSE",
  491. ],
  492. sources: [
  493. "Crashlytics/",
  494. "Protogen/",
  495. "Shared/",
  496. "third_party/libunwind/dwarf.h",
  497. ],
  498. publicHeadersPath: "Crashlytics/Public",
  499. cSettings: [
  500. .headerSearchPath(".."),
  501. .define("DISPLAY_VERSION", to: firebaseVersion),
  502. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  503. .define(
  504. "CLS_SDK_NAME",
  505. to: "Crashlytics macOS SDK",
  506. .when(platforms: [.macOS, .macCatalyst])
  507. ),
  508. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  509. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  510. .define("PB_FIELD_32BIT", to: "1"),
  511. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  512. .define("PB_ENABLE_MALLOC", to: "1"),
  513. ],
  514. linkerSettings: [
  515. .linkedFramework("Security"),
  516. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  517. ]
  518. ),
  519. .testTarget(
  520. name: "FirebaseCrashlyticsUnit",
  521. dependencies: ["FirebaseCrashlytics", .product(name: "OCMock", package: "ocmock")],
  522. path: "Crashlytics/UnitTests",
  523. resources: [
  524. .copy("FIRCLSMachO/machO_data"),
  525. .copy("Data"),
  526. ],
  527. cSettings: [
  528. .headerSearchPath("../.."),
  529. .define("DISPLAY_VERSION", to: firebaseVersion),
  530. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  531. .define(
  532. "CLS_SDK_NAME",
  533. to: "Crashlytics macOS SDK",
  534. .when(platforms: [.macOS, .macCatalyst])
  535. ),
  536. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  537. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  538. ]
  539. ),
  540. .target(
  541. name: "FirebaseDatabase",
  542. dependencies: [
  543. "FirebaseCore",
  544. "leveldb",
  545. ],
  546. path: "FirebaseDatabase/Sources",
  547. exclude: [
  548. "third_party/Wrap-leveldb/LICENSE",
  549. "third_party/SocketRocket/LICENSE",
  550. "third_party/FImmutableSortedDictionary/LICENSE",
  551. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  552. ],
  553. publicHeadersPath: "Public",
  554. cSettings: [
  555. .headerSearchPath("../../"),
  556. ],
  557. linkerSettings: [
  558. .linkedFramework("CFNetwork"),
  559. .linkedFramework("Security"),
  560. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  561. .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
  562. ]
  563. ),
  564. .testTarget(
  565. name: "DatabaseUnit",
  566. dependencies: [
  567. "FirebaseDatabase",
  568. "SharedTestUtilities",
  569. .product(name: "OCMock", package: "ocmock"),
  570. ],
  571. path: "FirebaseDatabase/Tests/",
  572. exclude: [
  573. // Disable Swift tests as mixed targets are not supported (Xcode 12.4).
  574. "Unit/Swift",
  575. "Integration/",
  576. ],
  577. resources: [.process("Resources")],
  578. cSettings: [
  579. .headerSearchPath("../.."),
  580. ]
  581. ),
  582. .testTarget(
  583. name: "DatabaseUnitSwift",
  584. dependencies: ["FirebaseDatabase"],
  585. path: "FirebaseDatabase/Tests/Unit/Swift",
  586. cSettings: [
  587. .headerSearchPath("../.."),
  588. ]
  589. ),
  590. .target(
  591. name: "FirebaseDatabaseSwift",
  592. dependencies: ["FirebaseDatabase", "FirebaseSharedSwift"],
  593. path: "FirebaseDatabaseSwift/Sources"
  594. ),
  595. .testTarget(
  596. name: "FirebaseDatabaseSwiftTests",
  597. dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
  598. path: "FirebaseDatabaseSwift/Tests/"
  599. ),
  600. .target(
  601. name: "FirebaseSharedSwift",
  602. path: "FirebaseSharedSwift/Sources",
  603. exclude: [
  604. "third_party/FirebaseDataEncoder/LICENSE",
  605. "third_party/FirebaseDataEncoder/METADATA",
  606. ]
  607. ),
  608. .testTarget(
  609. name: "FirebaseSharedSwiftTests",
  610. dependencies: ["FirebaseSharedSwift"],
  611. path: "FirebaseSharedSwift/Tests/"
  612. ),
  613. .target(
  614. name: "FirebaseDynamicLinksTarget",
  615. dependencies: [.target(name: "FirebaseDynamicLinks",
  616. condition: .when(platforms: [.iOS]))],
  617. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  618. ),
  619. .target(
  620. name: "FirebaseDynamicLinks",
  621. dependencies: ["FirebaseCore"],
  622. path: "FirebaseDynamicLinks/Sources",
  623. publicHeadersPath: "Public",
  624. cSettings: [
  625. .headerSearchPath("../../"),
  626. .define("FIRDynamicLinks3P", to: "1"),
  627. .define("GIN_SCION_LOGGING", to: "1"),
  628. ],
  629. linkerSettings: [
  630. .linkedFramework("QuartzCore"),
  631. ]
  632. ),
  633. .target(
  634. name: "FirebaseFirestoreTarget",
  635. dependencies: [
  636. .target(
  637. name: "FirebaseFirestore",
  638. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
  639. ),
  640. .product(name: "abseil", package: "abseil-cpp-binary"),
  641. .product(name: "gRPC-C++", package: "grpc-binary"),
  642. .product(name: "nanopb", package: "nanopb"),
  643. "FirebaseCore",
  644. "leveldb",
  645. ],
  646. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap",
  647. linkerSettings: [
  648. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  649. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  650. .linkedLibrary("c++"),
  651. ]
  652. ),
  653. .binaryTarget(
  654. name: "FirebaseFirestore",
  655. url: "https://dl.google.com/firebase/ios/bin/firestore/10.11.0/FirebaseFirestore.zip",
  656. checksum: "47da0c2d102c90d32ffa93cc5884c5a14eea006325944717b5e8d67ec9b440f3"
  657. ),
  658. .target(
  659. name: "FirebaseFirestoreSwiftTarget",
  660. dependencies: [.target(name: "FirebaseFirestoreSwift",
  661. condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS]))],
  662. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  663. ),
  664. .target(
  665. name: "FirebaseFirestoreSwift",
  666. dependencies: [
  667. "FirebaseCore",
  668. "FirebaseCoreExtension",
  669. "FirebaseFirestoreTarget",
  670. "FirebaseSharedSwift",
  671. ],
  672. path: "Firestore",
  673. exclude: [
  674. "CHANGELOG.md",
  675. "CMakeLists.txt",
  676. "Example/",
  677. "LICENSE",
  678. "Protos/",
  679. "README.md",
  680. "Source/",
  681. "core/",
  682. "fuzzing/",
  683. "test.sh",
  684. "Swift/CHANGELOG.md",
  685. "Swift/Tests/",
  686. "third_party/nlohmann_json",
  687. ],
  688. sources: [
  689. "Swift/Source/",
  690. ]
  691. ),
  692. // MARK: - Firebase Functions
  693. .target(
  694. name: "FirebaseFunctions",
  695. dependencies: [
  696. "FirebaseAppCheckInterop",
  697. "FirebaseAuthInterop",
  698. "FirebaseCore",
  699. "FirebaseCoreExtension",
  700. "FirebaseMessagingInterop",
  701. "FirebaseSharedSwift",
  702. .product(name: "GTMSessionFetcherCore", package: "gtm-session-fetcher"),
  703. ],
  704. path: "FirebaseFunctions/Sources"
  705. ),
  706. .testTarget(
  707. name: "FirebaseFunctionsUnit",
  708. dependencies: ["FirebaseFunctions",
  709. "FirebaseAppCheckInterop",
  710. "FirebaseAuthInterop",
  711. "FirebaseMessagingInterop",
  712. "SharedTestUtilities"],
  713. path: "FirebaseFunctions/Tests/Unit",
  714. cSettings: [
  715. .headerSearchPath("../../../"),
  716. ]
  717. ),
  718. .testTarget(
  719. name: "FirebaseFunctionsIntegration",
  720. dependencies: ["FirebaseFunctions",
  721. "SharedTestUtilities"],
  722. path: "FirebaseFunctions/Tests/Integration"
  723. ),
  724. .testTarget(
  725. name: "FirebaseFunctionsObjCIntegration",
  726. dependencies: ["FirebaseFunctions",
  727. "SharedTestUtilities"],
  728. path: "FirebaseFunctions/Tests/ObjCIntegration",
  729. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  730. exclude: [
  731. "ObjCPPAPITests.mm",
  732. ],
  733. cSettings: [
  734. .headerSearchPath("../../.."),
  735. ]
  736. ),
  737. .target(
  738. name: "FirebaseFunctionsCombineSwift",
  739. dependencies: ["FirebaseFunctions"],
  740. path: "FirebaseCombineSwift/Sources/Functions"
  741. ),
  742. .testTarget(
  743. name: "FunctionsCombineUnit",
  744. dependencies: ["FirebaseFunctionsCombineSwift",
  745. "SharedTestUtilities"],
  746. path: "FirebaseFunctions/Tests/CombineUnit"
  747. ),
  748. // MARK: - Firebase In App Messaging
  749. .target(
  750. name: "FirebaseInAppMessagingTarget",
  751. dependencies: [
  752. .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
  753. ],
  754. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  755. ),
  756. .target(
  757. name: "FirebaseInAppMessaging",
  758. dependencies: [
  759. "FirebaseCore",
  760. "FirebaseInstallations",
  761. "FirebaseABTesting",
  762. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  763. .product(name: "nanopb", package: "nanopb"),
  764. .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
  765. ],
  766. path: "FirebaseInAppMessaging/Sources",
  767. exclude: [
  768. "DefaultUI/CHANGELOG.md",
  769. "DefaultUI/README.md",
  770. ],
  771. publicHeadersPath: "Public",
  772. cSettings: [
  773. .headerSearchPath("../../"),
  774. .define("PB_FIELD_32BIT", to: "1"),
  775. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  776. .define("PB_ENABLE_MALLOC", to: "1"),
  777. ]
  778. ),
  779. .target(
  780. name: "FirebaseInAppMessaging_iOS",
  781. path: "FirebaseInAppMessaging/iOS",
  782. resources: [.process("Resources")]
  783. ),
  784. .target(
  785. name: "FirebaseInAppMessagingSwift",
  786. dependencies: ["FirebaseInAppMessaging"],
  787. path: "FirebaseInAppMessaging/Swift/Source"
  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. publicHeadersPath: "Public",
  799. cSettings: [
  800. .headerSearchPath("../../../"),
  801. ],
  802. linkerSettings: [
  803. .linkedFramework("Security"),
  804. ]
  805. ),
  806. .target(
  807. name: "FirebaseMLModelDownloader",
  808. dependencies: [
  809. "FirebaseCore",
  810. "FirebaseInstallations",
  811. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  812. .product(name: "GULLogger", package: "GoogleUtilities"),
  813. .product(name: "SwiftProtobuf", package: "swift-protobuf"),
  814. ],
  815. path: "FirebaseMLModelDownloader/Sources",
  816. exclude: [
  817. "proto/firebase_ml_log_sdk.proto",
  818. ],
  819. cSettings: [
  820. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  821. ]
  822. ),
  823. .testTarget(
  824. name: "FirebaseMLModelDownloaderUnit",
  825. dependencies: ["FirebaseMLModelDownloader"],
  826. path: "FirebaseMLModelDownloader/Tests/Unit"
  827. ),
  828. .target(
  829. name: "FirebaseMessaging",
  830. dependencies: [
  831. "FirebaseCore",
  832. "FirebaseInstallations",
  833. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  834. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  835. .product(name: "GULReachability", package: "GoogleUtilities"),
  836. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  837. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  838. .product(name: "nanopb", package: "nanopb"),
  839. ],
  840. path: "FirebaseMessaging/Sources",
  841. publicHeadersPath: "Public",
  842. cSettings: [
  843. .headerSearchPath("../../"),
  844. .define("PB_FIELD_32BIT", to: "1"),
  845. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  846. .define("PB_ENABLE_MALLOC", to: "1"),
  847. ],
  848. linkerSettings: [
  849. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  850. ]
  851. ),
  852. // Internal headers only for consuming from Swift.
  853. .target(
  854. name: "FirebaseMessagingInterop",
  855. path: "FirebaseMessaging/Interop",
  856. publicHeadersPath: ".",
  857. cSettings: [
  858. .headerSearchPath("../../"),
  859. ]
  860. ),
  861. .testTarget(
  862. name: "MessagingUnit",
  863. dependencies: [
  864. "FirebaseMessaging",
  865. "SharedTestUtilities",
  866. .product(name: "OCMock", package: "ocmock"),
  867. ],
  868. path: "FirebaseMessaging/Tests/UnitTests",
  869. exclude: [
  870. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  871. ],
  872. cSettings: [
  873. .headerSearchPath("../../.."),
  874. ]
  875. ),
  876. .target(
  877. name: "FirebasePerformanceTarget",
  878. dependencies: [.target(name: "FirebasePerformance",
  879. condition: .when(platforms: [.iOS, .tvOS]))],
  880. path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
  881. ),
  882. .target(
  883. name: "FirebasePerformance",
  884. dependencies: [
  885. "FirebaseCore",
  886. "FirebaseInstallations",
  887. "FirebaseRemoteConfig",
  888. "FirebaseSessions",
  889. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  890. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  891. .product(name: "GULISASwizzler", package: "GoogleUtilities"),
  892. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  893. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  894. .product(name: "nanopb", package: "nanopb"),
  895. ],
  896. path: "FirebasePerformance/Sources",
  897. publicHeadersPath: "Public",
  898. cSettings: [
  899. .headerSearchPath("../../"),
  900. .define("PB_FIELD_32BIT", to: "1"),
  901. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  902. .define("PB_ENABLE_MALLOC", to: "1"),
  903. .define("FIRPerformance_LIB_VERSION", to: firebaseVersion),
  904. ],
  905. linkerSettings: [
  906. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .tvOS])),
  907. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .tvOS])),
  908. .linkedFramework("QuartzCore", .when(platforms: [.iOS, .tvOS])),
  909. ]
  910. ),
  911. .testTarget(
  912. name: "PerformanceUnit",
  913. dependencies: [
  914. "FirebasePerformanceTarget",
  915. "SharedTestUtilities",
  916. "GCDWebServer",
  917. .product(name: "OCMock", package: "ocmock"),
  918. ],
  919. path: "FirebasePerformance/Tests/Unit",
  920. resources: [
  921. .process("FPRURLFilterTests-Info.plist"),
  922. .process("Server/smallDownloadFile"),
  923. .process("Server/bigDownloadFile"),
  924. ],
  925. cSettings: [
  926. .headerSearchPath("../../.."),
  927. .define("PB_FIELD_32BIT", to: "1"),
  928. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  929. .define("PB_ENABLE_MALLOC", to: "1"),
  930. ]
  931. ),
  932. .target(
  933. name: "SharedTestUtilities",
  934. dependencies: ["FirebaseCore",
  935. "FirebaseAppCheckInterop",
  936. "FirebaseAuthInterop",
  937. "FirebaseMessagingInterop",
  938. "GoogleDataTransport",
  939. .product(name: "OCMock", package: "ocmock")],
  940. path: "SharedTestUtilities",
  941. publicHeadersPath: "./",
  942. cSettings: [
  943. .headerSearchPath("../"),
  944. ]
  945. ),
  946. // MARK: - Firebase Remote Config
  947. .target(
  948. name: "FirebaseRemoteConfig",
  949. dependencies: [
  950. "FirebaseCore",
  951. "FirebaseABTesting",
  952. "FirebaseInstallations",
  953. .product(name: "GULNSData", package: "GoogleUtilities"),
  954. ],
  955. path: "FirebaseRemoteConfig/Sources",
  956. publicHeadersPath: "Public",
  957. cSettings: [
  958. .headerSearchPath("../../"),
  959. ]
  960. ),
  961. .testTarget(
  962. name: "RemoteConfigUnit",
  963. dependencies: ["FirebaseRemoteConfig", .product(name: "OCMock", package: "ocmock")],
  964. path: "FirebaseRemoteConfig/Tests/Unit",
  965. exclude: [
  966. // Need to be evaluated/ported to RC V2.
  967. "RCNConfigAnalyticsTest.m",
  968. "RCNConfigSettingsTest.m",
  969. "RCNConfigTest.m",
  970. "RCNRemoteConfig+FIRAppTest.m",
  971. "RCNThrottlingTests.m",
  972. ],
  973. resources: [
  974. .process("SecondApp-GoogleService-Info.plist"),
  975. .process("Defaults-testInfo.plist"),
  976. .process("TestABTPayload.txt"),
  977. ],
  978. cSettings: [
  979. .headerSearchPath("../../.."),
  980. ]
  981. ),
  982. .target(
  983. name: "FirebaseRemoteConfigSwift",
  984. dependencies: [
  985. "FirebaseRemoteConfig",
  986. "FirebaseSharedSwift",
  987. ],
  988. path: "FirebaseRemoteConfigSwift/Sources"
  989. ),
  990. .testTarget(
  991. name: "RemoteConfigFakeConsole",
  992. dependencies: ["FirebaseRemoteConfigSwift",
  993. "RemoteConfigFakeConsoleObjC"],
  994. path: "FirebaseRemoteConfigSwift/Tests",
  995. exclude: [
  996. "AccessToken.json",
  997. "README.md",
  998. "ObjC/",
  999. ],
  1000. resources: [
  1001. .process("Defaults-testInfo.plist"),
  1002. ],
  1003. cSettings: [
  1004. .headerSearchPath("../../"),
  1005. ]
  1006. ),
  1007. .target(
  1008. name: "RemoteConfigFakeConsoleObjC",
  1009. dependencies: [.product(name: "OCMock", package: "ocmock")],
  1010. path: "FirebaseRemoteConfigSwift/Tests/ObjC",
  1011. publicHeadersPath: ".",
  1012. cSettings: [
  1013. .headerSearchPath("../../../"),
  1014. ]
  1015. ),
  1016. // MARK: - Firebase Sessions
  1017. .target(
  1018. name: "FirebaseSessions",
  1019. dependencies: [
  1020. "FirebaseCore",
  1021. "FirebaseInstallations",
  1022. "FirebaseCoreExtension",
  1023. "FirebaseSessionsObjC",
  1024. .product(name: "Promises", package: "Promises"),
  1025. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  1026. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1027. ],
  1028. path: "FirebaseSessions/Sources",
  1029. cSettings: [
  1030. .headerSearchPath(".."),
  1031. .define("DISPLAY_VERSION", to: firebaseVersion),
  1032. .define("PB_FIELD_32BIT", to: "1"),
  1033. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  1034. .define("PB_ENABLE_MALLOC", to: "1"),
  1035. ],
  1036. linkerSettings: [
  1037. .linkedFramework("Security"),
  1038. .linkedFramework(
  1039. "SystemConfiguration",
  1040. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1041. ),
  1042. ]
  1043. ),
  1044. // The Sessions SDK is Swift-first with Objective-C code to support
  1045. // nanopb. Because Swift Package Manager doesn't support mixed
  1046. // language targets, the ObjC code has been extracted out into
  1047. // a separate target.
  1048. .target(
  1049. name: "FirebaseSessionsObjC",
  1050. dependencies: [
  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. "FirebaseInAppMessaging",
  1143. .target(name: "FirebaseInAppMessagingSwift",
  1144. condition: .when(platforms: [.iOS, .tvOS])),
  1145. "FirebaseInstallations",
  1146. "FirebaseMessaging",
  1147. .target(name: "FirebasePerformance",
  1148. condition: .when(platforms: [.iOS, .tvOS])),
  1149. "FirebaseRemoteConfig",
  1150. "FirebaseSessions",
  1151. "FirebaseStorage",
  1152. .product(name: "nanopb", package: "nanopb"),
  1153. ],
  1154. path: "SwiftPMTests/swift-test"
  1155. ),
  1156. .testTarget(
  1157. name: "analytics-import-test",
  1158. dependencies: [
  1159. "FirebaseAnalyticsSwiftTarget",
  1160. "FirebaseAnalyticsWrapper",
  1161. "Firebase",
  1162. ],
  1163. path: "SwiftPMTests/analytics-import-test"
  1164. ),
  1165. .testTarget(
  1166. name: "objc-import-test",
  1167. dependencies: [
  1168. "Firebase",
  1169. "FirebaseAuth",
  1170. "FirebaseABTesting",
  1171. "FirebaseAppCheck",
  1172. .target(name: "FirebaseAppDistribution",
  1173. condition: .when(platforms: [.iOS])),
  1174. "FirebaseCrashlytics",
  1175. "FirebaseCore",
  1176. "FirebaseDatabase",
  1177. "FirebaseDynamicLinks",
  1178. "FirebaseFirestoreTarget",
  1179. "FirebaseFunctions",
  1180. "FirebaseInAppMessaging",
  1181. "FirebaseInstallations",
  1182. "FirebaseMessaging",
  1183. .target(name: "FirebasePerformance",
  1184. condition: .when(platforms: [.iOS, .tvOS])),
  1185. "FirebaseRemoteConfig",
  1186. "FirebaseStorage",
  1187. ],
  1188. path: "SwiftPMTests/objc-import-test"
  1189. ),
  1190. .testTarget(
  1191. name: "version-test",
  1192. dependencies: [
  1193. "FirebaseCore",
  1194. ],
  1195. path: "SwiftPMTests/version-test",
  1196. cSettings: [
  1197. .define("FIR_VERSION", to: firebaseVersion),
  1198. ]
  1199. ),
  1200. // MARK: - Firebase App Check
  1201. .target(name: "FirebaseAppCheck",
  1202. dependencies: [
  1203. "FirebaseCore",
  1204. .product(name: "FBLPromises", package: "Promises"),
  1205. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1206. ],
  1207. path: "FirebaseAppCheck/Sources",
  1208. publicHeadersPath: "Public",
  1209. cSettings: [
  1210. .headerSearchPath("../.."),
  1211. ],
  1212. linkerSettings: [
  1213. .linkedFramework(
  1214. "DeviceCheck",
  1215. .when(platforms: [.iOS, .macCatalyst, .macOS, .tvOS])
  1216. ),
  1217. ]),
  1218. // Internal headers only for consuming from Swift.
  1219. .target(
  1220. name: "FirebaseAppCheckInterop",
  1221. path: "FirebaseAppCheck/Interop",
  1222. exclude: [
  1223. "CMakeLists.txt",
  1224. ],
  1225. publicHeadersPath: ".",
  1226. cSettings: [
  1227. .headerSearchPath("../../"),
  1228. ]
  1229. ),
  1230. .testTarget(
  1231. name: "FirebaseAppCheckUnit",
  1232. dependencies: [
  1233. "FirebaseAppCheck",
  1234. "SharedTestUtilities",
  1235. .product(name: "OCMock", package: "ocmock"),
  1236. ],
  1237. path: "FirebaseAppCheck/Tests",
  1238. exclude: [
  1239. // Swift tests are in the target `FirebaseAppCheckUnitSwift` since mixed language targets
  1240. // are not supported (as of Xcode 14.3).
  1241. "Unit/Swift",
  1242. ],
  1243. resources: [
  1244. .process("Fixture"),
  1245. ],
  1246. cSettings: [
  1247. .headerSearchPath("../.."),
  1248. ]
  1249. ),
  1250. .testTarget(
  1251. name: "FirebaseAppCheckUnitSwift",
  1252. dependencies: ["FirebaseAppCheck"],
  1253. path: "FirebaseAppCheck/Tests/Unit/Swift",
  1254. cSettings: [
  1255. .headerSearchPath("../.."),
  1256. ]
  1257. ),
  1258. // MARK: Testing support
  1259. .target(
  1260. name: "FirebaseFirestoreTestingSupport",
  1261. dependencies: ["FirebaseFirestoreTarget"],
  1262. path: "FirebaseTestingSupport/Firestore/Sources",
  1263. publicHeadersPath: "./",
  1264. cSettings: [
  1265. .headerSearchPath("../../.."),
  1266. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  1267. ]
  1268. ),
  1269. .testTarget(
  1270. name: "FirestoreTestingSupportTests",
  1271. dependencies: ["FirebaseFirestoreTestingSupport"],
  1272. path: "FirebaseTestingSupport/Firestore/Tests",
  1273. cSettings: [
  1274. .headerSearchPath("../../.."),
  1275. ]
  1276. ),
  1277. ],
  1278. cLanguageStandard: .c99,
  1279. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  1280. )
  1281. // This is set when running `scripts/check_firestore_symbols.sh`.
  1282. if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil {
  1283. if let firestoreIndex = package.targets
  1284. .firstIndex(where: { $0.name == "FirebaseFirestore" }) {
  1285. package.targets[firestoreIndex] = .binaryTarget(
  1286. name: "FirebaseFirestore",
  1287. // The `xcframework` should be moved to the root of the repo.
  1288. path: "FirebaseFirestore.xcframework"
  1289. )
  1290. }
  1291. }
  1292. // MARK: - Helper Functions
  1293. func googleAppMeasurementDependency() -> Package.Dependency {
  1294. let appMeasurementURL = "https://github.com/google/GoogleAppMeasurement.git"
  1295. // Point SPM CI to the tip of main of https://github.com/google/GoogleAppMeasurement so that the
  1296. // release process can defer publishing the GoogleAppMeasurement tag until after testing.
  1297. if ProcessInfo.processInfo.environment["FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT"] != nil {
  1298. return .package(url: appMeasurementURL, branch: "main")
  1299. }
  1300. return .package(url: appMeasurementURL, exact: "10.11.0")
  1301. }