Package.swift 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168
  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. .branch("main")
  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: "FirebaseCoreInternalSwift",
  234. dependencies: ["FirebaseCore"],
  235. path: "FirebaseCoreInternalSwift/Sources"
  236. ),
  237. .testTarget(
  238. name: "CoreInternalUnitSwift",
  239. dependencies: ["FirebaseCoreInternalSwift"],
  240. path: "FirebaseCoreInternalSwift/Tests/Unit"
  241. ),
  242. .target(
  243. name: "FirebaseCoreDiagnostics",
  244. dependencies: [
  245. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  246. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  247. .product(name: "GULLogger", package: "GoogleUtilities"),
  248. .product(name: "nanopb", package: "nanopb"),
  249. ],
  250. path: "Firebase/CoreDiagnostics/FIRCDLibrary",
  251. publicHeadersPath: ".",
  252. cSettings: [
  253. .headerSearchPath("../../.."),
  254. .define("PB_FIELD_32BIT", to: "1"),
  255. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  256. .define("PB_ENABLE_MALLOC", to: "1"),
  257. ]
  258. ),
  259. .target(
  260. name: "FirebaseABTesting",
  261. dependencies: ["FirebaseCore"],
  262. path: "FirebaseABTesting/Sources",
  263. publicHeadersPath: "Public",
  264. cSettings: [
  265. .headerSearchPath("../../"),
  266. ]
  267. ),
  268. .testTarget(
  269. name: "ABTestingUnit",
  270. dependencies: ["FirebaseABTesting", "OCMock"],
  271. path: "FirebaseABTesting/Tests/Unit",
  272. resources: [.process("Resources")],
  273. cSettings: [
  274. .headerSearchPath("../../.."),
  275. ]
  276. ),
  277. .target(
  278. name: "FirebaseAnalyticsTarget",
  279. dependencies: [.target(name: "FirebaseAnalyticsWrapper",
  280. condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
  281. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
  282. ),
  283. .target(
  284. name: "FirebaseAnalyticsWrapper",
  285. dependencies: [
  286. .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
  287. .product(name: "GoogleAppMeasurement",
  288. package: "GoogleAppMeasurement",
  289. condition: .when(platforms: [.iOS, .macOS, .tvOS])),
  290. "FirebaseCore",
  291. "FirebaseInstallations",
  292. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  293. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  294. .product(name: "GULNSData", package: "GoogleUtilities"),
  295. .product(name: "GULNetwork", package: "GoogleUtilities"),
  296. .product(name: "nanopb", package: "nanopb"),
  297. ],
  298. path: "FirebaseAnalyticsWrapper",
  299. linkerSettings: [
  300. .linkedLibrary("sqlite3"),
  301. .linkedLibrary("c++"),
  302. .linkedLibrary("z"),
  303. .linkedFramework("StoreKit"),
  304. ]
  305. ),
  306. .binaryTarget(
  307. name: "FirebaseAnalytics",
  308. url: "https://dl.google.com/firebase/ios/swiftpm/8.9.1/FirebaseAnalytics.zip",
  309. checksum: "397688619b1d2eb2731fd06d094b95498e753519b4c0c75a6f7071bcafd9d1f1"
  310. ),
  311. .target(
  312. name: "FirebaseAnalyticsSwiftTarget",
  313. dependencies: [.target(name: "FirebaseAnalyticsSwift",
  314. condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
  315. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
  316. ),
  317. .target(
  318. name: "FirebaseAnalyticsSwift",
  319. dependencies: ["FirebaseAnalyticsWrapper"],
  320. path: "FirebaseAnalyticsSwift/Sources"
  321. ),
  322. .target(
  323. name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
  324. dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  325. condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
  326. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
  327. ),
  328. .target(
  329. name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  330. dependencies: [
  331. .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
  332. .product(name: "GoogleAppMeasurementWithoutAdIdSupport",
  333. package: "GoogleAppMeasurement",
  334. condition: .when(platforms: [.iOS])),
  335. "FirebaseCore",
  336. "FirebaseInstallations",
  337. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  338. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  339. .product(name: "GULNSData", package: "GoogleUtilities"),
  340. .product(name: "GULNetwork", package: "GoogleUtilities"),
  341. .product(name: "nanopb", package: "nanopb"),
  342. ],
  343. path: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  344. linkerSettings: [
  345. .linkedLibrary("sqlite3"),
  346. .linkedLibrary("c++"),
  347. .linkedLibrary("z"),
  348. .linkedFramework("StoreKit"),
  349. ]
  350. ),
  351. .target(
  352. name: "FirebaseAppDistributionTarget",
  353. dependencies: [.target(name: "FirebaseAppDistribution",
  354. condition: .when(platforms: [.iOS]))],
  355. path: "SwiftPM-PlatformExclude/FirebaseAppDistributionWrap"
  356. ),
  357. .target(
  358. name: "FirebaseAppDistribution",
  359. dependencies: [
  360. "FirebaseCore",
  361. "FirebaseInstallations",
  362. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  363. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  364. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  365. ],
  366. path: "FirebaseAppDistribution/Sources",
  367. publicHeadersPath: "Public",
  368. cSettings: [
  369. .headerSearchPath("../../"),
  370. ]
  371. ),
  372. .testTarget(
  373. name: "AppDistributionUnit",
  374. dependencies: ["FirebaseAppDistribution", "OCMock"],
  375. path: "FirebaseAppDistribution/Tests/Unit",
  376. resources: [.process("Resources")],
  377. cSettings: [
  378. .headerSearchPath("../../.."),
  379. ]
  380. ),
  381. .target(
  382. name: "FirebaseAuth",
  383. dependencies: [
  384. "FirebaseCore",
  385. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  386. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  387. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  388. ],
  389. path: "FirebaseAuth/Sources",
  390. publicHeadersPath: "Public",
  391. cSettings: [
  392. .headerSearchPath("../../"),
  393. ],
  394. linkerSettings: [
  395. .linkedFramework("Security"),
  396. .linkedFramework("SafariServices", .when(platforms: [.iOS])),
  397. ]
  398. ),
  399. .testTarget(
  400. name: "AuthUnit",
  401. dependencies: ["FirebaseAuth", "OCMock"],
  402. path: "FirebaseAuth/Tests/Unit",
  403. exclude: [
  404. "FIRAuthKeychainServicesTests.m", // TODO: figure out SPM keychain testing
  405. "FIRAuthTests.m",
  406. "FIRUserTests.m",
  407. ],
  408. cSettings: [
  409. .headerSearchPath("../../.."),
  410. ]
  411. ),
  412. .target(
  413. name: "FirebaseAuthCombineSwift",
  414. dependencies: ["FirebaseAuth"],
  415. path: "FirebaseCombineSwift/Sources/Auth"
  416. ),
  417. .target(
  418. name: "FirebaseFirestoreCombineSwift",
  419. dependencies: [
  420. "FirebaseFirestore",
  421. "FirebaseFirestoreSwift",
  422. ],
  423. path: "FirebaseCombineSwift/Sources/Firestore"
  424. ),
  425. .target(
  426. name: "FirebaseStorageCombineSwift",
  427. dependencies: [
  428. "FirebaseStorage",
  429. "FirebaseStorageSwift",
  430. ],
  431. path: "FirebaseCombineSwift/Sources/Storage"
  432. ),
  433. .target(
  434. name: "FirebaseCrashlytics",
  435. dependencies: ["FirebaseCore", "FirebaseInstallations",
  436. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  437. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  438. .product(name: "FBLPromises", package: "Promises"),
  439. .product(name: "nanopb", package: "nanopb")],
  440. path: "Crashlytics",
  441. exclude: [
  442. "run",
  443. "CHANGELOG.md",
  444. "LICENSE",
  445. "README.md",
  446. "ProtoSupport/",
  447. "UnitTests/",
  448. "generate_project.sh",
  449. "upload-symbols",
  450. "third_party/libunwind/LICENSE",
  451. ],
  452. sources: [
  453. "Crashlytics/",
  454. "Protogen/",
  455. "Shared/",
  456. "third_party/libunwind/dwarf.h",
  457. ],
  458. publicHeadersPath: "Crashlytics/Public",
  459. cSettings: [
  460. .headerSearchPath(".."),
  461. .define("DISPLAY_VERSION", to: firebaseVersion),
  462. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  463. .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: [.macOS])),
  464. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  465. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  466. .define("PB_FIELD_32BIT", to: "1"),
  467. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  468. .define("PB_ENABLE_MALLOC", to: "1"),
  469. ],
  470. linkerSettings: [
  471. .linkedFramework("Security"),
  472. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  473. ]
  474. ),
  475. .target(
  476. name: "FirebaseDatabase",
  477. dependencies: [
  478. "FirebaseCore",
  479. "leveldb",
  480. ],
  481. path: "FirebaseDatabase/Sources",
  482. exclude: [
  483. "third_party/Wrap-leveldb/LICENSE",
  484. "third_party/SocketRocket/LICENSE",
  485. "third_party/FImmutableSortedDictionary/LICENSE",
  486. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  487. ],
  488. publicHeadersPath: "Public",
  489. cSettings: [
  490. .headerSearchPath("../../"),
  491. ],
  492. linkerSettings: [
  493. .linkedFramework("CFNetwork"),
  494. .linkedFramework("Security"),
  495. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  496. .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
  497. ]
  498. ),
  499. .testTarget(
  500. name: "DatabaseUnit",
  501. dependencies: ["FirebaseDatabase", "OCMock", "SharedTestUtilities"],
  502. path: "FirebaseDatabase/Tests/",
  503. exclude: [
  504. // Disable Swift tests as mixed targets are not supported (Xcode 12.4).
  505. "Unit/Swift",
  506. "Integration/",
  507. ],
  508. resources: [.process("Resources")],
  509. cSettings: [
  510. .headerSearchPath("../.."),
  511. ]
  512. ),
  513. .testTarget(
  514. name: "DatabaseUnitSwift",
  515. dependencies: ["FirebaseDatabase"],
  516. path: "FirebaseDatabase/Tests/Unit/Swift",
  517. cSettings: [
  518. .headerSearchPath("../.."),
  519. ]
  520. ),
  521. .target(
  522. name: "FirebaseDatabaseSwift",
  523. dependencies: ["FirebaseDatabase", "FirebaseSharedSwift"],
  524. path: "FirebaseDatabaseSwift/Sources"
  525. ),
  526. .testTarget(
  527. name: "FirebaseDatabaseSwiftTests",
  528. dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
  529. path: "FirebaseDatabaseSwift/Tests/"
  530. ),
  531. .target(
  532. name: "FirebaseSharedSwift",
  533. path: "FirebaseSharedSwift/Sources",
  534. exclude: [
  535. "third_party/FirebaseDataEncoder/LICENSE",
  536. "third_party/FirebaseDataEncoder/METADATA",
  537. ]
  538. ),
  539. .testTarget(
  540. name: "FirebaseSharedSwiftTests",
  541. dependencies: ["FirebaseSharedSwift"],
  542. path: "FirebaseSharedSwift/Tests/"
  543. ),
  544. .target(
  545. name: "FirebaseDynamicLinksTarget",
  546. dependencies: [.target(name: "FirebaseDynamicLinks",
  547. condition: .when(platforms: [.iOS]))],
  548. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  549. ),
  550. .target(
  551. name: "FirebaseDynamicLinks",
  552. dependencies: ["FirebaseCore"],
  553. path: "FirebaseDynamicLinks/Sources",
  554. publicHeadersPath: "Public",
  555. cSettings: [
  556. .headerSearchPath("../../"),
  557. .define("FIRDynamicLinks3P", to: "1"),
  558. .define("GIN_SCION_LOGGING", to: "1"),
  559. ],
  560. linkerSettings: [
  561. .linkedFramework("QuartzCore"),
  562. ]
  563. ),
  564. .target(
  565. name: "FirebaseFirestoreTarget",
  566. dependencies: [.target(name: "FirebaseFirestore",
  567. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  568. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  569. ),
  570. .target(
  571. name: "FirebaseFirestore",
  572. dependencies: [
  573. "FirebaseCore",
  574. "leveldb",
  575. .product(name: "nanopb", package: "nanopb"),
  576. .product(name: "abseil", package: "abseil"),
  577. .product(name: "gRPC-cpp", package: "gRPC"),
  578. ],
  579. path: "Firestore",
  580. exclude: [
  581. "CHANGELOG.md",
  582. "CMakeLists.txt",
  583. "Example/",
  584. "LICENSE",
  585. "Protos/CMakeLists.txt",
  586. "Protos/Podfile",
  587. "Protos/README.md",
  588. "Protos/build_protos.py",
  589. "Protos/cpp/",
  590. "Protos/lib/",
  591. "Protos/nanopb_cpp_generator.py",
  592. "Protos/protos/",
  593. "README.md",
  594. "Source/CMakeLists.txt",
  595. "Swift/",
  596. "core/CMakeLists.txt",
  597. "core/src/util/config_detected.h.in",
  598. "core/test/",
  599. "fuzzing/",
  600. "test.sh",
  601. // Swift PM doesn't recognize hpp files, so we're relying on search paths
  602. // to find third_party/nlohmann_json/json.hpp.
  603. "third_party/",
  604. // Exclude alternate implementations for other platforms
  605. "core/src/remote/connectivity_monitor_noop.cc",
  606. "core/src/util/filesystem_win.cc",
  607. "core/src/util/log_stdio.cc",
  608. "core/src/util/secure_random_openssl.cc",
  609. ],
  610. sources: [
  611. "Source/",
  612. "Protos/nanopb/",
  613. "core/include/",
  614. "core/src",
  615. ],
  616. publicHeadersPath: "Source/Public",
  617. cSettings: [
  618. .headerSearchPath("../"),
  619. .headerSearchPath("Source/Public/FirebaseFirestore"),
  620. .headerSearchPath("Protos/nanopb"),
  621. .define("PB_FIELD_32BIT", to: "1"),
  622. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  623. .define("PB_ENABLE_MALLOC", to: "1"),
  624. .define("FIRFirestore_VERSION", to: firebaseVersion),
  625. ],
  626. linkerSettings: [
  627. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  628. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  629. .linkedLibrary("c++"),
  630. ]
  631. ),
  632. .target(
  633. name: "FirebaseFirestoreSwiftTarget",
  634. dependencies: [.target(name: "FirebaseFirestoreSwift",
  635. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  636. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  637. ),
  638. .target(
  639. name: "FirebaseFirestoreSwift",
  640. dependencies: ["FirebaseFirestore"],
  641. path: "Firestore",
  642. exclude: [
  643. "CHANGELOG.md",
  644. "CMakeLists.txt",
  645. "Example/",
  646. "LICENSE",
  647. "Protos/",
  648. "README.md",
  649. "Source/",
  650. "core/",
  651. "fuzzing/",
  652. "test.sh",
  653. "Swift/CHANGELOG.md",
  654. "Swift/README.md",
  655. "Swift/Tests/",
  656. "third_party/nlohmann_json",
  657. "third_party/FirestoreEncoder/LICENSE",
  658. "third_party/FirestoreEncoder/METADATA",
  659. ],
  660. sources: [
  661. "Swift/Source/",
  662. "third_party/FirestoreEncoder/",
  663. ]
  664. ),
  665. // MARK: - Firebase Functions
  666. .target(
  667. name: "FirebaseFunctions",
  668. dependencies: [
  669. "FirebaseCore",
  670. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  671. ],
  672. path: "FirebaseFunctions/Sources",
  673. publicHeadersPath: "Public",
  674. cSettings: [
  675. .headerSearchPath("../../"),
  676. ]
  677. ),
  678. .target(
  679. name: "FirebaseFunctionsSwift",
  680. dependencies: [
  681. "FirebaseFunctions",
  682. "FirebaseSharedSwift",
  683. ],
  684. path: "FirebaseFunctionsSwift/Sources"
  685. ),
  686. .testTarget(
  687. name: "FirebaseFunctionsSwiftUnit",
  688. dependencies: ["FirebaseFunctionsSwift",
  689. "FirebaseFunctionsTestingSupport",
  690. "SharedTestUtilities"],
  691. path: "FirebaseFunctionsSwift/Tests"
  692. ),
  693. .target(
  694. name: "FirebaseFunctionsCombineSwift",
  695. dependencies: ["FirebaseFunctions"],
  696. path: "FirebaseCombineSwift/Sources/Functions"
  697. ),
  698. .testTarget(
  699. name: "FunctionsCombineUnit",
  700. dependencies: ["FirebaseFunctionsCombineSwift",
  701. "FirebaseFunctionsTestingSupport",
  702. "SharedTestUtilities"],
  703. path: "FirebaseFunctions/Tests/CombineUnit"
  704. ),
  705. .testTarget(
  706. name: "FunctionsUnit",
  707. dependencies: ["FirebaseFunctions",
  708. "SharedTestUtilities"],
  709. path: "FirebaseFunctions/Tests/Unit",
  710. cSettings: [
  711. .headerSearchPath("../../../"),
  712. ]
  713. ),
  714. .testTarget(
  715. name: "FunctionsUnitSwift",
  716. dependencies: ["FirebaseFunctions"],
  717. path: "FirebaseFunctions/Tests/SwiftUnit"
  718. ),
  719. .testTarget(
  720. name: "FunctionsIntegration",
  721. dependencies: ["FirebaseFunctions",
  722. "SharedTestUtilities"],
  723. path: "FirebaseFunctions/Tests/Integration",
  724. cSettings: [
  725. .headerSearchPath("../../../"),
  726. ]
  727. ),
  728. .testTarget(
  729. name: "FunctionsSwiftIntegration",
  730. dependencies: ["FirebaseFunctions",
  731. "FirebaseFunctionsTestingSupport",
  732. "SharedTestUtilities"],
  733. path: "FirebaseFunctions/Tests/SwiftIntegration"
  734. ),
  735. .target(
  736. name: "FirebaseFunctionsTestingSupport",
  737. dependencies: ["FirebaseFunctions"],
  738. path: "FirebaseTestingSupport/Functions/Sources",
  739. publicHeadersPath: "Public",
  740. cSettings: [
  741. .headerSearchPath("../../.."),
  742. ]
  743. ),
  744. // MARK: - Firebase In App Messaging
  745. .target(
  746. name: "FirebaseInAppMessagingTarget",
  747. dependencies: [
  748. .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
  749. ],
  750. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  751. ),
  752. .target(
  753. name: "FirebaseInAppMessaging",
  754. dependencies: [
  755. "FirebaseCore",
  756. "FirebaseInstallations",
  757. "FirebaseABTesting",
  758. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  759. .product(name: "nanopb", package: "nanopb"),
  760. .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
  761. ],
  762. path: "FirebaseInAppMessaging/Sources",
  763. exclude: [
  764. "DefaultUI/CHANGELOG.md",
  765. "DefaultUI/README.md",
  766. ],
  767. publicHeadersPath: "Public",
  768. cSettings: [
  769. .headerSearchPath("../../"),
  770. .define("PB_FIELD_32BIT", to: "1"),
  771. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  772. .define("PB_ENABLE_MALLOC", to: "1"),
  773. ]
  774. ),
  775. .target(
  776. name: "FirebaseInAppMessaging_iOS",
  777. path: "FirebaseInAppMessaging/iOS",
  778. resources: [.process("Resources")]
  779. ),
  780. .target(
  781. name: "FirebaseInAppMessagingSwift",
  782. dependencies: ["FirebaseInAppMessaging"],
  783. path: "FirebaseInAppMessaging/Swift/Source"
  784. ),
  785. .target(
  786. name: "FirebaseInstallations",
  787. dependencies: [
  788. "FirebaseCore",
  789. .product(name: "FBLPromises", package: "Promises"),
  790. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  791. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  792. ],
  793. path: "FirebaseInstallations/Source/Library",
  794. publicHeadersPath: "Public",
  795. cSettings: [
  796. .headerSearchPath("../../../"),
  797. ],
  798. linkerSettings: [
  799. .linkedFramework("Security"),
  800. ]
  801. ),
  802. .target(
  803. name: "FirebaseMLModelDownloader",
  804. dependencies: [
  805. "FirebaseCore",
  806. "FirebaseInstallations",
  807. .product(name: "GULLogger", package: "GoogleUtilities"),
  808. "SwiftProtobuf",
  809. ],
  810. path: "FirebaseMLModelDownloader/Sources",
  811. exclude: [
  812. "proto/firebase_ml_log_sdk.proto",
  813. ],
  814. cSettings: [
  815. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  816. ]
  817. ),
  818. .testTarget(
  819. name: "FirebaseMLModelDownloaderUnit",
  820. dependencies: ["FirebaseMLModelDownloader"],
  821. path: "FirebaseMLModelDownloader/Tests/Unit"
  822. ),
  823. .target(
  824. name: "FirebaseMessaging",
  825. dependencies: [
  826. "FirebaseCore",
  827. "FirebaseInstallations",
  828. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  829. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  830. .product(name: "GULReachability", package: "GoogleUtilities"),
  831. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  832. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  833. .product(name: "nanopb", package: "nanopb"),
  834. ],
  835. path: "FirebaseMessaging/Sources",
  836. publicHeadersPath: "Public",
  837. cSettings: [
  838. .headerSearchPath("../../"),
  839. .define("PB_FIELD_32BIT", to: "1"),
  840. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  841. .define("PB_ENABLE_MALLOC", to: "1"),
  842. ],
  843. linkerSettings: [
  844. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  845. ]
  846. ),
  847. .testTarget(
  848. name: "MessagingUnit",
  849. dependencies: ["FirebaseMessaging", "SharedTestUtilities", "OCMock"],
  850. path: "FirebaseMessaging/Tests/UnitTests",
  851. exclude: [
  852. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  853. ],
  854. cSettings: [
  855. .headerSearchPath("../../.."),
  856. ]
  857. ),
  858. .target(
  859. name: "FirebasePerformanceTarget",
  860. dependencies: [.target(name: "FirebasePerformance",
  861. condition: .when(platforms: [.iOS, .tvOS]))],
  862. path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
  863. ),
  864. .target(
  865. name: "FirebasePerformance",
  866. dependencies: [
  867. "FirebaseCore",
  868. "FirebaseInstallations",
  869. "FirebaseRemoteConfig",
  870. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  871. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  872. .product(name: "GULISASwizzler", package: "GoogleUtilities"),
  873. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  874. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  875. .product(name: "nanopb", package: "nanopb"),
  876. ],
  877. path: "FirebasePerformance/Sources",
  878. publicHeadersPath: "Public",
  879. cSettings: [
  880. .headerSearchPath("../../"),
  881. .define("PB_FIELD_32BIT", to: "1"),
  882. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  883. .define("PB_ENABLE_MALLOC", to: "1"),
  884. .define("FIRPerformance_LIB_VERSION", to: firebaseVersion),
  885. ],
  886. linkerSettings: [
  887. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .tvOS])),
  888. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .tvOS])),
  889. .linkedFramework("QuartzCore", .when(platforms: [.iOS, .tvOS])),
  890. ]
  891. ),
  892. .testTarget(
  893. name: "PerformanceUnit",
  894. dependencies: [
  895. "FirebasePerformanceTarget",
  896. "OCMock",
  897. "SharedTestUtilities",
  898. "GCDWebServer",
  899. ],
  900. path: "FirebasePerformance/Tests/Unit",
  901. resources: [
  902. .process("FPRURLFilterTests-Info.plist"),
  903. .process("Server/smallDownloadFile"),
  904. .process("Server/bigDownloadFile"),
  905. ],
  906. cSettings: [
  907. .headerSearchPath("../../.."),
  908. .define("PB_FIELD_32BIT", to: "1"),
  909. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  910. .define("PB_ENABLE_MALLOC", to: "1"),
  911. ]
  912. ),
  913. .target(
  914. name: "SharedTestUtilities",
  915. dependencies: ["FirebaseCore", "OCMock"],
  916. path: "SharedTestUtilities",
  917. publicHeadersPath: "./",
  918. cSettings: [
  919. .headerSearchPath("../"),
  920. ]
  921. ),
  922. .target(
  923. name: "FirebaseRemoteConfig",
  924. dependencies: [
  925. "FirebaseCore",
  926. "FirebaseABTesting",
  927. "FirebaseInstallations",
  928. .product(name: "GULNSData", package: "GoogleUtilities"),
  929. ],
  930. path: "FirebaseRemoteConfig/Sources",
  931. publicHeadersPath: "Public",
  932. cSettings: [
  933. .headerSearchPath("../../"),
  934. ]
  935. ),
  936. .testTarget(
  937. name: "RemoteConfigUnit",
  938. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  939. path: "FirebaseRemoteConfig/Tests/Unit",
  940. exclude: [
  941. // Need to be evaluated/ported to RC V2.
  942. "RCNConfigAnalyticsTest.m",
  943. "RCNConfigSettingsTest.m",
  944. "RCNConfigTest.m",
  945. "RCNRemoteConfig+FIRAppTest.m",
  946. "RCNThrottlingTests.m",
  947. ],
  948. resources: [
  949. .process("SecondApp-GoogleService-Info.plist"),
  950. .process("Defaults-testInfo.plist"),
  951. .process("TestABTPayload.txt"),
  952. ],
  953. cSettings: [
  954. .headerSearchPath("../../.."),
  955. ]
  956. ),
  957. .target(
  958. name: "FirebaseStorage",
  959. dependencies: [
  960. "FirebaseCore",
  961. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  962. ],
  963. path: "FirebaseStorage/Sources",
  964. publicHeadersPath: "Public",
  965. cSettings: [
  966. .headerSearchPath("../../"),
  967. ],
  968. linkerSettings: [
  969. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS])),
  970. .linkedFramework("CoreServices", .when(platforms: [.macOS])),
  971. ]
  972. ),
  973. .testTarget(
  974. name: "StorageUnit",
  975. dependencies: ["FirebaseStorage", "OCMock", "SharedTestUtilities"],
  976. path: "FirebaseStorage/Tests/Unit",
  977. cSettings: [
  978. .headerSearchPath("../../.."),
  979. ]
  980. ),
  981. .target(
  982. name: "FirebaseStorageSwift",
  983. dependencies: ["FirebaseStorage"],
  984. path: "FirebaseStorageSwift/Sources"
  985. ),
  986. .testTarget(
  987. name: "swift-test",
  988. dependencies: [
  989. "Firebase",
  990. "FirebaseAuth",
  991. "FirebaseAppCheck",
  992. "FirebaseABTesting",
  993. .target(name: "FirebaseAppDistribution",
  994. condition: .when(platforms: [.iOS])),
  995. "FirebaseAuthCombineSwift",
  996. "FirebaseFirestoreCombineSwift",
  997. "FirebaseFunctionsCombineSwift",
  998. "FirebaseStorageCombineSwift",
  999. "FirebaseCrashlytics",
  1000. "FirebaseCore",
  1001. "FirebaseCoreInternalSwift",
  1002. "FirebaseDatabase",
  1003. "FirebaseDynamicLinks",
  1004. "FirebaseFirestore",
  1005. "FirebaseFirestoreSwift",
  1006. "FirebaseFunctions",
  1007. "FirebaseInAppMessaging",
  1008. .target(name: "FirebaseInAppMessagingSwift",
  1009. condition: .when(platforms: [.iOS, .tvOS])),
  1010. "FirebaseInstallations",
  1011. "FirebaseMessaging",
  1012. .target(name: "FirebasePerformance",
  1013. condition: .when(platforms: [.iOS, .tvOS])),
  1014. "FirebaseRemoteConfig",
  1015. "FirebaseStorage",
  1016. "FirebaseStorageSwift",
  1017. .product(name: "nanopb", package: "nanopb"),
  1018. ],
  1019. path: "SwiftPMTests/swift-test"
  1020. ),
  1021. .testTarget(
  1022. name: "analytics-import-test",
  1023. dependencies: [
  1024. "FirebaseAnalyticsSwiftTarget",
  1025. "FirebaseAnalyticsWrapper",
  1026. "Firebase",
  1027. ],
  1028. path: "SwiftPMTests/analytics-import-test"
  1029. ),
  1030. .testTarget(
  1031. name: "objc-import-test",
  1032. dependencies: [
  1033. "Firebase",
  1034. "FirebaseAuth",
  1035. "FirebaseABTesting",
  1036. "FirebaseAppCheck",
  1037. .target(name: "FirebaseAppDistribution",
  1038. condition: .when(platforms: [.iOS])),
  1039. "FirebaseCrashlytics",
  1040. "FirebaseCore",
  1041. "FirebaseDatabase",
  1042. "FirebaseDynamicLinks",
  1043. "FirebaseFirestore",
  1044. "FirebaseFunctions",
  1045. "FirebaseInAppMessaging",
  1046. "FirebaseInstallations",
  1047. "FirebaseMessaging",
  1048. .target(name: "FirebasePerformance",
  1049. condition: .when(platforms: [.iOS, .tvOS])),
  1050. "FirebaseRemoteConfig",
  1051. "FirebaseStorage",
  1052. ],
  1053. path: "SwiftPMTests/objc-import-test"
  1054. ),
  1055. .testTarget(
  1056. name: "version-test",
  1057. dependencies: [
  1058. "FirebaseCore",
  1059. ],
  1060. path: "SwiftPMTests/version-test",
  1061. cSettings: [
  1062. .define("FIR_VERSION", to: firebaseVersion),
  1063. ]
  1064. ),
  1065. // MARK: - Firebase App Check
  1066. .target(name: "FirebaseAppCheck",
  1067. dependencies: [
  1068. "FirebaseCore",
  1069. .product(name: "FBLPromises", package: "Promises"),
  1070. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1071. ],
  1072. path: "FirebaseAppCheck/Sources",
  1073. exclude: [
  1074. "Interop/CMakeLists.txt",
  1075. ],
  1076. publicHeadersPath: "Public",
  1077. cSettings: [
  1078. .headerSearchPath("../.."),
  1079. ],
  1080. linkerSettings: [
  1081. .linkedFramework("DeviceCheck"),
  1082. ]),
  1083. .testTarget(
  1084. name: "AppCheckUnit",
  1085. dependencies: ["FirebaseAppCheck", "OCMock", "SharedTestUtilities"],
  1086. path: "FirebaseAppCheck/Tests",
  1087. exclude: [
  1088. // Disable Swift tests as mixed targets are not supported (Xcode 12.3).
  1089. "Unit/Swift",
  1090. // Disable Keychain dependent tests as they require a host application on iOS.
  1091. "Integration",
  1092. "Unit/AppAttestProvider/Storage/FIRAppAttestArtifactStorageTests.m",
  1093. "Unit/Core/FIRAppCheckIntegrationTests.m",
  1094. "Unit/Core/FIRAppCheckStorageTests.m",
  1095. ],
  1096. resources: [
  1097. .process("Fixture"),
  1098. ],
  1099. cSettings: [
  1100. .headerSearchPath("../.."),
  1101. ]
  1102. ),
  1103. .testTarget(
  1104. name: "AppCheckUnitSwift",
  1105. dependencies: ["FirebaseAppCheck"],
  1106. path: "FirebaseAppCheck/Tests/Unit/Swift",
  1107. cSettings: [
  1108. .headerSearchPath("../.."),
  1109. ]
  1110. ),
  1111. // MARK: Testing support
  1112. .target(
  1113. name: "FirebaseFirestoreTestingSupport",
  1114. dependencies: ["FirebaseFirestore"],
  1115. path: "FirebaseTestingSupport/Firestore/Sources",
  1116. publicHeadersPath: "./",
  1117. cSettings: [
  1118. .headerSearchPath("../../.."),
  1119. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  1120. ]
  1121. ),
  1122. .testTarget(
  1123. name: "FirestoreTestingSupportTests",
  1124. dependencies: ["FirebaseFirestoreTestingSupport"],
  1125. path: "FirebaseTestingSupport/Firestore/Tests",
  1126. cSettings: [
  1127. .headerSearchPath("../../.."),
  1128. ]
  1129. ),
  1130. ],
  1131. cLanguageStandard: .c99,
  1132. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  1133. )