Package.swift 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297
  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 = "9.0.0"
  20. let package = Package(
  21. name: "Firebase",
  22. platforms: [.iOS(.v11), .macOS(.v10_12), .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: "FirebaseAnalyticsSwift",
  34. targets: ["FirebaseAnalyticsSwiftTarget"]
  35. ),
  36. .library(
  37. name: "FirebaseAuth",
  38. targets: ["FirebaseAuth"]
  39. ),
  40. .library(
  41. name: "FirebaseAppCheck",
  42. targets: ["FirebaseAppCheck"]
  43. ),
  44. .library(
  45. name: "FirebaseAppDistribution-Beta",
  46. targets: ["FirebaseAppDistributionTarget"]
  47. ),
  48. .library(
  49. name: "FirebaseAuthCombine-Community",
  50. targets: ["FirebaseAuthCombineSwift"]
  51. ),
  52. .library(
  53. name: "FirebaseFirestoreCombine-Community",
  54. targets: ["FirebaseFirestoreCombineSwift"]
  55. ),
  56. .library(
  57. name: "FirebaseFunctionsCombine-Community",
  58. targets: ["FirebaseFunctionsCombineSwift"]
  59. ),
  60. .library(
  61. name: "FirebaseStorageCombine-Community",
  62. targets: ["FirebaseStorageCombineSwift"]
  63. ),
  64. .library(
  65. name: "FirebaseCrashlytics",
  66. targets: ["FirebaseCrashlytics"]
  67. ),
  68. .library(
  69. name: "FirebaseDatabase",
  70. targets: ["FirebaseDatabase"]
  71. ),
  72. .library(
  73. name: "FirebaseDatabaseSwift",
  74. targets: ["FirebaseDatabaseSwift"]
  75. ),
  76. .library(
  77. name: "FirebaseDynamicLinks",
  78. targets: ["FirebaseDynamicLinksTarget"]
  79. ),
  80. .library(
  81. name: "FirebaseFirestore",
  82. targets: ["FirebaseFirestoreTarget"]
  83. ),
  84. .library(
  85. name: "FirebaseFirestoreSwift",
  86. targets: ["FirebaseFirestoreSwiftTarget"]
  87. ),
  88. .library(
  89. name: "FirebaseFunctions",
  90. targets: ["FirebaseFunctions"]
  91. ),
  92. .library(
  93. name: "FirebaseInAppMessaging-Beta",
  94. targets: ["FirebaseInAppMessagingTarget"]
  95. ),
  96. .library(
  97. name: "FirebaseInAppMessagingSwift-Beta",
  98. targets: ["FirebaseInAppMessagingSwift"]
  99. ),
  100. .library(
  101. name: "FirebaseInstallations",
  102. targets: ["FirebaseInstallations"]
  103. ),
  104. .library(
  105. name: "FirebaseMessaging",
  106. targets: ["FirebaseMessaging"]
  107. ),
  108. .library(
  109. name: "FirebaseMLModelDownloader",
  110. targets: ["FirebaseMLModelDownloader"]
  111. ),
  112. .library(
  113. name: "FirebasePerformance",
  114. targets: ["FirebasePerformanceTarget"]
  115. ),
  116. .library(
  117. name: "FirebaseRemoteConfig",
  118. targets: ["FirebaseRemoteConfig"]
  119. ),
  120. .library(
  121. name: "FirebaseRemoteConfigSwift",
  122. targets: ["FirebaseRemoteConfigSwift"]
  123. ),
  124. .library(
  125. name: "FirebaseStorage",
  126. targets: ["FirebaseStorage"]
  127. ),
  128. ],
  129. dependencies: [
  130. .package(
  131. name: "Promises",
  132. url: "https://github.com/google/promises.git",
  133. "2.0.0" ..< "3.0.0"
  134. ),
  135. .package(
  136. name: "SwiftProtobuf",
  137. url: "https://github.com/apple/swift-protobuf.git",
  138. "1.15.0" ..< "2.0.0"
  139. ),
  140. .package(
  141. name: "GoogleAppMeasurement",
  142. url: "https://github.com/google/GoogleAppMeasurement.git",
  143. // Note that CI changes the version to the head of main for CI.
  144. // See scripts/setup_spm_tests.sh.
  145. .exact("8.15.0")
  146. ),
  147. .package(
  148. name: "GoogleDataTransport",
  149. url: "https://github.com/google/GoogleDataTransport.git",
  150. "9.1.2" ..< "10.0.0"
  151. ),
  152. .package(
  153. name: "GoogleUtilities",
  154. url: "https://github.com/google/GoogleUtilities.git",
  155. "7.6.0" ..< "8.0.0"
  156. ),
  157. .package(
  158. name: "GTMSessionFetcher",
  159. url: "https://github.com/google/gtm-session-fetcher.git",
  160. "1.5.0" ..< "2.0.0"
  161. ),
  162. .package(
  163. name: "nanopb",
  164. url: "https://github.com/firebase/nanopb.git",
  165. "2.30908.0" ..< "2.30909.0"
  166. ),
  167. .package(
  168. name: "abseil",
  169. url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
  170. "0.20220203.1" ..< "0.20220204.0"
  171. ),
  172. .package(
  173. name: "gRPC",
  174. url: "https://github.com/grpc/grpc-ios.git",
  175. "1.44.0-grpc" ..< "1.45.0-grpc"
  176. ),
  177. .package(
  178. name: "OCMock",
  179. url: "https://github.com/erikdoe/ocmock.git",
  180. .revision("c5eeaa6dde7c308a5ce48ae4d4530462dd3a1110")
  181. ),
  182. .package(
  183. name: "leveldb",
  184. url: "https://github.com/firebase/leveldb.git",
  185. "1.22.2" ..< "1.23.0"
  186. ),
  187. .package(
  188. name: "GCDWebServer",
  189. url: "https://github.com/SlaunchaMan/GCDWebServer.git",
  190. .revision("935e2736044e71e5341663c3cc9a335ba6867a2b")
  191. ),
  192. ],
  193. targets: [
  194. .target(
  195. name: "Firebase",
  196. path: "CoreOnly/Sources",
  197. publicHeadersPath: "./"
  198. ),
  199. .target(
  200. name: "FirebaseCore",
  201. dependencies: [
  202. "Firebase",
  203. "FirebaseCoreDiagnostics",
  204. "FirebaseCoreInternal",
  205. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  206. .product(name: "GULLogger", package: "GoogleUtilities"),
  207. ],
  208. path: "FirebaseCore/Sources",
  209. publicHeadersPath: "Public",
  210. cSettings: [
  211. .headerSearchPath("../.."),
  212. .define("Firebase_VERSION", to: firebaseVersion),
  213. // TODO: - Add support for cflags cSetting so that we can set the -fno-autolink option
  214. ],
  215. linkerSettings: [
  216. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  217. .linkedFramework("AppKit", .when(platforms: [.macOS])),
  218. ]
  219. ),
  220. .testTarget(
  221. name: "CoreUnit",
  222. dependencies: [
  223. "FirebaseCore",
  224. "SharedTestUtilities",
  225. "HeartbeatLoggingTestUtils",
  226. "OCMock",
  227. ],
  228. path: "FirebaseCore/Tests/Unit",
  229. exclude: ["Resources/GoogleService-Info.plist"],
  230. cSettings: [
  231. .headerSearchPath("../../.."),
  232. ]
  233. ),
  234. // MARK: - Firebase Core Extension
  235. // Extension of FirebaseCore for consuming by Swift product SDKs.
  236. .target(
  237. name: "FirebaseCoreExtension",
  238. path: "FirebaseCore/Extension",
  239. publicHeadersPath: ".",
  240. cSettings: [
  241. .headerSearchPath("../../"),
  242. ]
  243. ),
  244. // MARK: - Firebase Core Internal
  245. // Shared collection of APIs for internal FirebaseCore usage.
  246. .target(
  247. name: "FirebaseCoreInternal",
  248. dependencies: [
  249. .product(name: "GULNSData", package: "GoogleUtilities"),
  250. ],
  251. path: "FirebaseCore/Internal/Sources"
  252. ),
  253. .target(
  254. name: "HeartbeatLoggingTestUtils",
  255. dependencies: ["FirebaseCoreInternal"],
  256. path: "HeartbeatLoggingTestUtils/Sources"
  257. ),
  258. .testTarget(
  259. name: "FirebaseCoreInternalTests",
  260. dependencies: [
  261. "FirebaseCoreInternal",
  262. "HeartbeatLoggingTestUtils",
  263. ],
  264. path: "FirebaseCore/Internal/Tests"
  265. ),
  266. .target(
  267. name: "FirebaseCoreDiagnostics",
  268. dependencies: [
  269. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  270. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  271. .product(name: "GULLogger", package: "GoogleUtilities"),
  272. .product(name: "nanopb", package: "nanopb"),
  273. ],
  274. path: "Firebase/CoreDiagnostics/FIRCDLibrary",
  275. publicHeadersPath: ".",
  276. cSettings: [
  277. .headerSearchPath("../../.."),
  278. .define("PB_FIELD_32BIT", to: "1"),
  279. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  280. .define("PB_ENABLE_MALLOC", to: "1"),
  281. ]
  282. ),
  283. .target(
  284. name: "FirebaseABTesting",
  285. dependencies: ["FirebaseCore"],
  286. path: "FirebaseABTesting/Sources",
  287. publicHeadersPath: "Public",
  288. cSettings: [
  289. .headerSearchPath("../../"),
  290. ]
  291. ),
  292. .testTarget(
  293. name: "ABTestingUnit",
  294. dependencies: ["FirebaseABTesting", "OCMock"],
  295. path: "FirebaseABTesting/Tests/Unit",
  296. resources: [.process("Resources")],
  297. cSettings: [
  298. .headerSearchPath("../../.."),
  299. ]
  300. ),
  301. .target(
  302. name: "FirebaseAnalyticsTarget",
  303. dependencies: [.target(name: "FirebaseAnalyticsWrapper",
  304. condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
  305. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWrap"
  306. ),
  307. .target(
  308. name: "FirebaseAnalyticsWrapper",
  309. dependencies: [
  310. .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
  311. .product(name: "GoogleAppMeasurement",
  312. package: "GoogleAppMeasurement",
  313. condition: .when(platforms: [.iOS, .macOS, .tvOS])),
  314. "FirebaseCore",
  315. "FirebaseInstallations",
  316. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  317. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  318. .product(name: "GULNSData", package: "GoogleUtilities"),
  319. .product(name: "GULNetwork", package: "GoogleUtilities"),
  320. .product(name: "nanopb", package: "nanopb"),
  321. ],
  322. path: "FirebaseAnalyticsWrapper",
  323. linkerSettings: [
  324. .linkedLibrary("sqlite3"),
  325. .linkedLibrary("c++"),
  326. .linkedLibrary("z"),
  327. .linkedFramework("StoreKit"),
  328. ]
  329. ),
  330. .binaryTarget(
  331. name: "FirebaseAnalytics",
  332. url: "https://dl.google.com/firebase/ios/swiftpm/8.15.0/FirebaseAnalytics.zip",
  333. checksum: "9d075b16e9e32e2328afdee11bba33ef075ba7be106312a14c5601310d6ecd92"
  334. ),
  335. .target(
  336. name: "FirebaseAnalyticsSwiftTarget",
  337. dependencies: [.target(name: "FirebaseAnalyticsSwift",
  338. condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
  339. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
  340. ),
  341. .target(
  342. name: "FirebaseAnalyticsSwift",
  343. dependencies: ["FirebaseAnalyticsWrapper"],
  344. path: "FirebaseAnalyticsSwift/Sources"
  345. ),
  346. .target(
  347. name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
  348. dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  349. condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
  350. path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
  351. ),
  352. .target(
  353. name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  354. dependencies: [
  355. .target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
  356. .product(name: "GoogleAppMeasurementWithoutAdIdSupport",
  357. package: "GoogleAppMeasurement",
  358. condition: .when(platforms: [.iOS])),
  359. "FirebaseCore",
  360. "FirebaseInstallations",
  361. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  362. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  363. .product(name: "GULNSData", package: "GoogleUtilities"),
  364. .product(name: "GULNetwork", package: "GoogleUtilities"),
  365. .product(name: "nanopb", package: "nanopb"),
  366. ],
  367. path: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
  368. linkerSettings: [
  369. .linkedLibrary("sqlite3"),
  370. .linkedLibrary("c++"),
  371. .linkedLibrary("z"),
  372. .linkedFramework("StoreKit"),
  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. "FirebaseStorageInternal",
  475. ],
  476. path: "FirebaseCombineSwift/Sources/Storage"
  477. ),
  478. .target(
  479. name: "FirebaseCrashlytics",
  480. dependencies: ["FirebaseCore", "FirebaseInstallations",
  481. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  482. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  483. .product(name: "FBLPromises", package: "Promises"),
  484. .product(name: "nanopb", package: "nanopb")],
  485. path: "Crashlytics",
  486. exclude: [
  487. "run",
  488. "CHANGELOG.md",
  489. "LICENSE",
  490. "README.md",
  491. "ProtoSupport/",
  492. "UnitTests/",
  493. "generate_project.sh",
  494. "upload-symbols",
  495. "third_party/libunwind/LICENSE",
  496. ],
  497. sources: [
  498. "Crashlytics/",
  499. "Protogen/",
  500. "Shared/",
  501. "third_party/libunwind/dwarf.h",
  502. ],
  503. publicHeadersPath: "Crashlytics/Public",
  504. cSettings: [
  505. .headerSearchPath(".."),
  506. .define("DISPLAY_VERSION", to: firebaseVersion),
  507. .define("CLS_SDK_NAME", to: "Crashlytics iOS SDK", .when(platforms: [.iOS])),
  508. .define("CLS_SDK_NAME", to: "Crashlytics macOS SDK", .when(platforms: [.macOS])),
  509. .define("CLS_SDK_NAME", to: "Crashlytics tvOS SDK", .when(platforms: [.tvOS])),
  510. .define("CLS_SDK_NAME", to: "Crashlytics watchOS SDK", .when(platforms: [.watchOS])),
  511. .define("PB_FIELD_32BIT", to: "1"),
  512. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  513. .define("PB_ENABLE_MALLOC", to: "1"),
  514. ],
  515. linkerSettings: [
  516. .linkedFramework("Security"),
  517. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  518. ]
  519. ),
  520. .target(
  521. name: "FirebaseDatabase",
  522. dependencies: [
  523. "FirebaseCore",
  524. "leveldb",
  525. ],
  526. path: "FirebaseDatabase/Sources",
  527. exclude: [
  528. "third_party/Wrap-leveldb/LICENSE",
  529. "third_party/SocketRocket/LICENSE",
  530. "third_party/FImmutableSortedDictionary/LICENSE",
  531. "third_party/SocketRocket/aa2297808c225710e267afece4439c256f6efdb3",
  532. ],
  533. publicHeadersPath: "Public",
  534. cSettings: [
  535. .headerSearchPath("../../"),
  536. ],
  537. linkerSettings: [
  538. .linkedFramework("CFNetwork"),
  539. .linkedFramework("Security"),
  540. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  541. .linkedFramework("WatchKit", .when(platforms: [.watchOS])),
  542. ]
  543. ),
  544. .testTarget(
  545. name: "DatabaseUnit",
  546. dependencies: ["FirebaseDatabase", "OCMock", "SharedTestUtilities"],
  547. path: "FirebaseDatabase/Tests/",
  548. exclude: [
  549. // Disable Swift tests as mixed targets are not supported (Xcode 12.4).
  550. "Unit/Swift",
  551. "Integration/",
  552. ],
  553. resources: [.process("Resources")],
  554. cSettings: [
  555. .headerSearchPath("../.."),
  556. ]
  557. ),
  558. .testTarget(
  559. name: "DatabaseUnitSwift",
  560. dependencies: ["FirebaseDatabase"],
  561. path: "FirebaseDatabase/Tests/Unit/Swift",
  562. cSettings: [
  563. .headerSearchPath("../.."),
  564. ]
  565. ),
  566. .target(
  567. name: "FirebaseDatabaseSwift",
  568. dependencies: ["FirebaseDatabase", "FirebaseSharedSwift"],
  569. path: "FirebaseDatabaseSwift/Sources"
  570. ),
  571. .testTarget(
  572. name: "FirebaseDatabaseSwiftTests",
  573. dependencies: ["FirebaseDatabase", "FirebaseDatabaseSwift"],
  574. path: "FirebaseDatabaseSwift/Tests/"
  575. ),
  576. .target(
  577. name: "FirebaseSharedSwift",
  578. path: "FirebaseSharedSwift/Sources",
  579. exclude: [
  580. "third_party/FirebaseDataEncoder/LICENSE",
  581. "third_party/FirebaseDataEncoder/METADATA",
  582. ]
  583. ),
  584. .testTarget(
  585. name: "FirebaseSharedSwiftTests",
  586. dependencies: ["FirebaseSharedSwift"],
  587. path: "FirebaseSharedSwift/Tests/"
  588. ),
  589. .target(
  590. name: "FirebaseDynamicLinksTarget",
  591. dependencies: [.target(name: "FirebaseDynamicLinks",
  592. condition: .when(platforms: [.iOS]))],
  593. path: "SwiftPM-PlatformExclude/FirebaseDynamicLinksWrap"
  594. ),
  595. .target(
  596. name: "FirebaseDynamicLinks",
  597. dependencies: ["FirebaseCore"],
  598. path: "FirebaseDynamicLinks/Sources",
  599. publicHeadersPath: "Public",
  600. cSettings: [
  601. .headerSearchPath("../../"),
  602. .define("FIRDynamicLinks3P", to: "1"),
  603. .define("GIN_SCION_LOGGING", to: "1"),
  604. ],
  605. linkerSettings: [
  606. .linkedFramework("QuartzCore"),
  607. ]
  608. ),
  609. .target(
  610. name: "FirebaseFirestoreTarget",
  611. dependencies: [.target(name: "FirebaseFirestore",
  612. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  613. path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
  614. ),
  615. .target(
  616. name: "FirebaseFirestore",
  617. dependencies: [
  618. "FirebaseCore",
  619. "leveldb",
  620. .product(name: "nanopb", package: "nanopb"),
  621. .product(name: "abseil", package: "abseil"),
  622. .product(name: "gRPC-cpp", package: "gRPC"),
  623. ],
  624. path: "Firestore",
  625. exclude: [
  626. "CHANGELOG.md",
  627. "CMakeLists.txt",
  628. "Example/",
  629. "LICENSE",
  630. "Protos/CMakeLists.txt",
  631. "Protos/Podfile",
  632. "Protos/README.md",
  633. "Protos/build_protos.py",
  634. "Protos/cpp/",
  635. "Protos/lib/",
  636. "Protos/nanopb_cpp_generator.py",
  637. "Protos/protos/",
  638. "README.md",
  639. "Source/CMakeLists.txt",
  640. "Swift/",
  641. "core/CMakeLists.txt",
  642. "core/src/util/config_detected.h.in",
  643. "core/test/",
  644. "fuzzing/",
  645. "test.sh",
  646. // Swift PM doesn't recognize hpp files, so we're relying on search paths
  647. // to find third_party/nlohmann_json/json.hpp.
  648. "third_party/",
  649. // Exclude alternate implementations for other platforms
  650. "core/src/remote/connectivity_monitor_noop.cc",
  651. "core/src/util/filesystem_win.cc",
  652. "core/src/util/log_stdio.cc",
  653. "core/src/util/secure_random_openssl.cc",
  654. ],
  655. sources: [
  656. "Source/",
  657. "Protos/nanopb/",
  658. "core/include/",
  659. "core/src",
  660. ],
  661. publicHeadersPath: "Source/Public",
  662. cSettings: [
  663. .headerSearchPath("../"),
  664. .headerSearchPath("Source/Public/FirebaseFirestore"),
  665. .headerSearchPath("Protos/nanopb"),
  666. .define("PB_FIELD_32BIT", to: "1"),
  667. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  668. .define("PB_ENABLE_MALLOC", to: "1"),
  669. .define("FIRFirestore_VERSION", to: firebaseVersion),
  670. ],
  671. linkerSettings: [
  672. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  673. .linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
  674. .linkedLibrary("c++"),
  675. ]
  676. ),
  677. .target(
  678. name: "FirebaseFirestoreSwiftTarget",
  679. dependencies: [.target(name: "FirebaseFirestoreSwift",
  680. condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
  681. path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
  682. ),
  683. .target(
  684. name: "FirebaseFirestoreSwift",
  685. dependencies: ["FirebaseFirestore"],
  686. path: "Firestore",
  687. exclude: [
  688. "CHANGELOG.md",
  689. "CMakeLists.txt",
  690. "Example/",
  691. "LICENSE",
  692. "Protos/",
  693. "README.md",
  694. "Source/",
  695. "core/",
  696. "fuzzing/",
  697. "test.sh",
  698. "Swift/CHANGELOG.md",
  699. "Swift/README.md",
  700. "Swift/Tests/",
  701. "third_party/nlohmann_json",
  702. "third_party/FirestoreEncoder/LICENSE",
  703. "third_party/FirestoreEncoder/METADATA",
  704. ],
  705. sources: [
  706. "Swift/Source/",
  707. "third_party/FirestoreEncoder/",
  708. ]
  709. ),
  710. // MARK: - Firebase Functions
  711. .target(
  712. name: "FirebaseFunctions",
  713. dependencies: [
  714. "FirebaseAppCheckInterop",
  715. "FirebaseAuthInterop",
  716. "FirebaseCore",
  717. "FirebaseCoreExtension",
  718. "FirebaseMessagingInterop",
  719. "FirebaseSharedSwift",
  720. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  721. ],
  722. path: "FirebaseFunctions/Sources"
  723. ),
  724. .testTarget(
  725. name: "FirebaseFunctionsUnit",
  726. dependencies: ["FirebaseFunctions",
  727. "FirebaseAppCheckInterop",
  728. "FirebaseAuthInterop",
  729. "FirebaseMessagingInterop",
  730. "SharedTestUtilities"],
  731. path: "FirebaseFunctions/Tests/Unit",
  732. cSettings: [
  733. .headerSearchPath("../../../"),
  734. ]
  735. ),
  736. .testTarget(
  737. name: "FirebaseFunctionsIntegration",
  738. dependencies: ["FirebaseFunctions",
  739. "SharedTestUtilities"],
  740. path: "FirebaseFunctions/Tests/Integration"
  741. ),
  742. .testTarget(
  743. name: "FirebaseFunctionsObjCIntegration",
  744. dependencies: ["FirebaseFunctions",
  745. "SharedTestUtilities"],
  746. path: "FirebaseFunctions/Tests/ObjCIntegration",
  747. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  748. exclude: [
  749. "ObjCPPAPITests.mm",
  750. ],
  751. cSettings: [
  752. .headerSearchPath("../../.."),
  753. ]
  754. ),
  755. .target(
  756. name: "FirebaseFunctionsCombineSwift",
  757. dependencies: ["FirebaseFunctions"],
  758. path: "FirebaseCombineSwift/Sources/Functions"
  759. ),
  760. .testTarget(
  761. name: "FunctionsCombineUnit",
  762. dependencies: ["FirebaseFunctionsCombineSwift",
  763. "SharedTestUtilities"],
  764. path: "FirebaseFunctions/Tests/CombineUnit"
  765. ),
  766. // MARK: - Firebase In App Messaging
  767. .target(
  768. name: "FirebaseInAppMessagingTarget",
  769. dependencies: [
  770. .target(name: "FirebaseInAppMessaging", condition: .when(platforms: [.iOS, .tvOS])),
  771. ],
  772. path: "SwiftPM-PlatformExclude/FirebaseInAppMessagingWrap"
  773. ),
  774. .target(
  775. name: "FirebaseInAppMessaging",
  776. dependencies: [
  777. "FirebaseCore",
  778. "FirebaseInstallations",
  779. "FirebaseABTesting",
  780. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  781. .product(name: "nanopb", package: "nanopb"),
  782. .target(name: "FirebaseInAppMessaging_iOS", condition: .when(platforms: [.iOS])),
  783. ],
  784. path: "FirebaseInAppMessaging/Sources",
  785. exclude: [
  786. "DefaultUI/CHANGELOG.md",
  787. "DefaultUI/README.md",
  788. ],
  789. publicHeadersPath: "Public",
  790. cSettings: [
  791. .headerSearchPath("../../"),
  792. .define("PB_FIELD_32BIT", to: "1"),
  793. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  794. .define("PB_ENABLE_MALLOC", to: "1"),
  795. ]
  796. ),
  797. .target(
  798. name: "FirebaseInAppMessaging_iOS",
  799. path: "FirebaseInAppMessaging/iOS",
  800. resources: [.process("Resources")]
  801. ),
  802. .target(
  803. name: "FirebaseInAppMessagingSwift",
  804. dependencies: ["FirebaseInAppMessaging"],
  805. path: "FirebaseInAppMessaging/Swift/Source"
  806. ),
  807. .target(
  808. name: "FirebaseInstallations",
  809. dependencies: [
  810. "FirebaseCore",
  811. .product(name: "FBLPromises", package: "Promises"),
  812. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  813. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  814. ],
  815. path: "FirebaseInstallations/Source/Library",
  816. publicHeadersPath: "Public",
  817. cSettings: [
  818. .headerSearchPath("../../../"),
  819. ],
  820. linkerSettings: [
  821. .linkedFramework("Security"),
  822. ]
  823. ),
  824. .target(
  825. name: "FirebaseMLModelDownloader",
  826. dependencies: [
  827. "FirebaseCore",
  828. "FirebaseInstallations",
  829. .product(name: "GULLogger", package: "GoogleUtilities"),
  830. "SwiftProtobuf",
  831. ],
  832. path: "FirebaseMLModelDownloader/Sources",
  833. exclude: [
  834. "proto/firebase_ml_log_sdk.proto",
  835. ],
  836. cSettings: [
  837. .define("FIRMLModelDownloader_VERSION", to: firebaseVersion),
  838. ]
  839. ),
  840. .testTarget(
  841. name: "FirebaseMLModelDownloaderUnit",
  842. dependencies: ["FirebaseMLModelDownloader"],
  843. path: "FirebaseMLModelDownloader/Tests/Unit"
  844. ),
  845. .target(
  846. name: "FirebaseMessaging",
  847. dependencies: [
  848. "FirebaseCore",
  849. "FirebaseInstallations",
  850. .product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
  851. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  852. .product(name: "GULReachability", package: "GoogleUtilities"),
  853. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  854. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  855. .product(name: "nanopb", package: "nanopb"),
  856. ],
  857. path: "FirebaseMessaging/Sources",
  858. publicHeadersPath: "Public",
  859. cSettings: [
  860. .headerSearchPath("../../"),
  861. .define("PB_FIELD_32BIT", to: "1"),
  862. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  863. .define("PB_ENABLE_MALLOC", to: "1"),
  864. ],
  865. linkerSettings: [
  866. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
  867. ]
  868. ),
  869. // Internal headers only for consuming from Swift.
  870. .target(
  871. name: "FirebaseMessagingInterop",
  872. path: "FirebaseMessaging/Interop",
  873. publicHeadersPath: ".",
  874. cSettings: [
  875. .headerSearchPath("../../"),
  876. ]
  877. ),
  878. .testTarget(
  879. name: "MessagingUnit",
  880. dependencies: ["FirebaseMessaging", "SharedTestUtilities", "OCMock"],
  881. path: "FirebaseMessaging/Tests/UnitTests",
  882. exclude: [
  883. "FIRMessagingContextManagerServiceTest.m", // TODO: Adapt its NSBundle usage to SPM.
  884. ],
  885. cSettings: [
  886. .headerSearchPath("../../.."),
  887. ]
  888. ),
  889. .target(
  890. name: "FirebasePerformanceTarget",
  891. dependencies: [.target(name: "FirebasePerformance",
  892. condition: .when(platforms: [.iOS, .tvOS]))],
  893. path: "SwiftPM-PlatformExclude/FirebasePerformanceWrap"
  894. ),
  895. .target(
  896. name: "FirebasePerformance",
  897. dependencies: [
  898. "FirebaseCore",
  899. "FirebaseInstallations",
  900. "FirebaseRemoteConfig",
  901. .product(name: "GoogleDataTransport", package: "GoogleDataTransport"),
  902. .product(name: "GULEnvironment", package: "GoogleUtilities"),
  903. .product(name: "GULISASwizzler", package: "GoogleUtilities"),
  904. .product(name: "GULMethodSwizzler", package: "GoogleUtilities"),
  905. .product(name: "GULUserDefaults", package: "GoogleUtilities"),
  906. .product(name: "nanopb", package: "nanopb"),
  907. ],
  908. path: "FirebasePerformance/Sources",
  909. publicHeadersPath: "Public",
  910. cSettings: [
  911. .headerSearchPath("../../"),
  912. .define("PB_FIELD_32BIT", to: "1"),
  913. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  914. .define("PB_ENABLE_MALLOC", to: "1"),
  915. .define("FIRPerformance_LIB_VERSION", to: firebaseVersion),
  916. ],
  917. linkerSettings: [
  918. .linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .tvOS])),
  919. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS, .tvOS])),
  920. .linkedFramework("QuartzCore", .when(platforms: [.iOS, .tvOS])),
  921. ]
  922. ),
  923. .testTarget(
  924. name: "PerformanceUnit",
  925. dependencies: [
  926. "FirebasePerformanceTarget",
  927. "OCMock",
  928. "SharedTestUtilities",
  929. "GCDWebServer",
  930. ],
  931. path: "FirebasePerformance/Tests/Unit",
  932. resources: [
  933. .process("FPRURLFilterTests-Info.plist"),
  934. .process("Server/smallDownloadFile"),
  935. .process("Server/bigDownloadFile"),
  936. ],
  937. cSettings: [
  938. .headerSearchPath("../../.."),
  939. .define("PB_FIELD_32BIT", to: "1"),
  940. .define("PB_NO_PACKED_STRUCTS", to: "1"),
  941. .define("PB_ENABLE_MALLOC", to: "1"),
  942. ]
  943. ),
  944. .target(
  945. name: "SharedTestUtilities",
  946. dependencies: ["FirebaseCore",
  947. "FirebaseAppCheckInterop",
  948. "FirebaseAuthInterop",
  949. "FirebaseMessagingInterop",
  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. cSettings: [
  1012. .headerSearchPath("../../"),
  1013. ]
  1014. ),
  1015. .target(
  1016. name: "RemoteConfigFakeConsoleObjC",
  1017. dependencies: ["OCMock"],
  1018. path: "FirebaseRemoteConfigSwift/Tests/ObjC",
  1019. publicHeadersPath: ".",
  1020. cSettings: [
  1021. .headerSearchPath("../../../"),
  1022. ]
  1023. ),
  1024. // MARK: - Firebase Storage
  1025. .target(
  1026. name: "FirebaseStorageInternal",
  1027. dependencies: [
  1028. "FirebaseCore",
  1029. .product(name: "GTMSessionFetcherCore", package: "GTMSessionFetcher"),
  1030. ],
  1031. path: "FirebaseStorageInternal/Sources",
  1032. publicHeadersPath: "Public",
  1033. cSettings: [
  1034. .headerSearchPath("../../"),
  1035. ],
  1036. linkerSettings: [
  1037. .linkedFramework("MobileCoreServices", .when(platforms: [.iOS])),
  1038. .linkedFramework("CoreServices", .when(platforms: [.macOS])),
  1039. ]
  1040. ),
  1041. .testTarget(
  1042. name: "StorageUnit",
  1043. dependencies: ["FirebaseStorageInternal", "OCMock", "SharedTestUtilities"],
  1044. path: "FirebaseStorageInternal/Tests/Unit",
  1045. cSettings: [
  1046. .headerSearchPath("../../.."),
  1047. ]
  1048. ),
  1049. .target(
  1050. name: "FirebaseStorage",
  1051. dependencies: [
  1052. "FirebaseAppCheckInterop",
  1053. "FirebaseAuthInterop",
  1054. "FirebaseCore",
  1055. "FirebaseCoreExtension",
  1056. "FirebaseStorageInternal",
  1057. ],
  1058. path: "FirebaseStorage/Sources"
  1059. ),
  1060. .testTarget(
  1061. name: "FirebaseStorageUnit",
  1062. dependencies: ["FirebaseStorage",
  1063. "SharedTestUtilities"],
  1064. path: "FirebaseStorage/Tests/Unit",
  1065. cSettings: [
  1066. .headerSearchPath("../../../"),
  1067. ]
  1068. ),
  1069. .testTarget(
  1070. name: "StorageObjcIntegration",
  1071. dependencies: ["FirebaseStorage"],
  1072. path: "FirebaseStorage/Tests/ObjcIntegration",
  1073. exclude: [
  1074. // See https://forums.swift.org/t/importing-swift-libraries-from-objective-c/56730
  1075. "ObjCPPAPITests.mm",
  1076. ],
  1077. cSettings: [
  1078. .headerSearchPath("../../.."),
  1079. ]
  1080. ),
  1081. .testTarget(
  1082. name: "swift-test",
  1083. dependencies: [
  1084. "Firebase",
  1085. "FirebaseAuth",
  1086. "FirebaseAppCheck",
  1087. "FirebaseABTesting",
  1088. "FirebaseAnalytics",
  1089. "FirebaseAnalyticsSwift",
  1090. .target(name: "FirebaseAppDistribution",
  1091. condition: .when(platforms: [.iOS])),
  1092. "FirebaseAuthCombineSwift",
  1093. "FirebaseFirestoreCombineSwift",
  1094. "FirebaseFunctionsCombineSwift",
  1095. "FirebaseStorageCombineSwift",
  1096. "FirebaseCrashlytics",
  1097. "FirebaseCore",
  1098. "FirebaseDatabase",
  1099. "FirebaseDynamicLinks",
  1100. "FirebaseFirestore",
  1101. "FirebaseFirestoreSwift",
  1102. "FirebaseFunctions",
  1103. "FirebaseInAppMessaging",
  1104. .target(name: "FirebaseInAppMessagingSwift",
  1105. condition: .when(platforms: [.iOS, .tvOS])),
  1106. "FirebaseInstallations",
  1107. "FirebaseMessaging",
  1108. .target(name: "FirebasePerformance",
  1109. condition: .when(platforms: [.iOS, .tvOS])),
  1110. "FirebaseRemoteConfig",
  1111. "FirebaseStorage",
  1112. "FirebaseStorageInternal",
  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. // Disable Keychain dependent tests as they require a host application on iOS.
  1201. "Integration",
  1202. "Unit/AppAttestProvider/Storage/FIRAppAttestArtifactStorageTests.m",
  1203. "Unit/Core/FIRAppCheckIntegrationTests.m",
  1204. "Unit/Core/FIRAppCheckStorageTests.m",
  1205. ],
  1206. resources: [
  1207. .process("Fixture"),
  1208. ],
  1209. cSettings: [
  1210. .headerSearchPath("../.."),
  1211. ]
  1212. ),
  1213. .testTarget(
  1214. name: "AppCheckUnitSwift",
  1215. dependencies: ["FirebaseAppCheck"],
  1216. path: "FirebaseAppCheck/Tests/Unit/Swift",
  1217. cSettings: [
  1218. .headerSearchPath("../.."),
  1219. ]
  1220. ),
  1221. // MARK: Testing support
  1222. .target(
  1223. name: "FirebaseFirestoreTestingSupport",
  1224. dependencies: ["FirebaseFirestore"],
  1225. path: "FirebaseTestingSupport/Firestore/Sources",
  1226. publicHeadersPath: "./",
  1227. cSettings: [
  1228. .headerSearchPath("../../.."),
  1229. .headerSearchPath("../../../Firestore/Source/Public/FirebaseFirestore"),
  1230. ]
  1231. ),
  1232. .testTarget(
  1233. name: "FirestoreTestingSupportTests",
  1234. dependencies: ["FirebaseFirestoreTestingSupport"],
  1235. path: "FirebaseTestingSupport/Firestore/Tests",
  1236. cSettings: [
  1237. .headerSearchPath("../../.."),
  1238. ]
  1239. ),
  1240. ],
  1241. cLanguageStandard: .c99,
  1242. cxxLanguageStandard: CXXLanguageStandard.gnucxx14
  1243. )
  1244. if ProcessInfo.processInfo.environment["FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT"] != nil {
  1245. if let GoogleAppMeasurementIndex = package.dependencies
  1246. .firstIndex(where: { $0.name == "GoogleAppMeasurement" }) {
  1247. package.dependencies[GoogleAppMeasurementIndex] = .package(
  1248. name: "GoogleAppMeasurement",
  1249. url: "https://github.com/google/GoogleAppMeasurement.git",
  1250. .branch("main")
  1251. )
  1252. }
  1253. }