Skip to content

Commit 9d986c8

Browse files
authored
[Firestore] Change Firestore's release distro from source to binary for SPM (#11066)
* Point package dependency on Abseil to new binary repo * Point package dependency on gRPC to new binary repo * Define Firestore as a binary target * Add 'Unreleased' changelog entry * Checkpoint: everything wired up * Point to G hosted URL * Touch all CI * Style * Revert "Touch all CI" This reverts commit 44eed92. * [will revert] touch Firestore CI * Fix swift-test target * Fix FirestoreTestingSupportTests * Favor FirebaseFirestoreTarget over FirebaseFirestore * Favor FirebaseFirestoreTarget over FirebaseFirestore (2) * Revert "[will revert] touch Firestore CI" This reverts commit e0449ff. * Update gRPC version * Update changelog entry version * Point to latest Firestore RC
1 parent 98e218b commit 9d986c8

File tree

3 files changed

+27
-94
lines changed

3 files changed

+27
-94
lines changed

FirebaseTestingSupport/Firestore/Sources/FIRQueryFake.mm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
#import "FirebaseTestingSupport/Firestore/Sources/Public/FirebaseFirestoreTestingSupport/FIRQueryFake.h"
1616

17-
#import "Firestore/Source/API/FIRQuery+Internal.h"
18-
1917
@implementation FIRQueryFake
2018

