Skip to content

Commit 622a01f

Browse files
committed
Fix binary build too
1 parent 317ccfb commit 622a01f

File tree

2 files changed

+52
-48
lines changed

2 files changed

+52
-48
lines changed

FirebaseFirestoreInternal.podspec

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
3030
# framework.
3131
s.public_header_files = [
3232
'Firestore/Source/Public/FirebaseFirestore/*.h',
33-
'Firestore/core/interfaceForSwift/api/*.h'
33+
'Firestore/core/src/api/*.h'
3434
]
3535

3636
# source_files contains most of the header and source files for the project.
@@ -55,7 +55,6 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
5555
'Firestore/core/include/**/*.{cc,mm}',
5656
'Firestore/core/src/**/*.{cc,mm}',
5757
'FirebaseAuth/Interop/**/*.h',
58-
'Firestore/core/interfaceForSwift/**/*.{cc,h}',
5958
]
6059

6160
# Internal headers that aren't necessarily globally unique. Most C++ internal

Package.swift

+51-46
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,23 @@ func firestoreWrapperTarget() -> Target {
13981398
)
13991399
}
14001400

1401+
func firestoreInternalTarget() -> Target {
1402+
if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil {
1403+
// This is set when running `scripts/check_firestore_symbols.sh`.
1404+
return .binaryTarget(
1405+
name: "FirebaseFirestoreInternal",
1406+
// The `xcframework` should be moved to the root of the repo.
1407+
path: "FirebaseFirestoreInternal.xcframework"
1408+
)
1409+
} else {
1410+
return .binaryTarget(
1411+
name: "FirebaseFirestoreInternal",
1412+
url: "https://dl.google.com/firebase/ios/bin/firestore/11.6.0/rc0/FirebaseFirestoreInternal.zip",
1413+
checksum: "ad9d6cf31120ba0a91dbb9ccbe7ad08276a88565f6c79216929ec93a7d436459"
1414+
)
1415+
}
1416+
}
1417+
14011418
func firebaseFirestoreObjCppTarget() -> Target {
14021419
if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
14031420
return .target(
@@ -1417,26 +1434,13 @@ func firebaseFirestoreObjCppTarget() -> Target {
14171434
)
14181435
} else {
14191436
return .target(
1420-
name: "FirebaseFirestoreCpp",
1421-
dependencies: [
1422-
"FirebaseAppCheckInterop",
1423-
"FirebaseCore",
1424-
"leveldb",
1425-
"FirebaseFirestoreInternalWrapper",
1426-
.product(name: "nanopb", package: "nanopb"),
1427-
.product(
1428-
name: "gRPC-C++",
1429-
package: "grpc-binary",
1430-
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
1431-
),
1432-
],
1433-
path: "Firestore/core/interfaceForSwift",
1434-
publicHeadersPath: "api", // Path to the public headers
1435-
cxxSettings: [
1436-
.headerSearchPath("../../../"),
1437-
.headerSearchPath("../../Protos/nanopb"),
1438-
.headerSearchPath("api"), // Ensure the header search path is correct
1439-
]
1437+
name: "FirebaseFirestoreObjCpp",
1438+
dependencies: [.target(
1439+
name: "FirebaseFirestoreInternal",
1440+
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
1441+
)],
1442+
path: "FirebaseFirestoreInternal",
1443+
publicHeadersPath: "."
14401444
)
14411445
}
14421446
}
@@ -1552,29 +1556,13 @@ func firestoreTargets() -> [Target] {
15521556
]
15531557
}
15541558

1555-
let firestoreInternalTarget: Target = {
1556-
if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] != nil {
1557-
// This is set when running `scripts/check_firestore_symbols.sh`.
1558-
return .binaryTarget(
1559-
name: "FirebaseFirestoreInternal",
1560-
// The `xcframework` should be moved to the root of the repo.
1561-
path: "FirebaseFirestoreInternal.xcframework"
1562-
)
1563-
} else {
1564-
return .binaryTarget(
1565-
name: "FirebaseFirestoreInternal",
1566-
url: "https://dl.google.com/firebase/ios/bin/firestore/11.7.0/rc0/FirebaseFirestoreInternal.zip",
1567-
checksum: "08dd8be97322a1c35bdde315376921d145b5c9dd9bb91bbdbb933380556f24f9"
1568-
)
1569-
}
1570-
}()
1571-
1559+
let firestoreInternal = firestoreInternalTarget()
15721560
return [
15731561
.target(
15741562
name: "FirebaseFirestore",
15751563
dependencies: [
15761564
.target(
1577-
name: "FirebaseFirestoreInternalWrapper",
1565+
name: "FirebaseFirestoreObjCpp",
15781566
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
15791567
),
15801568
.product(
@@ -1597,6 +1585,10 @@ func firestoreTargets() -> [Target] {
15971585
],
15981586
path: "Firestore/Swift/Source",
15991587
resources: [.process("Resources/PrivacyInfo.xcprivacy")],
1588+
cSettings: [
1589+
.headerSearchPath("../../../"),
1590+
.headerSearchPath("../../Protos/nanopb"),
1591+
],
16001592
swiftSettings: [
16011593
.interoperabilityMode(.Cxx), // C++ interoperability setting
16021594
],
@@ -1607,15 +1599,28 @@ func firestoreTargets() -> [Target] {
16071599
]
16081600
),
16091601
.target(
1610-
name: "FirebaseFirestoreInternalWrapper",
1611-
dependencies: [.target(
1612-
name: "FirebaseFirestoreInternal",
1613-
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
1614-
)],
1615-
path: "FirebaseFirestoreInternal",
1616-
publicHeadersPath: "."
1602+
name: "FirebaseFirestoreCpp",
1603+
dependencies: [
1604+
"FirebaseAppCheckInterop",
1605+
"FirebaseCore",
1606+
"leveldb",
1607+
"FirebaseFirestoreInternal",
1608+
.product(name: "nanopb", package: "nanopb"),
1609+
.product(
1610+
name: "gRPC-C++",
1611+
package: "grpc-binary",
1612+
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
1613+
),
1614+
],
1615+
path: "Firestore/core/src/api",
1616+
publicHeadersPath: ".", // Path to the public headers
1617+
cxxSettings: [
1618+
.headerSearchPath("../../../.."),
1619+
.headerSearchPath("../../../Protos/nanopb"),
1620+
.headerSearchPath("."), // Ensure the header search path is correct
1621+
]
16171622
),
1618-
firestoreInternalTarget,
1623+
firestoreInternal,
16191624
firebaseFirestoreObjCppTarget(),
16201625
]
16211626
}

0 commit comments

Comments
 (0)