Skip to content

Commit 1f34162

Browse files
committed
Fix binary build too
1 parent 357e877 commit 1f34162

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
@@ -1401,6 +1401,23 @@ func firestoreWrapperTarget() -> Target {
14011401
)
14021402
}
14031403

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+
14041421
func firebaseFirestoreObjCppTarget() -> Target {
14051422
if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil {
14061423
return .target(
@@ -1420,26 +1437,13 @@ func firebaseFirestoreObjCppTarget() -> Target {
14201437
)
14211438
} else {
14221439
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-
]
1440+
name: "FirebaseFirestoreObjCpp",
1441+
dependencies: [.target(
1442+
name: "FirebaseFirestoreInternal",
1443+
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
1444+
)],
1445+
path: "FirebaseFirestoreInternal",
1446+
publicHeadersPath: "."
14431447
)
14441448
}
14451449
}
@@ -1555,29 +1559,13 @@ func firestoreTargets() -> [Target] {
15551559
]
15561560
}
15571561

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-
1562+
let firestoreInternal = firestoreInternalTarget()
15751563
return [
15761564
.target(
15771565
name: "FirebaseFirestore",
15781566
dependencies: [
15791567
.target(
1580-
name: "FirebaseFirestoreInternalWrapper",
1568+
name: "FirebaseFirestoreObjCpp",
15811569
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
15821570
),
15831571
.product(
@@ -1600,6 +1588,10 @@ func firestoreTargets() -> [Target] {
16001588
],
16011589
path: "Firestore/Swift/Source",
16021590
resources: [.process("Resources/PrivacyInfo.xcprivacy")],
1591+
cSettings: [
1592+
.headerSearchPath("../../../"),
1593+
.headerSearchPath("../../Protos/nanopb"),
1594+
],
16031595
swiftSettings: [
16041596
.interoperabilityMode(.Cxx), // C++ interoperability setting
16051597
],
@@ -1610,15 +1602,28 @@ func firestoreTargets() -> [Target] {
16101602
]
16111603
),
16121604
.target(
1613-
name: "FirebaseFirestoreInternalWrapper",
1614-
dependencies: [.target(
1615-
name: "FirebaseFirestoreInternal",
1616-
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
1617-
)],
1618-
path: "FirebaseFirestoreInternal",
1619-
publicHeadersPath: "."
1605+
name: "FirebaseFirestoreCpp",
1606+
dependencies: [
1607+
"FirebaseAppCheckInterop",
1608+
"FirebaseCore",
1609+
"leveldb",
1610+
"FirebaseFirestoreInternal",
1611+
.product(name: "nanopb", package: "nanopb"),
1612+
.product(
1613+
name: "gRPC-C++",
1614+
package: "grpc-binary",
1615+
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
1616+
),
1617+
],
1618+
path: "Firestore/core/src/api",
1619+
publicHeadersPath: ".", // Path to the public headers
1620+
cxxSettings: [
1621+
.headerSearchPath("../../../.."),
1622+
.headerSearchPath("../../../Protos/nanopb"),
1623+
.headerSearchPath("."), // Ensure the header search path is correct
1624+
]
16201625
),
1621-
firestoreInternalTarget,
1626+
firestoreInternal,
16221627
firebaseFirestoreObjCppTarget(),
16231628
]
16241629
}

0 commit comments

Comments
 (0)