Package.swift 39 KB

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