Skip to content

Commit 756b5a4

Browse files
ncooke3andrewheard
andauthored
[Firestore] Add warning when building Firestore's binary SPM distro for visionOS (#12279)
Co-authored-by: Andrew Heard <[email protected]>
1 parent 6ff26d2 commit 756b5a4

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

Firestore/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Unreleased
2+
- Add warning when trying to build Firestore's binary SPM distribution for
3+
visionOS (#12279). See Firestore's 10.12.0 release note for a supported
4+
workaround.
5+
16
# 10.19.0
27
- [fixed] Made an optimization to the synchronization logic for resumed queries
38
to only re-download locally-cached documents that are known to be out-of-sync. (#12044)

Package.swift

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,8 @@ func firestoreWrapperTarget() -> Target {
13641364
name: "FirebaseFirestoreTarget",
13651365
dependencies: [.target(name: "FirebaseFirestore",
13661366
condition: .when(platforms: [.iOS, .tvOS, .macOS, .macCatalyst]))],
1367-
path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
1367+
path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap",
1368+
cSettings: [.define("FIREBASE_BINARY_FIRESTORE", to: "1")]
13681369
)
13691370
}
13701371

@@ -1494,8 +1495,16 @@ func firestoreTargets() -> [Target] {
14941495
name: "FirebaseFirestoreInternalWrapper",
14951496
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
14961497
),
1497-
.product(name: "abseil", package: "abseil-cpp-binary"),
1498-
.product(name: "gRPC-C++", package: "grpc-binary"),
1498+
.product(
1499+
name: "abseil",
1500+
package: "abseil-cpp-binary",
1501+
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
1502+
),
1503+
.product(
1504+
name: "gRPC-C++",
1505+
package: "grpc-binary",
1506+
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
1507+
),
14991508
.product(name: "nanopb", package: "nanopb"),
15001509
"FirebaseAppCheckInterop",
15011510
"FirebaseCore",
@@ -1512,7 +1521,10 @@ func firestoreTargets() -> [Target] {
15121521
),
15131522
.target(
15141523
name: "FirebaseFirestoreInternalWrapper",
1515-
dependencies: ["FirebaseFirestoreInternal"],
1524+
dependencies: [.target(
1525+
name: "FirebaseFirestoreInternal",
1526+
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
1527+
)],
15161528
path: "FirebaseFirestoreInternal",
15171529
publicHeadersPath: "."
15181530
),

SwiftPM-PlatformExclude/FirebaseFirestoreWrap/dummy.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@
1616
#if TARGET_OS_WATCH
1717
#warning "Firebase Firestore does not support watchOS"
1818
#endif
19+
20+
#if (defined(TARGET_OS_VISION) && TARGET_OS_VISION) && FIREBASE_BINARY_FIRESTORE
21+
#error "Firebase Firestore's binary SPM distribution does not support \
22+
visionOS. To enable the source distribution, quit Xcode and open the desired \
23+
project from the command line with the FIREBASE_SOURCE_FIRESTORE environment \
24+
variable: `open --env FIREBASE_SOURCE_FIRESTORE /path/to/project.xcodeproj`. \
25+
To go back to using the binary distribution of Firestore, quit Xcode and open \
26+
Xcode like normal, without the environment variable."
27+
#endif

0 commit comments

Comments
 (0)