Package.swift 38 KB

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