Package.swift 39 KB

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