Package.swift 51 KB

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