Package.swift 35 KB

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