@@ -1401,6 +1401,25 @@ func firestoreWrapperTarget() -> Target {
1401
1401
)
1402
1402
}
1403
1403
1404
+ func firestoreInternalTarget( ) -> Target {
1405
+ if ProcessInfo . processInfo. environment [ " FIREBASECI_USE_LOCAL_FIRESTORE_ZIP " ] != nil {
1406
+ // This is set when running `scripts/check_firestore_symbols.sh`.
1407
+ return . binaryTarget(
1408
+ name: " FirebaseFirestoreInternal " ,
1409
+ // The `xcframework` should be moved to the root of the repo.
1410
+ path: " FirebaseFirestoreInternal.xcframework "
1411
+ )
1412
+ } else {
1413
+ return . binaryTarget(
1414
+ name: " FirebaseFirestoreInternal " ,
1415
+ url: " https://dl.google.com/firebase/ios/bin/firestore/11.6.0/rc0/FirebaseFirestoreInternal.zip " ,
1416
+ checksum: " ad9d6cf31120ba0a91dbb9ccbe7ad08276a88565f6c79216929ec93a7d436459 "
1417
+ )
1418
+ }
1419
+ }
1420
+
1421
+ // Returns a target of Objective CPP API wrapping around Firestore's core C++ target. Most of the
1422
+ // public APIs of Firestore come from this target.
1404
1423
func firebaseFirestoreObjCppTarget( ) -> Target {
1405
1424
if ProcessInfo . processInfo. environment [ " FIREBASE_SOURCE_FIRESTORE " ] != nil {
1406
1425
return . target(
@@ -1420,26 +1439,13 @@ func firebaseFirestoreObjCppTarget() -> Target {
1420
1439
)
1421
1440
} else {
1422
1441
return . target(
1423
- name: " FirebaseFirestoreCpp " ,
1424
- dependencies: [
1425
- " FirebaseAppCheckInterop " ,
1426
- " FirebaseCore " ,
1427
- " leveldb " ,
1428
- " FirebaseFirestoreInternalWrapper " ,
1429
- . product( name: " nanopb " , package : " nanopb " ) ,
1430
- . product(
1431
- name: " gRPC-C++ " ,
1432
- package : " grpc-binary " ,
1433
- condition: . when( platforms: [ . iOS, . macCatalyst, . tvOS, . macOS] )
1434
- ) ,
1435
- ] ,
1436
- path: " Firestore/core/interfaceForSwift " ,
1437
- publicHeadersPath: " api " , // Path to the public headers
1438
- cxxSettings: [
1439
- . headerSearchPath( " ../../../ " ) ,
1440
- . headerSearchPath( " ../../Protos/nanopb " ) ,
1441
- . headerSearchPath( " api " ) , // Ensure the header search path is correct
1442
- ]
1442
+ name: " FirebaseFirestoreObjCpp " ,
1443
+ dependencies: [ . target(
1444
+ name: " FirebaseFirestoreInternal " ,
1445
+ condition: . when( platforms: [ . iOS, . macCatalyst, . tvOS, . macOS] )
1446
+ ) ] ,
1447
+ path: " FirebaseFirestoreInternal " ,
1448
+ publicHeadersPath: " . "
1443
1449
)
1444
1450
}
1445
1451
}
@@ -1448,6 +1454,8 @@ func firestoreTargets() -> [Target] {
1448
1454
if ProcessInfo . processInfo. environment [ " FIREBASE_SOURCE_FIRESTORE " ] != nil {
1449
1455
return [
1450
1456
. target(
1457
+ // The C++ core implementation of the Firestore SDK, this target is where the actual
1458
+ // logic of the SDK lives in.
1451
1459
name: " FirebaseFirestoreCpp " ,
1452
1460
dependencies: [
1453
1461
" FirebaseAppCheckInterop " ,
@@ -1515,6 +1523,7 @@ func firestoreTargets() -> [Target] {
1515
1523
]
1516
1524
) ,
1517
1525
firebaseFirestoreObjCppTarget ( ) ,
1526
+ // Public swift APIs wrapped around core C++ and ObjCpp APIs.
1518
1527
. target(
1519
1528
name: " FirebaseFirestore " ,
1520
1529
dependencies: [
@@ -1555,29 +1564,15 @@ func firestoreTargets() -> [Target] {
1555
1564
]
1556
1565
}
1557
1566
1558
- let firestoreInternalTarget : Target = {
1559
- if ProcessInfo . processInfo. environment [ " FIREBASECI_USE_LOCAL_FIRESTORE_ZIP " ] != nil {
1560
- // This is set when running `scripts/check_firestore_symbols.sh`.
1561
- return . binaryTarget(
1562
- name: " FirebaseFirestoreInternal " ,
1563
- // The `xcframework` should be moved to the root of the repo.
1564
- path: " FirebaseFirestoreInternal.xcframework "
1565
- )
1566
- } else {
1567
- return . binaryTarget(
1568
- name: " FirebaseFirestoreInternal " ,
1569
- url: " https://dl.google.com/firebase/ios/bin/firestore/11.8.0/rc0/FirebaseFirestoreInternal.zip " ,
1570
- checksum: " 860882689232f3192a816cea3db8b6c4cbad2896188dec90f35bbdfd2536169c "
1571
- )
1572
- }
1573
- } ( )
1574
-
1567
+ // Binary firestore builds coming from cocoapods builds
1568
+ let firestoreInternal = firestoreInternalTarget ( )
1575
1569
return [
1576
1570
. target(
1571
+ // Public swift APIs wrapped around core C++ and ObjCpp APIs.
1577
1572
name: " FirebaseFirestore " ,
1578
1573
dependencies: [
1579
1574
. target(
1580
- name: " FirebaseFirestoreInternalWrapper " ,
1575
+ name: " FirebaseFirestoreObjCpp " ,
1581
1576
condition: . when( platforms: [ . iOS, . macCatalyst, . tvOS, . macOS] )
1582
1577
) ,
1583
1578
. product(
@@ -1600,6 +1595,10 @@ func firestoreTargets() -> [Target] {
1600
1595
] ,
1601
1596
path: " Firestore/Swift/Source " ,
1602
1597
resources: [ . process( " Resources/PrivacyInfo.xcprivacy " ) ] ,
1598
+ cSettings: [
1599
+ . headerSearchPath( " ../../../ " ) ,
1600
+ . headerSearchPath( " ../../Protos/nanopb " ) ,
1601
+ ] ,
1603
1602
swiftSettings: [
1604
1603
. interoperabilityMode( . Cxx) , // C++ interoperability setting
1605
1604
] ,
@@ -1610,15 +1609,30 @@ func firestoreTargets() -> [Target] {
1610
1609
]
1611
1610
) ,
1612
1611
. target(
1613
- name: " FirebaseFirestoreInternalWrapper " ,
1614
- dependencies: [ . target(
1615
- name: " FirebaseFirestoreInternal " ,
1616
- condition: . when( platforms: [ . iOS, . macCatalyst, . tvOS, . macOS] )
1617
- ) ] ,
1618
- path: " FirebaseFirestoreInternal " ,
1619
- publicHeadersPath: " . "
1612
+ // For binary builds, this target exposes the core C++ APIs such that FirebaseFirestore(swift)
1613
+ // can use the C++ apis directly without ObjCpp in between.
1614
+ name: " FirebaseFirestoreCpp " ,
1615
+ dependencies: [
1616
+ " FirebaseAppCheckInterop " ,
1617
+ " FirebaseCore " ,
1618
+ " leveldb " ,
1619
+ " FirebaseFirestoreInternal " ,
1620
+ . product( name: " nanopb " , package : " nanopb " ) ,
1621
+ . product(
1622
+ name: " gRPC-C++ " ,
1623
+ package : " grpc-binary " ,
1624
+ condition: . when( platforms: [ . iOS, . macCatalyst, . tvOS, . macOS] )
1625
+ ) ,
1626
+ ] ,
1627
+ path: " Firestore/core/src/api " ,
1628
+ publicHeadersPath: " . " , // Path to the public headers
1629
+ cxxSettings: [
1630
+ . headerSearchPath( " ../../../.. " ) ,
1631
+ . headerSearchPath( " ../../../Protos/nanopb " ) ,
1632
+ . headerSearchPath( " . " ) , // Ensure the header search path is correct
1633
+ ]
1620
1634
) ,
1621
- firestoreInternalTarget ,
1635
+ firestoreInternal ,
1622
1636
firebaseFirestoreObjCppTarget ( ) ,
1623
1637
]
1624
1638
}
0 commit comments