Skip to content

Commit

Permalink
[Firestore] Add warning when building Firestore's binary SPM distro f…
Browse files Browse the repository at this point in the history
…or visionOS (#12279)

Co-authored-by: Andrew Heard <andrewheard@google.com>
  • Loading branch information
ncooke3 and andrewheard committed Jan 16, 2024
1 parent 6ff26d2 commit 756b5a4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Firestore/CHANGELOG.md
@@ -1,3 +1,8 @@
# Unreleased
- Add warning when trying to build Firestore's binary SPM distribution for
visionOS (#12279). See Firestore's 10.12.0 release note for a supported
workaround.

# 10.19.0
- [fixed] Made an optimization to the synchronization logic for resumed queries
to only re-download locally-cached documents that are known to be out-of-sync. (#12044)
Expand Down
20 changes: 16 additions & 4 deletions Package.swift
Expand Up @@ -1364,7 +1364,8 @@ func firestoreWrapperTarget() -> Target {
name: "FirebaseFirestoreTarget",
dependencies: [.target(name: "FirebaseFirestore",
condition: .when(platforms: [.iOS, .tvOS, .macOS, .macCatalyst]))],
path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap",
cSettings: [.define("FIREBASE_BINARY_FIRESTORE", to: "1")]
)
}

Expand Down Expand Up @@ -1494,8 +1495,16 @@ func firestoreTargets() -> [Target] {
name: "FirebaseFirestoreInternalWrapper",
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
),
.product(name: "abseil", package: "abseil-cpp-binary"),
.product(name: "gRPC-C++", package: "grpc-binary"),
.product(
name: "abseil",
package: "abseil-cpp-binary",
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
),
.product(
name: "gRPC-C++",
package: "grpc-binary",
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
),
.product(name: "nanopb", package: "nanopb"),
"FirebaseAppCheckInterop",
"FirebaseCore",
Expand All @@ -1512,7 +1521,10 @@ func firestoreTargets() -> [Target] {
),
.target(
name: "FirebaseFirestoreInternalWrapper",
dependencies: ["FirebaseFirestoreInternal"],
dependencies: [.target(
name: "FirebaseFirestoreInternal",
condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
)],
path: "FirebaseFirestoreInternal",
publicHeadersPath: "."
),
Expand Down
9 changes: 9 additions & 0 deletions SwiftPM-PlatformExclude/FirebaseFirestoreWrap/dummy.m
Expand Up @@ -16,3 +16,12 @@
#if TARGET_OS_WATCH
#warning "Firebase Firestore does not support watchOS"
#endif

#if (defined(TARGET_OS_VISION) && TARGET_OS_VISION) && FIREBASE_BINARY_FIRESTORE
#error "Firebase Firestore's binary SPM distribution does not support \
visionOS. To enable the source distribution, quit Xcode and open the desired \
project from the command line with the FIREBASE_SOURCE_FIRESTORE environment \
variable: `open --env FIREBASE_SOURCE_FIRESTORE /path/to/project.xcodeproj`. \
To go back to using the binary distribution of Firestore, quit Xcode and open \
Xcode like normal, without the environment variable."
#endif

0 comments on commit 756b5a4

Please sign in to comment.