Package.swift 37 KB

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