Package.swift 38 KB

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