Package.swift 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291
  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.4.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.1.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" ..< "4.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.1.0/FirebaseAnalytics.zip",
  321. checksum: "c5429b2e293d7ab2ed2f291bd5edf13f7612b4b69c8261259f48a7b948fa824d"
  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. .testTarget(
  520. name: "FirebaseCrashlyticsUnit",
  521. dependencies: ["FirebaseCrashlytics", "OCMock"],
  522. path: "Crashlytics/UnitTests",
  523. resources: [
  524. .process("FIRCLSMachO/data"),
  525. .copy("Data"),
  526. ],
  527. cSettings: [
  528. .headerSearchPath("../.."),
  529. .define("DISPLAY_VERSION", to: firebaseVersion),
  530. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  531. .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: [.macOS])),
  532. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  533. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  534. ]
  535. ),
  536. .target(
  537. name: "FirebaseDatabase",
  538. dependencies: [
  539. "FirebaseCore",
  540. "leveldb",
  541. ],
  542. path: "FirebaseDatabase/Sources",
  543. exclude: [
  544. "third_party/Wrap-leveldb/LICENSE",
  545. "third_party/SocketRocket/LICENSE",
  546. "third_party/FImmutableSortedDictionary/LICENSE",
  547. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  548. ],
  549. publicHeadersPath: "Public",
  550. cSettings: [
  551. .headerSearchPath("../../"),
  552. ],
  553. linkerSettings: [
  554. .linkedFramework("CFNetwork"),
  555. .linkedFramework("Security"),
  556. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  557. .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
  558. ]
  559. ),
  560. .testTarget(
  561. name: "DatabaseUnit",
  562. dependencies: ["FirebaseDatabase", "OCMock", "SharedTestUtilities"],
  563. path: "FirebaseDatabase/Tests/",
  564. exclude: [
  565. // Disable Swift tests as mixed targets are not supported (Xcode 12.4).
  566. "Unit/Swift",
  567. "Integration/",
  568. ],
  569. resources: [.process("Resources")],
  570. cSettings: [
  571. .headerSearchPath("../.."),
  572. ]
  573. ),
  574. .testTarget(
  575. name: "DatabaseUnitSwift",
  576. dependencies: ["FirebaseDatabase"],
  577. path: "FirebaseDatabase/Tests/Unit/Swift",
  578. cSettings: [
  579. .headerSearchPath("../.."),
  580. ]
  581. ),
  582. .target(
  583. name: "FirebaseDatabaseSwift",
  584. dependencies: ["FirebaseDatabase", "FirebaseSharedSwift"],
  585. path: "FirebaseDatabaseSwift/Sources"
  586. ),
  587. .testTarget(
  588. name: "FirebaseDatabaseSwiftTests",
  589. dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
  590. path: "FirebaseDatabaseSwift/Tests/"
  591. ),
  592. .target(
  593. name: "FirebaseSharedSwift",
  594. path: "FirebaseSharedSwift/Sources",
  595. exclude: [
  596. "third_party/FirebaseDataEncoder/LICENSE",
  597. "third_party/FirebaseDataEncoder/METADATA",
  598. ]
  599. ),
  600. .testTarget(
  601. name: "FirebaseSharedSwiftTests",
  602. dependencies: ["FirebaseSharedSwift"],
  603. path: "FirebaseSharedSwift/Tests/"
  604. ),
  605. .target(
  606. name: "FirebaseDynamicLinksTarget",
  607. dependencies: [.target(name: "FirebaseDynamicLinks",
  608. condition: .when(platforms: [.iOS]))],
  609. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  610. ),
  611. .target(
  612. name: "FirebaseDynamicLinks",
  613. dependencies: ["FirebaseCore"],
  614. path: "FirebaseDynamicLinks/Sources",
  615. publicHeadersPath: "Public",
  616. cSettings: [
  617. .headerSearchPath("../../"),
  618. .define("FIRDynamicLinks3P", to: "1"),
  619. .define("GIN_SCION_LOGGING", to: "1"),
  620. ],
  621. linkerSettings: [
  622. .linkedFramework("QuartzCore"),
  623. ]
  624. ),
  625. .target(
  626. name: "FirebaseFirestoreTarget",
  627. dependencies: [.target(name: "FirebaseFirestore",
  628. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  629. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  630. ),
  631. .target(
  632. name: "FirebaseFirestore",
  633. dependencies: [
  634. "FirebaseCore",
  635. "leveldb",
  636. .product(name: "nanopb", package: "nanopb"),
  637. .product(name: "abseil", package: "abseil"),
  638. .product(name: "gRPC-cpp", package: "gRPC"),
  639. ],
  640. path: "Firestore",
  641. exclude: [
  642. "CHANGELOG.md",
  643. "CMakeLists.txt",
  644. "Example/",
  645. "LICENSE",
  646. "Protos/CMakeLists.txt",
  647. "Protos/Podfile",
  648. "Protos/README.md",
  649. "Protos/build_protos.py",
  650. "Protos/cpp/",
  651. "Protos/lib/",
  652. "Protos/nanopb_cpp_generator.py",
  653. "Protos/protos/",
  654. "README.md",
  655. "Source/CMakeLists.txt",
  656. "Swift/",
  657. "core/CMakeLists.txt",
  658. "core/src/util/config_detected.h.in",
  659. "core/test/",
  660. "fuzzing/",
  661. "test.sh",
  662. // Swift PM doesn't recognize hpp files, so we're relying on search paths
  663. // to find third_party/nlohmann_json/json.hpp.
  664. "third_party/",
  665. // Exclude alternate implementations for other platforms
  666. "core/src/remote/connectivity_monitor_noop.cc",
  667. "core/src/util/filesystem_win.cc",
  668. "core/src/util/log_stdio.cc",
  669. "core/src/util/secure_random_openssl.cc",
  670. ],
  671. sources: [
  672. "Source/",
  673. "Protos/nanopb/",
  674. "core/include/",
  675. "core/src",
  676. ],
  677. publicHeadersPath: "Source/Public",
  678. cSettings: [
  679. .headerSearchPath("../"),
  680. .headerSearchPath("Source/Public/FirebaseFirestore"),
  681. .headerSearchPath("Protos/nanopb"),
  682. .define("PB_FIELD_32BIT", to: "1"),
  683. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  684. .define("PB_ENABLE_MALLOC", to: "1"),
  685. .define("FIRFirestore_VERSION", to: firebaseVersion),
  686. ],
  687. linkerSettings: [
  688. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  689. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  690. .linkedLibrary("c++"),
  691. ]
  692. ),
  693. .target(
  694. name: "FirebaseFirestoreSwiftTarget",
  695. dependencies: [.target(name: "FirebaseFirestoreSwift",
  696. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  697. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  698. ),
  699. .target(
  700. name: "FirebaseFirestoreSwift",
  701. dependencies: [
  702. "FirebaseCore",
  703. "FirebaseCoreExtension",
  704. "FirebaseFirestore",
  705. "FirebaseSharedSwift",
  706. ],
  707. path: "Firestore",
  708. exclude: [
  709. "CHANGELOG.md",
  710. "CMakeLists.txt",
  711. "Example/",
  712. "LICENSE",
  713. "Protos/",
  714. "README.md",
  715. "Source/",
  716. "core/",
  717. "fuzzing/",
  718. "test.sh",
  719. "Swift/CHANGELOG.md",
  720. "Swift/README.md",
  721. "Swift/Tests/",
  722. "third_party/nlohmann_json",
  723. ],
  724. sources: [
  725. "Swift/Source/",
  726. ]
  727. ),
  728. // MARK: - Firebase Functions
  729. .target(
  730. name: "FirebaseFunctions",
  731. dependencies: [
  732. "FirebaseAppCheckInterop",
  733. "FirebaseAuthInterop",
  734. "FirebaseCore",
  735. "FirebaseCoreExtension",
  736. "FirebaseMessagingInterop",
  737. "FirebaseSharedSwift",
  738. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  739. ],
  740. path: "FirebaseFunctions/Sources"
  741. ),
  742. .testTarget(
  743. name: "FirebaseFunctionsUnit",
  744. dependencies: ["FirebaseFunctions",
  745. "FirebaseAppCheckInterop",
  746. "FirebaseAuthInterop",
  747. "FirebaseMessagingInterop",
  748. "SharedTestUtilities"],
  749. path: "FirebaseFunctions/Tests/Unit",
  750. cSettings: [
  751. .headerSearchPath("../../../"),
  752. ]
  753. ),
  754. .testTarget(
  755. name: "FirebaseFunctionsIntegration",
  756. dependencies: ["FirebaseFunctions",
  757. "SharedTestUtilities"],
  758. path: "FirebaseFunctions/Tests/Integration"
  759. ),
  760. .testTarget(
  761. name: "FirebaseFunctionsObjCIntegration",
  762. dependencies: ["FirebaseFunctions",
  763. "SharedTestUtilities"],
  764. path: "FirebaseFunctions/Tests/ObjCIntegration",
  765. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  766. exclude: [
  767. "ObjCPPAPITests.mm",
  768. ],
  769. cSettings: [
  770. .headerSearchPath("../../.."),
  771. ]
  772. ),
  773. .target(
  774. name: "FirebaseFunctionsCombineSwift",
  775. dependencies: ["FirebaseFunctions"],
  776. path: "FirebaseCombineSwift/Sources/Functions"
  777. ),
  778. .testTarget(
  779. name: "FunctionsCombineUnit",
  780. dependencies: ["FirebaseFunctionsCombineSwift",
  781. "SharedTestUtilities"],
  782. path: "FirebaseFunctions/Tests/CombineUnit"
  783. ),
  784. // MARK: - Firebase In App Messaging
  785. .target(
  786. name: "FirebaseInAppMessagingTarget",
  787. dependencies: [
  788. .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
  789. ],
  790. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  791. ),
  792. .target(
  793. name: "FirebaseInAppMessaging",
  794. dependencies: [
  795. "FirebaseCore",
  796. "FirebaseInstallations",
  797. "FirebaseABTesting",
  798. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  799. .product(name: "nanopb", package: "nanopb"),
  800. .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
  801. ],
  802. path: "FirebaseInAppMessaging/Sources",
  803. exclude: [
  804. "DefaultUI/CHANGELOG.md",
  805. "DefaultUI/README.md",
  806. ],
  807. publicHeadersPath: "Public",
  808. cSettings: [
  809. .headerSearchPath("../../"),
  810. .define("PB_FIELD_32BIT", to: "1"),
  811. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  812. .define("PB_ENABLE_MALLOC", to: "1"),
  813. ]
  814. ),
  815. .target(
  816. name: "FirebaseInAppMessaging_iOS",
  817. path: "FirebaseInAppMessaging/iOS",
  818. resources: [.process("Resources")]
  819. ),
  820. .target(
  821. name: "FirebaseInAppMessagingSwift",
  822. dependencies: ["FirebaseInAppMessaging"],
  823. path: "FirebaseInAppMessaging/Swift/Source"
  824. ),
  825. .target(
  826. name: "FirebaseInstallations",
  827. dependencies: [
  828. "FirebaseCore",
  829. .product(name: "FBLPromises", package: "Promises"),
  830. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  831. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  832. ],
  833. path: "FirebaseInstallations/Source/Library",
  834. publicHeadersPath: "Public",
  835. cSettings: [
  836. .headerSearchPath("../../../"),
  837. ],
  838. linkerSettings: [
  839. .linkedFramework("Security"),
  840. ]
  841. ),
  842. .target(
  843. name: "FirebaseMLModelDownloader",
  844. dependencies: [
  845. "FirebaseCore",
  846. "FirebaseInstallations",
  847. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  848. .product(name: "GULLogger", package: "GoogleUtilities"),
  849. "SwiftProtobuf",
  850. ],
  851. path: "FirebaseMLModelDownloader/Sources",
  852. exclude: [
  853. "proto/firebase_ml_log_sdk.proto",
  854. ],
  855. cSettings: [
  856. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  857. ]
  858. ),
  859. .testTarget(
  860. name: "FirebaseMLModelDownloaderUnit",
  861. dependencies: ["FirebaseMLModelDownloader"],
  862. path: "FirebaseMLModelDownloader/Tests/Unit"
  863. ),
  864. .target(
  865. name: "FirebaseMessaging",
  866. dependencies: [
  867. "FirebaseCore",
  868. "FirebaseInstallations",
  869. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  870. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  871. .product(name: "GULReachability", package: "GoogleUtilities"),
  872. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  873. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  874. .product(name: "nanopb", package: "nanopb"),
  875. ],
  876. path: "FirebaseMessaging/Sources",
  877. publicHeadersPath: "Public",
  878. cSettings: [
  879. .headerSearchPath("../../"),
  880. .define("PB_FIELD_32BIT", to: "1"),
  881. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  882. .define("PB_ENABLE_MALLOC", to: "1"),
  883. ],
  884. linkerSettings: [
  885. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  886. ]
  887. ),
  888. // Internal headers only for consuming from Swift.
  889. .target(
  890. name: "FirebaseMessagingInterop",
  891. path: "FirebaseMessaging/Interop",
  892. publicHeadersPath: ".",
  893. cSettings: [
  894. .headerSearchPath("../../"),
  895. ]
  896. ),
  897. .testTarget(
  898. name: "MessagingUnit",
  899. dependencies: ["FirebaseMessaging", "SharedTestUtilities", "OCMock"],
  900. path: "FirebaseMessaging/Tests/UnitTests",
  901. exclude: [
  902. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  903. ],
  904. cSettings: [
  905. .headerSearchPath("../../.."),
  906. ]
  907. ),
  908. .target(
  909. name: "FirebasePerformanceTarget",
  910. dependencies: [.target(name: "FirebasePerformance",
  911. condition: .when(platforms: [.iOS, .tvOS]))],
  912. path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
  913. ),
  914. .target(
  915. name: "FirebasePerformance",
  916. dependencies: [
  917. "FirebaseCore",
  918. "FirebaseInstallations",
  919. "FirebaseRemoteConfig",
  920. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  921. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  922. .product(name: "GULISASwizzler", package: "GoogleUtilities"),
  923. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  924. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  925. .product(name: "nanopb", package: "nanopb"),
  926. ],
  927. path: "FirebasePerformance/Sources",
  928. publicHeadersPath: "Public",
  929. cSettings: [
  930. .headerSearchPath("../../"),
  931. .define("PB_FIELD_32BIT", to: "1"),
  932. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  933. .define("PB_ENABLE_MALLOC", to: "1"),
  934. .define("FIRPerformance_LIB_VERSION", to: firebaseVersion),
  935. ],
  936. linkerSettings: [
  937. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .tvOS])),
  938. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .tvOS])),
  939. .linkedFramework("QuartzCore", .when(platforms: [.iOS, .tvOS])),
  940. ]
  941. ),
  942. .testTarget(
  943. name: "PerformanceUnit",
  944. dependencies: [
  945. "FirebasePerformanceTarget",
  946. "OCMock",
  947. "SharedTestUtilities",
  948. "GCDWebServer",
  949. ],
  950. path: "FirebasePerformance/Tests/Unit",
  951. resources: [
  952. .process("FPRURLFilterTests-Info.plist"),
  953. .process("Server/smallDownloadFile"),
  954. .process("Server/bigDownloadFile"),
  955. ],
  956. cSettings: [
  957. .headerSearchPath("../../.."),
  958. .define("PB_FIELD_32BIT", to: "1"),
  959. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  960. .define("PB_ENABLE_MALLOC", to: "1"),
  961. ]
  962. ),
  963. .target(
  964. name: "SharedTestUtilities",
  965. dependencies: ["FirebaseCore",
  966. "FirebaseAppCheckInterop",
  967. "FirebaseAuthInterop",
  968. "FirebaseMessagingInterop",
  969. "GoogleDataTransport",
  970. "OCMock"],
  971. path: "SharedTestUtilities",
  972. publicHeadersPath: "./",
  973. cSettings: [
  974. .headerSearchPath("../"),
  975. ]
  976. ),
  977. // MARK: - Firebase Remote Config
  978. .target(
  979. name: "FirebaseRemoteConfig",
  980. dependencies: [
  981. "FirebaseCore",
  982. "FirebaseABTesting",
  983. "FirebaseInstallations",
  984. .product(name: "GULNSData", package: "GoogleUtilities"),
  985. ],
  986. path: "FirebaseRemoteConfig/Sources",
  987. publicHeadersPath: "Public",
  988. cSettings: [
  989. .headerSearchPath("../../"),
  990. ]
  991. ),
  992. .testTarget(
  993. name: "RemoteConfigUnit",
  994. dependencies: ["FirebaseRemoteConfig", "OCMock"],
  995. path: "FirebaseRemoteConfig/Tests/Unit",
  996. exclude: [
  997. // Need to be evaluated/ported to RC V2.
  998. "RCNConfigAnalyticsTest.m",
  999. "RCNConfigSettingsTest.m",
  1000. "RCNConfigTest.m",
  1001. "RCNRemoteConfig+FIRAppTest.m",
  1002. "RCNThrottlingTests.m",
  1003. ],
  1004. resources: [
  1005. .process("SecondApp-GoogleService-Info.plist"),
  1006. .process("Defaults-testInfo.plist"),
  1007. .process("TestABTPayload.txt"),
  1008. ],
  1009. cSettings: [
  1010. .headerSearchPath("../../.."),
  1011. ]
  1012. ),
  1013. .target(
  1014. name: "FirebaseRemoteConfigSwift",
  1015. dependencies: [
  1016. "FirebaseRemoteConfig",
  1017. "FirebaseSharedSwift",
  1018. ],
  1019. path: "FirebaseRemoteConfigSwift/Sources"
  1020. ),
  1021. .testTarget(
  1022. name: "RemoteConfigFakeConsole",
  1023. dependencies: ["FirebaseRemoteConfigSwift",
  1024. "RemoteConfigFakeConsoleObjC"],
  1025. path: "FirebaseRemoteConfigSwift/Tests",
  1026. exclude: [
  1027. "AccessToken.json",
  1028. "README.md",
  1029. "ObjC/",
  1030. ],
  1031. resources: [
  1032. .process("Defaults-testInfo.plist"),
  1033. ],
  1034. cSettings: [
  1035. .headerSearchPath("../../"),
  1036. ]
  1037. ),
  1038. .target(
  1039. name: "RemoteConfigFakeConsoleObjC",
  1040. dependencies: ["OCMock"],
  1041. path: "FirebaseRemoteConfigSwift/Tests/ObjC",
  1042. publicHeadersPath: ".",
  1043. cSettings: [
  1044. .headerSearchPath("../../../"),
  1045. ]
  1046. ),
  1047. // MARK: - Firebase Storage
  1048. .target(
  1049. name: "FirebaseStorage",
  1050. dependencies: [
  1051. "FirebaseAppCheckInterop",
  1052. "FirebaseAuthInterop",
  1053. "FirebaseCore",
  1054. "FirebaseCoreExtension",
  1055. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  1056. ],
  1057. path: "FirebaseStorage/Sources"
  1058. ),
  1059. .testTarget(
  1060. name: "FirebaseStorageUnit",
  1061. dependencies: ["FirebaseStorage",
  1062. "SharedTestUtilities"],
  1063. path: "FirebaseStorage/Tests/Unit",
  1064. cSettings: [
  1065. .headerSearchPath("../../../"),
  1066. ]
  1067. ),
  1068. .testTarget(
  1069. name: "StorageObjCIntegration",
  1070. dependencies: ["FirebaseStorage"],
  1071. path: "FirebaseStorage/Tests/ObjCIntegration",
  1072. exclude: [
  1073. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  1074. "FIRStorageIntegrationTests.m",
  1075. "ObjCPPAPITests.mm",
  1076. "Credentials.h",
  1077. ],
  1078. cSettings: [
  1079. .headerSearchPath("../../.."),
  1080. ]
  1081. ),
  1082. .testTarget(
  1083. name: "swift-test",
  1084. dependencies: [
  1085. "Firebase",
  1086. "FirebaseAuth",
  1087. "FirebaseAppCheck",
  1088. "FirebaseABTesting",
  1089. "FirebaseAnalytics",
  1090. "FirebaseAnalyticsSwift",
  1091. .target(name: "FirebaseAppDistribution",
  1092. condition: .when(platforms: [.iOS])),
  1093. "FirebaseAuthCombineSwift",
  1094. "FirebaseFirestoreCombineSwift",
  1095. "FirebaseFunctionsCombineSwift",
  1096. "FirebaseStorageCombineSwift",
  1097. "FirebaseCrashlytics",
  1098. "FirebaseCore",
  1099. "FirebaseDatabase",
  1100. "FirebaseDynamicLinks",
  1101. "FirebaseFirestore",
  1102. "FirebaseFirestoreSwift",
  1103. "FirebaseFunctions",
  1104. "FirebaseInAppMessaging",
  1105. .target(name: "FirebaseInAppMessagingSwift",
  1106. condition: .when(platforms: [.iOS, .tvOS])),
  1107. "FirebaseInstallations",
  1108. "FirebaseMessaging",
  1109. .target(name: "FirebasePerformance",
  1110. condition: .when(platforms: [.iOS, .tvOS])),
  1111. "FirebaseRemoteConfig",
  1112. "FirebaseStorage",
  1113. .product(name: "nanopb", package: "nanopb"),
  1114. ],
  1115. path: "SwiftPMTests/swift-test"
  1116. ),
  1117. .testTarget(
  1118. name: "analytics-import-test",
  1119. dependencies: [
  1120. "FirebaseAnalyticsSwiftTarget",
  1121. "FirebaseAnalyticsWrapper",
  1122. "Firebase",
  1123. ],
  1124. path: "SwiftPMTests/analytics-import-test"
  1125. ),
  1126. .testTarget(
  1127. name: "objc-import-test",
  1128. dependencies: [
  1129. "Firebase",
  1130. "FirebaseAuth",
  1131. "FirebaseABTesting",
  1132. "FirebaseAppCheck",
  1133. .target(name: "FirebaseAppDistribution",
  1134. condition: .when(platforms: [.iOS])),
  1135. "FirebaseCrashlytics",
  1136. "FirebaseCore",
  1137. "FirebaseDatabase",
  1138. "FirebaseDynamicLinks",
  1139. "FirebaseFirestore",
  1140. "FirebaseFunctions",
  1141. "FirebaseInAppMessaging",
  1142. "FirebaseInstallations",
  1143. "FirebaseMessaging",
  1144. .target(name: "FirebasePerformance",
  1145. condition: .when(platforms: [.iOS, .tvOS])),
  1146. "FirebaseRemoteConfig",
  1147. "FirebaseStorage",
  1148. ],
  1149. path: "SwiftPMTests/objc-import-test"
  1150. ),
  1151. .testTarget(
  1152. name: "version-test",
  1153. dependencies: [
  1154. "FirebaseCore",
  1155. ],
  1156. path: "SwiftPMTests/version-test",
  1157. cSettings: [
  1158. .define("FIR_VERSION", to: firebaseVersion),
  1159. ]
  1160. ),
  1161. // MARK: - Firebase App Check
  1162. .target(name: "FirebaseAppCheck",
  1163. dependencies: [
  1164. "FirebaseCore",
  1165. .product(name: "FBLPromises", package: "Promises"),
  1166. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  1167. ],
  1168. path: "FirebaseAppCheck/Sources",
  1169. publicHeadersPath: "Public",
  1170. cSettings: [
  1171. .headerSearchPath("../.."),
  1172. ],
  1173. linkerSettings: [
  1174. .linkedFramework("DeviceCheck", .when(platforms: [.iOS, .macOS, .tvOS])),
  1175. ]),
  1176. // Internal headers only for consuming from Swift.
  1177. .target(
  1178. name: "FirebaseAppCheckInterop",
  1179. path: "FirebaseAppCheck/Interop",
  1180. exclude: [
  1181. "CMakeLists.txt",
  1182. ],
  1183. publicHeadersPath: ".",
  1184. cSettings: [
  1185. .headerSearchPath("../../"),
  1186. ]
  1187. ),
  1188. .testTarget(
  1189. name: "AppCheckUnit",
  1190. dependencies: [
  1191. "FirebaseAppCheck",
  1192. "OCMock",
  1193. "SharedTestUtilities",
  1194. "HeartbeatLoggingTestUtils",
  1195. ],
  1196. path: "FirebaseAppCheck/Tests",
  1197. exclude: [
  1198. // Disable Swift tests as mixed targets are not supported (Xcode 12.3).
  1199. "Unit/Swift",
  1200. ],
  1201. resources: [
  1202. .process("Fixture"),
  1203. ],
  1204. cSettings: [
  1205. .headerSearchPath("../.."),
  1206. ]
  1207. ),
  1208. .testTarget(
  1209. name: "AppCheckUnitSwift",
  1210. dependencies: ["FirebaseAppCheck"],
  1211. path: "FirebaseAppCheck/Tests/Unit/Swift",
  1212. cSettings: [
  1213. .headerSearchPath("../.."),
  1214. ]
  1215. ),
  1216. // MARK: Testing support
  1217. .target(
  1218. name: "FirebaseFirestoreTestingSupport",
  1219. dependencies: ["FirebaseFirestore"],
  1220. path: "FirebaseTestingSupport/Firestore/Sources",
  1221. publicHeadersPath: "./",
  1222. cSettings: [
  1223. .headerSearchPath("../../.."),
  1224. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  1225. ]
  1226. ),
  1227. .testTarget(
  1228. name: "FirestoreTestingSupportTests",
  1229. dependencies: ["FirebaseFirestoreTestingSupport"],
  1230. path: "FirebaseTestingSupport/Firestore/Tests",
  1231. cSettings: [
  1232. .headerSearchPath("../../.."),
  1233. ]
  1234. ),
  1235. ],
  1236. cLanguageStandard: .c99,
  1237. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  1238. )
  1239. if ProcessInfo.processInfo.environment["FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT"] != nil {
  1240. if let GoogleAppMeasurementIndex = package.dependencies
  1241. .firstIndex(where: { $0.name == "GoogleAppMeasurement" }) {
  1242. package.dependencies[GoogleAppMeasurementIndex] = .package(
  1243. name: "GoogleAppMeasurement",
  1244. url: "https://github.com/google/GoogleAppMeasurement.git",
  1245. .branch("main")
  1246. )
  1247. }
  1248. }