Package.swift 38 KB

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