2119
- (instancetype)init {

Firestore/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 10.8.0
2+
- [feature] Change Firestore's Swift Package Manager distribution from source
3+
to binary to reduce the time it takes to add the Firebase package and to
4+
build the Firestore SDK (#6564).
5+
16
# 10.7.0
27
- [feature] Add support for disjunctions in queries (`OR` queries).
38
- [fixed] Fixed stack overflow caused by deeply nested server timestamps.

Package.swift

Lines changed: 22 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ let package = Package(
161161
"2.30909.0" ..< "2.30910.0"
162162
),
163163
.package(
164-
url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
165-
"0.20220203.1" ..< "0.20220204.0"
164+
url: "https://github.com/google/abseil-cpp-binary.git",
165+
"1.2021110200.0" ..< "1.2021110300.0"
166166
),
167167
.package(
168-
url: "https://github.com/grpc/grpc-ios.git",
169-
"1.44.0-grpc" ..< "1.45.0-grpc"
168+
url: "https://github.com/google/grpc-binary.git",
169+
"1.44.0" ..< "1.45.0"
170170
),
171171
.package(
172172
url: "https://github.com/erikdoe/ocmock.git",
@@ -469,7 +469,7 @@ let package = Package(
469469
.target(
470470
name: "FirebaseFirestoreCombineSwift",
471471
dependencies: [
472-
"FirebaseFirestore",
472+
"FirebaseFirestoreTarget",
473473
"FirebaseFirestoreSwift",
474474
],
475475
path: "FirebaseCombineSwift/Sources/Firestore"
@@ -637,73 +637,24 @@ let package = Package(
637637

638638
.target(
639639
name: "FirebaseFirestoreTarget",
640-
dependencies: [.target(name: "FirebaseFirestore",
641-
condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
642-
path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
643-
),
644-
645-
.target(
646-
name: "FirebaseFirestore",
647640
dependencies: [
641+
.target(
642+
name: "FirebaseFirestore",
643+
condition: .when(platforms: [.iOS, .tvOS, .macOS])
644+
),
645+
.product(name: "abseil", package: "abseil-cpp-binary"),
646+
.product(name: "gRPC-C++", package: "grpc-binary"),
647+
.product(name: "nanopb", package: "nanopb"),
648648
"FirebaseCore",
649649
"leveldb",
650-
.product(name: "nanopb", package: "nanopb"),
651-
.product(name: "abseil", package: "abseil-cpp-SwiftPM"),
652-
.product(name: "gRPC-cpp", package: "grpc-ios"),
653650
],
654-
path: "Firestore",
655-
exclude: [
656-
"CHANGELOG.md",
657-
"CMakeLists.txt",
658-
"Example/",
659-
"LICENSE",
660-
"Protos/CMakeLists.txt",
661-
"Protos/Podfile",
662-
"Protos/README.md",
663-
"Protos/build_protos.py",
664-
"Protos/cpp/",
665-
"Protos/lib/",
666-
"Protos/nanopb_cpp_generator.py",
667-
"Protos/protos/",
668-
"README.md",
669-
"Source/CMakeLists.txt",
670-
"Swift/",
671-
"core/CMakeLists.txt",
672-
"core/src/util/config_detected.h.in",
673-
"core/test/",
674-
"fuzzing/",
675-
"test.sh",
676-
// Swift PM doesn't recognize hpp files, so we're relying on search paths
677-
// to find third_party/nlohmann_json/json.hpp.
678-
"third_party/",
651+
path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
652+
),
679653

680-
// Exclude alternate implementations for other platforms
681-
"core/src/remote/connectivity_monitor_noop.cc",
682-
"core/src/util/filesystem_win.cc",
683-
"core/src/util/log_stdio.cc",
684-
"core/src/util/secure_random_openssl.cc",
685-
],
686-
sources: [
687-
"Source/",
688-
"Protos/nanopb/",
689-
"core/include/",
690-
"core/src",
691-
],
692-
publicHeadersPath: "Source/Public",
693-
cSettings: [
694-
.headerSearchPath("../"),
695-
.headerSearchPath("Source/Public/FirebaseFirestore"),
696-
.headerSearchPath("Protos/nanopb"),
697-
.define("PB_FIELD_32BIT", to: "1"),
698-
.define("PB_NO_PACKED_STRUCTS", to: "1"),
699-
.define("PB_ENABLE_MALLOC", to: "1"),
700-
.define("FIRFirestore_VERSION", to: firebaseVersion),
701-
],
702-
linkerSettings: [
703-
.linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
704-
.linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
705-
.linkedLibrary("c++"),
706-
]
654+
.binaryTarget(
655+
name: "FirebaseFirestore",
656+
url: "https://dl.google.com/firebase/ios/bin/firestore/10.8.0/FirebaseFirestore.zip",
657+
checksum: "56ea3c98343cc31e3579faf5292ec73223c86e6502848ad2bf4870f6cbc63104"
707658
),
708659

709660
.target(
@@ -718,7 +669,7 @@ let package = Package(
718669
dependencies: [
719670
"FirebaseCore",
720671
"FirebaseCoreExtension",
721-
"FirebaseFirestore",
672+
"FirebaseFirestoreTarget",
722673
"FirebaseSharedSwift",
723674
],
724675
path: "Firestore",
@@ -1207,7 +1158,7 @@ let package = Package(
12071158
"FirebaseCore",
12081159
"FirebaseDatabase",
12091160
"FirebaseDynamicLinks",
1210-
"FirebaseFirestore",
1161+
"FirebaseFirestoreTarget",
12111162
"FirebaseFirestoreSwift",
12121163
"FirebaseFunctions",
12131164
"FirebaseInAppMessaging",
@@ -1246,7 +1197,7 @@ let package = Package(
12461197
"FirebaseCore",
12471198
"FirebaseDatabase",
12481199
"FirebaseDynamicLinks",
1249-
"FirebaseFirestore",
1200+
"FirebaseFirestoreTarget",
12501201
"FirebaseFunctions",
12511202
"FirebaseInAppMessaging",
12521203
"FirebaseInstallations",
@@ -1333,7 +1284,7 @@ let package = Package(
13331284

13341285
.target(
13351286
name: "FirebaseFirestoreTestingSupport",
1336-
dependencies: ["FirebaseFirestore"],
1287+
dependencies: ["FirebaseFirestoreTarget"],
13371288
path: "FirebaseTestingSupport/Firestore/Sources",
13381289
publicHeadersPath: "./",
13391290
cSettings: [
@@ -1365,27 +1316,6 @@ if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] !=
13651316
path: "FirebaseFirestore.xcframework"
13661317
)
13671318
}
1368-
1369-
// TODO(ncooke3): Below re-defining is not needed when original
1370-
// FirebaseFirestoreTarget definition matches below definition.
1371-
if let firestoreTargetIndex = package.targets
1372-
.firstIndex(where: { $0.name == "FirebaseFirestoreTarget" }) {
1373-
package.targets[firestoreTargetIndex] = .target(
1374-
name: "FirebaseFirestoreTarget",
1375-
dependencies: [
1376-
.target(
1377-
name: "FirebaseFirestore",
1378-
condition: .when(platforms: [.iOS, .tvOS, .macOS])
1379-
),
1380-
.product(name: "abseil", package: "abseil-cpp-SwiftPM"),
1381-
.product(name: "gRPC-cpp", package: "grpc-ios"),
1382-
.product(name: "nanopb", package: "nanopb"),
1383-
"FirebaseCore",
1384-
"leveldb",
1385-
],
1386-
path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
1387-
)
1388-
}
13891319
}
13901320

13911321
// MARK: - Helper Functions

0 commit comments

Comments
 (0)