Package.swift 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157
  1. // swift-tools-version:5.3
  2. // The swift-tools-version declares the minimum version of Swift required to build this package.
  3. // Copyright 2020 Google LLC
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License");
  6. // you may not use this file except in compliance with the License.
  7. // You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. import PackageDescription
  17. let firebaseVersion = "8.11.0"
  18. let package = Package(
  19. name: "Firebase",
  20. platforms: [.iOS(.v11), .macOS(.v10_12), .tvOS(.v12), .watchOS(.v7)],
  21. products: [
  22. .library(
  23. name: "FirebaseAnalytics",
  24. targets: ["FirebaseAnalyticsTarget"]
  25. ),
  26. .library(
  27. name: "FirebaseAnalyticsWithoutAdIdSupport",
  28. targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"]
  29. ),
  30. .library(
  31. name: "FirebaseAnalyticsSwift-Beta",
  32. targets: ["FirebaseAnalyticsSwiftTarget"]
  33. ),
  34. .library(
  35. name: "FirebaseAuth",
  36. targets: ["FirebaseAuth"]
  37. ),
  38. .library(
  39. name: "FirebaseAppCheck",
  40. targets: ["FirebaseAppCheck"]
  41. ),
  42. .library(
  43. name: "FirebaseAppDistribution-Beta",
  44. targets: ["FirebaseAppDistributionTarget"]
  45. ),
  46. .library(
  47. name: "FirebaseAuthCombine-Community",
  48. targets: ["FirebaseAuthCombineSwift"]
  49. ),
  50. .library(
  51. name: "FirebaseFirestoreCombine-Community",
  52. targets: ["FirebaseFirestoreCombineSwift"]
  53. ),
  54. .library(
  55. name: "FirebaseFunctionsCombine-Community",
  56. targets: ["FirebaseFunctionsCombineSwift"]
  57. ),
  58. .library(
  59. name: "FirebaseStorageCombine-Community",
  60. targets: ["FirebaseStorageCombineSwift"]
  61. ),
  62. .library(
  63. name: "FirebaseCrashlytics",
  64. targets: ["FirebaseCrashlytics"]
  65. ),
  66. .library(
  67. name: "FirebaseDatabase",
  68. targets: ["FirebaseDatabase"]
  69. ),
  70. .library(
  71. name: "FirebaseDatabaseSwift-Beta",
  72. targets: ["FirebaseDatabaseSwift"]
  73. ),
  74. .library(
  75. name: "FirebaseDynamicLinks",
  76. targets: ["FirebaseDynamicLinksTarget"]
  77. ),
  78. .library(
  79. name: "FirebaseFirestore",
  80. targets: ["FirebaseFirestoreTarget"]
  81. ),
  82. .library(
  83. name: "FirebaseFirestoreSwift-Beta",
  84. targets: ["FirebaseFirestoreSwiftTarget"]
  85. ),
  86. .library(
  87. name: "FirebaseFunctions",
  88. targets: ["FirebaseFunctions"]
  89. ),
  90. .library(
  91. name: "FirebaseFunctionsSwift-Beta",
  92. targets: ["FirebaseFunctionsSwift"]
  93. ),
  94. .library(
  95. name: "FirebaseInAppMessaging-Beta",
  96. targets: ["FirebaseInAppMessagingTarget"]
  97. ),
  98. .library(
  99. name: "FirebaseInAppMessagingSwift-Beta",
  100. targets: ["FirebaseInAppMessagingSwift"]
  101. ),
  102. .library(
  103. name: "FirebaseInstallations",
  104. targets: ["FirebaseInstallations"]
  105. ),
  106. .library(
  107. name: "FirebaseMessaging",
  108. targets: ["FirebaseMessaging"]
  109. ),
  110. .library(
  111. name: "FirebaseMLModelDownloader",
  112. targets: ["FirebaseMLModelDownloader"]
  113. ),
  114. .library(
  115. name: "FirebasePerformance",
  116. targets: ["FirebasePerformanceTarget"]
  117. ),
  118. .library(
  119. name: "FirebaseRemoteConfig",
  120. targets: ["FirebaseRemoteConfig"]
  121. ),
  122. .library(
  123. name: "FirebaseStorage",
  124. targets: ["FirebaseStorage"]
  125. ),
  126. .library(
  127. name: "FirebaseStorageSwift-Beta",
  128. targets: ["FirebaseStorageSwift"]
  129. ),
  130. ],
  131. dependencies: [
  132. .package(
  133. name: "Promises",
  134. url: "https://github.com/google/promises.git",
  135. "1.2.8" ..< "3.0.0"
  136. ),
  137. .package(
  138. name: "SwiftProtobuf",
  139. url: "https://github.com/apple/swift-protobuf.git",
  140. "1.15.0" ..< "2.0.0"
  141. ),
  142. .package(
  143. name: "GoogleAppMeasurement",
  144. url: "https://github.com/google/GoogleAppMeasurement.git",
  145. // Note that CI changes the version to the head of main for CI.
  146. // See scripts/setup_spm_tests.sh.
  147. .exact("8.9.1")
  148. ),
  149. .package(
  150. name: "GoogleDataTransport",
  151. url: "https://github.com/google/GoogleDataTransport.git",
  152. "9.1.2" ..< "10.0.0"
  153. ),
  154. .package(
  155. name: "GoogleUtilities",
  156. url: "https://github.com/google/GoogleUtilities.git",
  157. "7.6.0" ..< "8.0.0"
  158. ),
  159. .package(
  160. name: "GTMSessionFetcher",
  161. url: "https://github.com/google/gtm-session-fetcher.git",
  162. "1.5.0" ..< "2.0.0"
  163. ),
  164. .package(
  165. name: "nanopb",
  166. url: "https://github.com/firebase/nanopb.git",
  167. "2.30908.0" ..< "2.30909.0"
  168. ),
  169. .package(
  170. name: "abseil",
  171. url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
  172. "0.20200225.4" ..< "0.20200226.0"
  173. ),
  174. .package(
  175. name: "gRPC",
  176. url: "https://github.com/firebase/grpc-SwiftPM.git",
  177. "1.28.4" ..< "1.29.0"
  178. ),
  179. .package(
  180. name: "OCMock",
  181. url: "https://github.com/erikdoe/ocmock.git",
  182. .revision("c5eeaa6dde7c308a5ce48ae4d4530462dd3a1110")
  183. ),
  184. .package(
  185. name: "leveldb",
  186. url: "https://github.com/firebase/leveldb.git",
  187. "1.22.2" ..< "1.23.0"
  188. ),
  189. .package(
  190. name: "GCDWebServer",
  191. url: "https://github.com/SlaunchaMan/GCDWebServer.git",
  192. .revision("935e2736044e71e5341663c3cc9a335ba6867a2b")
  193. ),
  194. // Branches need a force update with a run with the revision set like below.
  195. // .package(url: "https://github.com/paulb777/nanopb.git", .revision("564392bd87bd093c308a3aaed3997466efb95f74"))
  196. ],
  197. targets: [
  198. .target(
  199. name: "Firebase",
  200. path: "CoreOnly/Sources",
  201. publicHeadersPath: "./"
  202. ),
  203. .target(
  204. name: "FirebaseCore",
  205. dependencies: [
  206. "Firebase",
  207. "FirebaseCoreDiagnostics",
  208. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  209. .product(name: "GULLogger", package: "GoogleUtilities"),
  210. ],
  211. path: "FirebaseCore/Sources",
  212. publicHeadersPath: "Public",
  213. cSettings: [
  214. .headerSearchPath("../.."),
  215. .define("Firebase_VERSION", to: firebaseVersion),
  216. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  217. ],
  218. linkerSettings: [
  219. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  220. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  221. ]
  222. ),
  223. .testTarget(
  224. name: "CoreUnit",
  225. dependencies: ["FirebaseCore", "SharedTestUtilities", "OCMock"],
  226. path: "FirebaseCore/Tests/Unit",
  227. exclude: ["Resources/GoogleService-Info.plist"],
  228. cSettings: [
  229. .headerSearchPath("../../.."),
  230. ]
  231. ),
  232. .target(
  233. name: "FirebaseCoreDiagnostics",
  234. dependencies: [
  235. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  236. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  237. .product(name: "GULLogger", package: "GoogleUtilities"),
  238. .product(name: "nanopb", package: "nanopb"),
  239. ],
  240. path: "Firebase/CoreDiagnostics/FIRCDLibrary",
  241. publicHeadersPath: ".",
  242. cSettings: [
  243. .headerSearchPath("../../.."),
  244. .define("PB_FIELD_32BIT", to: "1"),
  245. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  246. .define("PB_ENABLE_MALLOC", to: "1"),
  247. ]
  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", "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, .macOS, .tvOS]))],
  271. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
  272. ),
  273. .target(
  274. name: "FirebaseAnalyticsWrapper",
  275. dependencies: [
  276. .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
  277. .product(name: "GoogleAppMeasurement",
  278. package: "GoogleAppMeasurement",
  279. condition: .when(platforms: [.iOS, .macOS, .tvOS])),
  280. "FirebaseCore",
  281. "FirebaseInstallations",
  282. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  283. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  284. .product(name: "GULNSData", package: "GoogleUtilities"),
  285. .product(name: "GULNetwork", package: "GoogleUtilities"),
  286. .product(name: "nanopb", package: "nanopb"),
  287. ],
  288. path: "FirebaseAnalyticsWrapper",
  289. linkerSettings: [
  290. .linkedLibrary("sqlite3"),
  291. .linkedLibrary("c++"),
  292. .linkedLibrary("z"),
  293. .linkedFramework("StoreKit"),
  294. ]
  295. ),
  296. .binaryTarget(
  297. name: "FirebaseAnalytics",
  298. url: "https://dl.google.com/firebase/ios/swiftpm/8.9.1/FirebaseAnalytics.zip",
  299. checksum: "397688619b1d2eb2731fd06d094b95498e753519b4c0c75a6f7071bcafd9d1f1"
  300. ),
  301. .target(
  302. name: "FirebaseAnalyticsSwiftTarget",
  303. dependencies: [.target(name: "FirebaseAnalyticsSwift",
  304. condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
  305. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
  306. ),
  307. .target(
  308. name: "FirebaseAnalyticsSwift",
  309. dependencies: ["FirebaseAnalyticsWrapper"],
  310. path: "FirebaseAnalyticsSwift/Sources"
  311. ),
  312. .target(
  313. name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
  314. dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  315. condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
  316. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
  317. ),
  318. .target(
  319. name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  320. dependencies: [
  321. .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
  322. .product(name: "GoogleAppMeasurementWithoutAdIdSupport",
  323. package: "GoogleAppMeasurement",
  324. condition: .when(platforms: [.iOS])),
  325. "FirebaseCore",
  326. "FirebaseInstallations",
  327. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  328. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  329. .product(name: "GULNSData", package: "GoogleUtilities"),
  330. .product(name: "GULNetwork", package: "GoogleUtilities"),
  331. .product(name: "nanopb", package: "nanopb"),
  332. ],
  333. path: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  334. linkerSettings: [
  335. .linkedLibrary("sqlite3"),
  336. .linkedLibrary("c++"),
  337. .linkedLibrary("z"),
  338. .linkedFramework("StoreKit"),
  339. ]
  340. ),
  341. .target(
  342. name: "FirebaseAppDistributionTarget",
  343. dependencies: [.target(name: "FirebaseAppDistribution",
  344. condition: .when(platforms: [.iOS]))],
  345. path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
  346. ),
  347. .target(
  348. name: "FirebaseAppDistribution",
  349. dependencies: [
  350. "FirebaseCore",
  351. "FirebaseInstallations",
  352. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  353. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  354. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  355. ],
  356. path: "FirebaseAppDistribution/Sources",
  357. publicHeadersPath: "Public",
  358. cSettings: [
  359. .headerSearchPath("../../"),
  360. ]
  361. ),
  362. .testTarget(
  363. name: "AppDistributionUnit",
  364. dependencies: ["FirebaseAppDistribution", "OCMock"],
  365. path: "FirebaseAppDistribution/Tests/Unit",
  366. resources: [.process("Resources")],
  367. cSettings: [
  368. .headerSearchPath("../../.."),
  369. ]
  370. ),
  371. .target(
  372. name: "FirebaseAuth",
  373. dependencies: [
  374. "FirebaseCore",
  375. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  376. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  377. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  378. ],
  379. path: "FirebaseAuth/Sources",
  380. publicHeadersPath: "Public",
  381. cSettings: [
  382. .headerSearchPath("../../"),
  383. ],
  384. linkerSettings: [
  385. .linkedFramework("Security"),
  386. .linkedFramework("SafariServices", .when(platforms: [.iOS])),
  387. ]
  388. ),
  389. .testTarget(
  390. name: "AuthUnit",
  391. dependencies: ["FirebaseAuth", "OCMock"],
  392. path: "FirebaseAuth/Tests/Unit",
  393. exclude: [
  394. "FIRAuthKeychainServicesTests.m", // TODO: figure out SPM keychain testing
  395. "FIRAuthTests.m",
  396. "FIRUserTests.m",
  397. ],
  398. cSettings: [
  399. .headerSearchPath("../../.."),
  400. ]
  401. ),
  402. .target(
  403. name: "FirebaseAuthCombineSwift",
  404. dependencies: ["FirebaseAuth"],
  405. path: "FirebaseCombineSwift/Sources/Auth"
  406. ),
  407. .target(
  408. name: "FirebaseFirestoreCombineSwift",
  409. dependencies: [
  410. "FirebaseFirestore",
  411. "FirebaseFirestoreSwift",
  412. ],
  413. path: "FirebaseCombineSwift/Sources/Firestore"
  414. ),
  415. .target(
  416. name: "FirebaseStorageCombineSwift",
  417. dependencies: [
  418. "FirebaseStorage",
  419. "FirebaseStorageSwift",
  420. ],
  421. path: "FirebaseCombineSwift/Sources/Storage"
  422. ),
  423. .target(
  424. name: "FirebaseCrashlytics",
  425. dependencies: ["FirebaseCore", "FirebaseInstallations",
  426. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  427. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  428. .product(name: "FBLPromises", package: "Promises"),
  429. .product(name: "nanopb", package: "nanopb")],
  430. path: "Crashlytics",
  431. exclude: [
  432. "run",
  433. "CHANGELOG.md",
  434. "LICENSE",
  435. "README.md",
  436. "ProtoSupport/",
  437. "UnitTests/",
  438. "generate_project.sh",
  439. "upload-symbols",
  440. "third_party/libunwind/LICENSE",
  441. ],
  442. sources: [
  443. "Crashlytics/",
  444. "Protogen/",
  445. "Shared/",
  446. "third_party/libunwind/dwarf.h",
  447. ],
  448. publicHeadersPath: "Crashlytics/Public",
  449. cSettings: [
  450. .headerSearchPath(".."),
  451. .define("DISPLAY_VERSION", to: firebaseVersion),
  452. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  453. .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: [.macOS])),
  454. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  455. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  456. .define("PB_FIELD_32BIT", to: "1"),
  457. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  458. .define("PB_ENABLE_MALLOC", to: "1"),
  459. ],
  460. linkerSettings: [
  461. .linkedFramework("Security"),
  462. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  463. ]
  464. ),
  465. .target(
  466. name: "FirebaseDatabase",
  467. dependencies: [
  468. "FirebaseCore",
  469. "leveldb",
  470. ],
  471. path: "FirebaseDatabase/Sources",
  472. exclude: [
  473. "third_party/Wrap-leveldb/LICENSE",
  474. "third_party/SocketRocket/LICENSE",
  475. "third_party/FImmutableSortedDictionary/LICENSE",
  476. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  477. ],
  478. publicHeadersPath: "Public",
  479. cSettings: [
  480. .headerSearchPath("../../"),
  481. ],
  482. linkerSettings: [
  483. .linkedFramework("CFNetwork"),
  484. .linkedFramework("Security"),
  485. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  486. .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
  487. ]
  488. ),
  489. .testTarget(
  490. name: "DatabaseUnit",
  491. dependencies: ["FirebaseDatabase", "OCMock", "SharedTestUtilities"],
  492. path: "FirebaseDatabase/Tests/",
  493. exclude: [
  494. // Disable Swift tests as mixed targets are not supported (Xcode 12.4).
  495. "Unit/Swift",
  496. "Integration/",
  497. ],
  498. resources: [.process("Resources")],
  499. cSettings: [
  500. .headerSearchPath("../.."),
  501. ]
  502. ),
  503. .testTarget(
  504. name: "DatabaseUnitSwift",
  505. dependencies: ["FirebaseDatabase"],
  506. path: "FirebaseDatabase/Tests/Unit/Swift",
  507. cSettings: [
  508. .headerSearchPath("../.."),
  509. ]
  510. ),
  511. .target(
  512. name: "FirebaseDatabaseSwift",
  513. dependencies: ["FirebaseDatabase", "FirebaseSharedSwift"],
  514. path: "FirebaseDatabaseSwift/Sources"
  515. ),
  516. .testTarget(
  517. name: "FirebaseDatabaseSwiftTests",
  518. dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
  519. path: "FirebaseDatabaseSwift/Tests/"
  520. ),
  521. .target(
  522. name: "FirebaseSharedSwift",
  523. path: "FirebaseSharedSwift/Sources",
  524. exclude: [
  525. "third_party/FirebaseDataEncoder/LICENSE",
  526. "third_party/FirebaseDataEncoder/METADATA",
  527. ]
  528. ),
  529. .testTarget(
  530. name: "FirebaseSharedSwiftTests",
  531. dependencies: ["FirebaseSharedSwift"],
  532. path: "FirebaseSharedSwift/Tests/"
  533. ),
  534. .target(
  535. name: "FirebaseDynamicLinksTarget",
  536. dependencies: [.target(name: "FirebaseDynamicLinks",
  537. condition: .when(platforms: [.iOS]))],
  538. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  539. ),
  540. .target(
  541. name: "FirebaseDynamicLinks",
  542. dependencies: ["FirebaseCore"],
  543. path: "FirebaseDynamicLinks/Sources",
  544. publicHeadersPath: "Public",
  545. cSettings: [
  546. .headerSearchPath("../../"),
  547. .define("FIRDynamicLinks3P", to: "1"),
  548. .define("GIN_SCION_LOGGING", to: "1"),
  549. ],
  550. linkerSettings: [
  551. .linkedFramework("QuartzCore"),
  552. ]
  553. ),
  554. .target(
  555. name: "FirebaseFirestoreTarget",
  556. dependencies: [.target(name: "FirebaseFirestore",
  557. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  558. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  559. ),
  560. .target(
  561. name: "FirebaseFirestore",
  562. dependencies: [
  563. "FirebaseCore",
  564. "leveldb",
  565. .product(name: "nanopb", package: "nanopb"),
  566. .product(name: "abseil", package: "abseil"),
  567. .product(name: "gRPC-cpp", package: "gRPC"),
  568. ],
  569. path: "Firestore",
  570. exclude: [
  571. "CHANGELOG.md",
  572. "CMakeLists.txt",
  573. "Example/",
  574. "LICENSE",
  575. "Protos/CMakeLists.txt",
  576. "Protos/Podfile",
  577. "Protos/README.md",
  578. "Protos/build_protos.py",
  579. "Protos/cpp/",
  580. "Protos/lib/",
  581. "Protos/nanopb_cpp_generator.py",
  582. "Protos/protos/",
  583. "README.md",
  584. "Source/CMakeLists.txt",
  585. "Swift/",
  586. "core/CMakeLists.txt",
  587. "core/src/util/config_detected.h.in",
  588. "core/test/",
  589. "fuzzing/",
  590. "test.sh",
  591. // Swift PM doesn't recognize hpp files, so we're relying on search paths
  592. // to find third_party/nlohmann_json/json.hpp.
  593. "third_party/",
  594. // Exclude alternate implementations for other platforms
  595. "core/src/remote/connectivity_monitor_noop.cc",
  596. "core/src/util/filesystem_win.cc",
  597. "core/src/util/log_stdio.cc",
  598. "core/src/util/secure_random_openssl.cc",
  599. ],
  600. sources: [
  601. "Source/",
  602. "Protos/nanopb/",
  603. "core/include/",
  604. "core/src",
  605. ],
  606. publicHeadersPath: "Source/Public",
  607. cSettings: [
  608. .headerSearchPath("../"),
  609. .headerSearchPath("Source/Public/FirebaseFirestore"),
  610. .headerSearchPath("Protos/nanopb"),
  611. .define("PB_FIELD_32BIT", to: "1"),
  612. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  613. .define("PB_ENABLE_MALLOC", to: "1"),
  614. .define("FIRFirestore_VERSION", to: firebaseVersion),
  615. ],
  616. linkerSettings: [
  617. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  618. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  619. .linkedLibrary("c++"),
  620. ]
  621. ),
  622. .target(
  623. name: "FirebaseFirestoreSwiftTarget",
  624. dependencies: [.target(name: "FirebaseFirestoreSwift",
  625. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  626. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  627. ),
  628. .target(
  629. name: "FirebaseFirestoreSwift",
  630. dependencies: ["FirebaseFirestore"],
  631. path: "Firestore",
  632. exclude: [
  633. "CHANGELOG.md",
  634. "CMakeLists.txt",
  635. "Example/",
  636. "LICENSE",
  637. "Protos/",
  638. "README.md",
  639. "Source/",
  640. "core/",
  641. "fuzzing/",
  642. "test.sh",
  643. "Swift/CHANGELOG.md",
  644. "Swift/README.md",
  645. "Swift/Tests/",
  646. "third_party/nlohmann_json",
  647. "third_party/FirestoreEncoder/LICENSE",
  648. "third_party/FirestoreEncoder/METADATA",
  649. ],
  650. sources: [
  651. "Swift/Source/",
  652. "third_party/FirestoreEncoder/",
  653. ]
  654. ),
  655. // MARK: - Firebase Functions
  656. .target(
  657. name: "FirebaseFunctions",
  658. dependencies: [
  659. "FirebaseCore",
  660. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  661. ],
  662. path: "FirebaseFunctions/Sources",
  663. publicHeadersPath: "Public",
  664. cSettings: [
  665. .headerSearchPath("../../"),
  666. ]
  667. ),
  668. .target(
  669. name: "FirebaseFunctionsSwift",
  670. dependencies: [
  671. "FirebaseFunctions",
  672. "FirebaseSharedSwift",
  673. ],
  674. path: "FirebaseFunctionsSwift/Sources"
  675. ),
  676. .testTarget(
  677. name: "FirebaseFunctionsSwiftUnit",
  678. dependencies: ["FirebaseFunctionsSwift",
  679. "FirebaseFunctionsTestingSupport",
  680. "SharedTestUtilities"],
  681. path: "FirebaseFunctionsSwift/Tests"
  682. ),
  683. .target(
  684. name: "FirebaseFunctionsCombineSwift",
  685. dependencies: ["FirebaseFunctions"],
  686. path: "FirebaseCombineSwift/Sources/Functions"
  687. ),
  688. .testTarget(
  689. name: "FunctionsCombineUnit",
  690. dependencies: ["FirebaseFunctionsCombineSwift",
  691. "FirebaseFunctionsTestingSupport",
  692. "SharedTestUtilities"],
  693. path: "FirebaseFunctions/Tests/CombineUnit"
  694. ),
  695. .testTarget(
  696. name: "FunctionsUnit",
  697. dependencies: ["FirebaseFunctions",
  698. "SharedTestUtilities"],
  699. path: "FirebaseFunctions/Tests/Unit",
  700. cSettings: [
  701. .headerSearchPath("../../../"),
  702. ]
  703. ),
  704. .testTarget(
  705. name: "FunctionsUnitSwift",
  706. dependencies: ["FirebaseFunctions"],
  707. path: "FirebaseFunctions/Tests/SwiftUnit"
  708. ),
  709. .testTarget(
  710. name: "FunctionsIntegration",
  711. dependencies: ["FirebaseFunctions",
  712. "SharedTestUtilities"],
  713. path: "FirebaseFunctions/Tests/Integration",
  714. cSettings: [
  715. .headerSearchPath("../../../"),
  716. ]
  717. ),
  718. .testTarget(
  719. name: "FunctionsSwiftIntegration",
  720. dependencies: ["FirebaseFunctions",
  721. "FirebaseFunctionsTestingSupport",
  722. "SharedTestUtilities"],
  723. path: "FirebaseFunctions/Tests/SwiftIntegration"
  724. ),
  725. .target(
  726. name: "FirebaseFunctionsTestingSupport",
  727. dependencies: ["FirebaseFunctions"],
  728. path: "FirebaseTestingSupport/Functions/Sources",
  729. publicHeadersPath: "Public",
  730. cSettings: [
  731. .headerSearchPath("../../.."),
  732. ]
  733. ),
  734. // MARK: - Firebase In App Messaging
  735. .target(
  736. name: "FirebaseInAppMessagingTarget",
  737. dependencies: [
  738. .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
  739. ],
  740. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  741. ),
  742. .target(
  743. name: "FirebaseInAppMessaging",
  744. dependencies: [
  745. "FirebaseCore",
  746. "FirebaseInstallations",
  747. "FirebaseABTesting",
  748. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  749. .product(name: "nanopb", package: "nanopb"),
  750. .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
  751. ],
  752. path: "FirebaseInAppMessaging/Sources",
  753. exclude: [
  754. "DefaultUI/CHANGELOG.md",
  755. "DefaultUI/README.md",
  756. ],
  757. publicHeadersPath: "Public",
  758. cSettings: [
  759. .headerSearchPath("../../"),
  760. .define("PB_FIELD_32BIT", to: "1"),
  761. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  762. .define("PB_ENABLE_MALLOC", to: "1"),
  763. ]
  764. ),
  765. .target(
  766. name: "FirebaseInAppMessaging_iOS",
  767. path: "FirebaseInAppMessaging/iOS",
  768. resources: [.process("Resources")]
  769. ),
  770. .target(
  771. name: "FirebaseInAppMessagingSwift",
  772. dependencies: ["FirebaseInAppMessaging"],
  773. path: "FirebaseInAppMessaging/Swift/Source"
  774. ),
  775. .target(
  776. name: "FirebaseInstallations",
  777. dependencies: [
  778. "FirebaseCore",
  779. .product(name: "FBLPromises", package: "Promises"),
  780. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  781. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  782. ],
  783. path: "FirebaseInstallations/Source/Library",
  784. publicHeadersPath: "Public",
  785. cSettings: [
  786. .headerSearchPath("../../../"),
  787. ],
  788. linkerSettings: [
  789. .linkedFramework("Security"),
  790. ]
  791. ),
  792. .target(
  793. name: "FirebaseMLModelDownloader",
  794. dependencies: [
  795. "FirebaseCore",
  796. "FirebaseInstallations",
  797. .product(name: "GULLogger", package: "GoogleUtilities"),
  798. "SwiftProtobuf",
  799. ],
  800. path: "FirebaseMLModelDownloader/Sources",
  801. exclude: [
  802. "proto/firebase_ml_log_sdk.proto",
  803. ],
  804. cSettings: [
  805. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  806. ]
  807. ),
  808. .testTarget(
  809. name: "FirebaseMLModelDownloaderUnit",
  810. dependencies: ["FirebaseMLModelDownloader"],
  811. path: "FirebaseMLModelDownloader/Tests/Unit"
  812. ),
  813. .target(
  814. name: "FirebaseMessaging",
  815. dependencies: [
  816. "FirebaseCore",
  817. "FirebaseInstallations",
  818. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  819. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  820. .product(name: "GULReachability", package: "GoogleUtilities"),
  821. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  822. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  823. .product(name: "nanopb", package: "nanopb"),
  824. ],
  825. path: "FirebaseMessaging/Sources",
  826. publicHeadersPath: "Public",
  827. cSettings: [
  828. .headerSearchPath("../../"),
  829. .define("PB_FIELD_32BIT", to: "1"),
  830. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  831. .define("PB_ENABLE_MALLOC", to: "1"),
  832. ],
  833. linkerSettings: [
  834. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  835. ]
  836. ),
  837. .testTarget(
  838. name: "MessagingUnit",
  839. dependencies: ["FirebaseMessaging", "SharedTestUtilities", "OCMock"],
  840. path: "FirebaseMessaging/Tests/UnitTests",
  841. exclude: [
  842. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  843. ],
  844. cSettings: [
  845. .headerSearchPath("../../.."),
  846. ]
  847. ),
  848. .target(
  849. name: "FirebasePerformanceTarget",
  850. dependencies: [.target(name: "FirebasePerformance",
  851. condition: .when(platforms: [.iOS, .tvOS]))],
  852. path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
  853. ),
  854. .target(
  855. name: "FirebasePerformance",
  856. dependencies: [
  857. "FirebaseCore",
  858. "FirebaseInstallations",
  859. "FirebaseRemoteConfig",
  860. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  861. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  862. .product(name: "GULISASwizzler", package: "GoogleUtilities"),
  863. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  864. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  865. .product(name: "nanopb", package: "nanopb"),
  866. ],
  867. path: "FirebasePerformance/Sources",
  868. publicHeadersPath: "Public",
  869. cSettings: [
  870. .headerSearchPath("../../"),
  871. .define("PB_FIELD_32BIT", to: "1"),
  872. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  873. .define("PB_ENABLE_MALLOC", to: "1"),
  874. .define("FIRPerformance_LIB_VERSION", to: firebaseVersion),
  875. ],
  876. linkerSettings: [
  877. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .tvOS])),
  878. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .tvOS])),
  879. .linkedFramework("QuartzCore", .when(platforms: [.iOS, .tvOS])),
  880. ]
  881. ),
  882. .testTarget(
  883. name: "PerformanceUnit",
  884. dependencies: [
  885. "FirebasePerformanceTarget",
  886. "OCMock",
  887. "SharedTestUtilities",
  888. "GCDWebServer",
  889. ],
  890. path: "FirebasePerformance/Tests/Unit",
  891. resources: [
  892. .process("FPRURLFilterTests-Info.plist"),
  893. .process("Server/smallDownloadFile"),
  894. .process("Server/bigDownloadFile"),
  895. ],
  896. cSettings: [
  897. .headerSearchPath("../../.."),
  898. .define("PB_FIELD_32BIT", to: "1"),
  899. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  900. .define("PB_ENABLE_MALLOC", to: "1"),
  901. ]
  902. ),
  903. .target(
  904. name: "SharedTestUtilities",
  905. dependencies: ["FirebaseCore", "OCMock"],
  906. path: "SharedTestUtilities",
  907. publicHeadersPath: "./",
  908. cSettings: [
  909. .headerSearchPath("../"),
  910. ]
  911. ),
  912. .target(
  913. name: "FirebaseRemoteConfig",
  914. dependencies: [
  915. "FirebaseCore",
  916. "FirebaseABTesting",
  917. "FirebaseInstallations",
  918. .product(name: "GULNSData", package: "GoogleUtilities"),
  919. ],
  920. path: "FirebaseRemoteConfig/Sources",
  921. publicHeadersPath: "Public",
  922. cSettings: [
  923. .headerSearchPath("../../"),
  924. ]
  925. ),
  926. .testTarget(
  927. name: "RemoteConfigUnit",
  928. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  929. path: "FirebaseRemoteConfig/Tests/Unit",
  930. exclude: [
  931. // Need to be evaluated/ported to RC V2.
  932. "RCNConfigAnalyticsTest.m",
  933. "RCNConfigSettingsTest.m",
  934. "RCNConfigTest.m",
  935. "RCNRemoteConfig+FIRAppTest.m",
  936. "RCNThrottlingTests.m",
  937. ],
  938. resources: [
  939. .process("SecondApp-GoogleService-Info.plist"),
  940. .process("Defaults-testInfo.plist"),
  941. .process("TestABTPayload.txt"),
  942. ],
  943. cSettings: [
  944. .headerSearchPath("../../.."),
  945. ]
  946. ),
  947. .target(
  948. name: "FirebaseStorage",
  949. dependencies: [
  950. "FirebaseCore",
  951. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  952. ],
  953. path: "FirebaseStorage/Sources",
  954. publicHeadersPath: "Public",
  955. cSettings: [
  956. .headerSearchPath("../../"),
  957. ],
  958. linkerSettings: [
  959. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS])),
  960. .linkedFramework("CoreServices", .when(platforms: [.macOS])),
  961. ]
  962. ),
  963. .testTarget(
  964. name: "StorageUnit",
  965. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  966. path: "FirebaseStorage/Tests/Unit",
  967. cSettings: [
  968. .headerSearchPath("../../.."),
  969. ]
  970. ),
  971. .target(
  972. name: "FirebaseStorageSwift",
  973. dependencies: ["FirebaseStorage"],
  974. path: "FirebaseStorageSwift/Sources"
  975. ),
  976. .testTarget(
  977. name: "swift-test",
  978. dependencies: [
  979. "Firebase",
  980. "FirebaseAuth",
  981. "FirebaseAppCheck",
  982. "FirebaseABTesting",
  983. .target(name: "FirebaseAppDistribution",
  984. condition: .when(platforms: [.iOS])),
  985. "FirebaseAuthCombineSwift",
  986. "FirebaseFirestoreCombineSwift",
  987. "FirebaseFunctionsCombineSwift",
  988. "FirebaseStorageCombineSwift",
  989. "FirebaseCrashlytics",
  990. "FirebaseCore",
  991. "FirebaseDatabase",
  992. "FirebaseDynamicLinks",
  993. "FirebaseFirestore",
  994. "FirebaseFirestoreSwift",
  995. "FirebaseFunctions",
  996. "FirebaseInAppMessaging",
  997. .target(name: "FirebaseInAppMessagingSwift",
  998. condition: .when(platforms: [.iOS, .tvOS])),
  999. "FirebaseInstallations",
  1000. "FirebaseMessaging",
  1001. .target(name: "FirebasePerformance",
  1002. condition: .when(platforms: [.iOS, .tvOS])),
  1003. "FirebaseRemoteConfig",
  1004. "FirebaseStorage",
  1005. "FirebaseStorageSwift",
  1006. .product(name: "nanopb", package: "nanopb"),
  1007. ],
  1008. path: "SwiftPMTests/swift-test"
  1009. ),
  1010. .testTarget(
  1011. name: "analytics-import-test",
  1012. dependencies: [
  1013. "FirebaseAnalyticsSwiftTarget",
  1014. "FirebaseAnalyticsWrapper",
  1015. "Firebase",
  1016. ],
  1017. path: "SwiftPMTests/analytics-import-test"
  1018. ),
  1019. .testTarget(
  1020. name: "objc-import-test",
  1021. dependencies: [
  1022. "Firebase",
  1023. "FirebaseAuth",
  1024. "FirebaseABTesting",
  1025. "FirebaseAppCheck",
  1026. .target(name: "FirebaseAppDistribution",
  1027. condition: .when(platforms: [.iOS])),
  1028. "FirebaseCrashlytics",
  1029. "FirebaseCore",
  1030. "FirebaseDatabase",
  1031. "FirebaseDynamicLinks",
  1032. "FirebaseFirestore",
  1033. "FirebaseFunctions",
  1034. "FirebaseInAppMessaging",
  1035. "FirebaseInstallations",
  1036. "FirebaseMessaging",
  1037. .target(name: "FirebasePerformance",
  1038. condition: .when(platforms: [.iOS, .tvOS])),
  1039. "FirebaseRemoteConfig",
  1040. "FirebaseStorage",
  1041. ],
  1042. path: "SwiftPMTests/objc-import-test"
  1043. ),
  1044. .testTarget(
  1045. name: "version-test",
  1046. dependencies: [
  1047. "FirebaseCore",
  1048. ],
  1049. path: "SwiftPMTests/version-test",
  1050. cSettings: [
  1051. .define("FIR_VERSION", to: firebaseVersion),
  1052. ]
  1053. ),
  1054. // MARK: - Firebase App Check
  1055. .target(name: "FirebaseAppCheck",
  1056. dependencies: [
  1057. "FirebaseCore",
  1058. .product(name: "FBLPromises", package: "Promises"),
  1059. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1060. ],
  1061. path: "FirebaseAppCheck/Sources",
  1062. exclude: [
  1063. "Interop/CMakeLists.txt",
  1064. ],
  1065. publicHeadersPath: "Public",
  1066. cSettings: [
  1067. .headerSearchPath("../.."),
  1068. ],
  1069. linkerSettings: [
  1070. .linkedFramework("DeviceCheck"),
  1071. ]),
  1072. .testTarget(
  1073. name: "AppCheckUnit",
  1074. dependencies: ["FirebaseAppCheck", "OCMock", "SharedTestUtilities"],
  1075. path: "FirebaseAppCheck/Tests",
  1076. exclude: [
  1077. // Disable Swift tests as mixed targets are not supported (Xcode 12.3).
  1078. "Unit/Swift",
  1079. // Disable Keychain dependent tests as they require a host application on iOS.
  1080. "Integration",
  1081. "Unit/AppAttestProvider/Storage/FIRAppAttestArtifactStorageTests.m",
  1082. "Unit/Core/FIRAppCheckIntegrationTests.m",
  1083. "Unit/Core/FIRAppCheckStorageTests.m",
  1084. ],
  1085. resources: [
  1086. .process("Fixture"),
  1087. ],
  1088. cSettings: [
  1089. .headerSearchPath("../.."),
  1090. ]
  1091. ),
  1092. .testTarget(
  1093. name: "AppCheckUnitSwift",
  1094. dependencies: ["FirebaseAppCheck"],
  1095. path: "FirebaseAppCheck/Tests/Unit/Swift",
  1096. cSettings: [
  1097. .headerSearchPath("../.."),
  1098. ]
  1099. ),
  1100. // MARK: Testing support
  1101. .target(
  1102. name: "FirebaseFirestoreTestingSupport",
  1103. dependencies: ["FirebaseFirestore"],
  1104. path: "FirebaseTestingSupport/Firestore/Sources",
  1105. publicHeadersPath: "./",
  1106. cSettings: [
  1107. .headerSearchPath("../../.."),
  1108. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  1109. ]
  1110. ),
  1111. .testTarget(
  1112. name: "FirestoreTestingSupportTests",
  1113. dependencies: ["FirebaseFirestoreTestingSupport"],
  1114. path: "FirebaseTestingSupport/Firestore/Tests",
  1115. cSettings: [
  1116. .headerSearchPath("../../.."),
  1117. ]
  1118. ),
  1119. ],
  1120. cLanguageStandard: .c99,
  1121. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  1122. )