Package.swift 40 KB

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