Package.swift 41 KB

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