Skip to content

Commit

Permalink
[Firestore] Change Firestore's release distro from source to binary f…
Browse files Browse the repository at this point in the history
…or 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
  • Loading branch information
ncooke3 authored Apr 5, 2023
1 parent 98e218b commit 9d986c8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 94 deletions.
2 changes: 0 additions & 2 deletions FirebaseTestingSupport/Firestore/Sources/FIRQueryFake.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

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

#import "Firestore/Source/API/FIRQuery+Internal.h"

@implementation FIRQueryFake

- (instancetype)init {
Expand Down
5 changes: 5 additions & 0 deletions Firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 10.8.0
- [feature] Change Firestore's Swift Package Manager distribution from source
to binary to reduce the time it takes to add the Firebase package and to
build the Firestore SDK (#6564).

# 10.7.0
- [feature] Add support for disjunctions in queries (`OR` queries).
- [fixed] Fixed stack overflow caused by deeply nested server timestamps.
Expand Down
114 changes: 22 additions & 92 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ let package = Package(
"2.30909.0" ..< "2.30910.0"
),
.package(
url: "https://github.com/firebase/abseil-cpp-SwiftPM.git",
"0.20220203.1" ..< "0.20220204.0"
url: "https://github.com/google/abseil-cpp-binary.git",
"1.2021110200.0" ..< "1.2021110300.0"
),
.package(
url: "https://github.com/grpc/grpc-ios.git",
"1.44.0-grpc" ..< "1.45.0-grpc"
url: "https://github.com/google/grpc-binary.git",
"1.44.0" ..< "1.45.0"
),
.package(
url: "https://github.com/erikdoe/ocmock.git",
Expand Down Expand Up @@ -469,7 +469,7 @@ let package = Package(
.target(
name: "FirebaseFirestoreCombineSwift",
dependencies: [
"FirebaseFirestore",
"FirebaseFirestoreTarget",
"FirebaseFirestoreSwift",
],
path: "FirebaseCombineSwift/Sources/Firestore"
Expand Down Expand Up @@ -637,73 +637,24 @@ let package = Package(

.target(
name: "FirebaseFirestoreTarget",
dependencies: [.target(name: "FirebaseFirestore",
condition: .when(platforms: [.iOS, .tvOS, .macOS]))],
path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
),

.target(
name: "FirebaseFirestore",
dependencies: [
.target(
name: "FirebaseFirestore",
condition: .when(platforms: [.iOS, .tvOS, .macOS])
),
.product(name: "abseil", package: "abseil-cpp-binary"),
.product(name: "gRPC-C++", package: "grpc-binary"),
.product(name: "nanopb", package: "nanopb"),
"FirebaseCore",
"leveldb",
.product(name: "nanopb", package: "nanopb"),
.product(name: "abseil", package: "abseil-cpp-SwiftPM"),
.product(name: "gRPC-cpp", package: "grpc-ios"),
],
path: "Firestore",
exclude: [
"CHANGELOG.md",
"CMakeLists.txt",
"Example/",
"LICENSE",
"Protos/CMakeLists.txt",
"Protos/Podfile",
"Protos/README.md",
"Protos/build_protos.py",
"Protos/cpp/",
"Protos/lib/",
"Protos/nanopb_cpp_generator.py",
"Protos/protos/",
"README.md",
"Source/CMakeLists.txt",
"Swift/",
"core/CMakeLists.txt",
"core/src/util/config_detected.h.in",
"core/test/",
"fuzzing/",
"test.sh",
// Swift PM doesn't recognize hpp files, so we're relying on search paths
// to find third_party/nlohmann_json/json.hpp.
"third_party/",
path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
),

// Exclude alternate implementations for other platforms
"core/src/remote/connectivity_monitor_noop.cc",
"core/src/util/filesystem_win.cc",
"core/src/util/log_stdio.cc",
"core/src/util/secure_random_openssl.cc",
],
sources: [
"Source/",
"Protos/nanopb/",
"core/include/",
"core/src",
],
publicHeadersPath: "Source/Public",
cSettings: [
.headerSearchPath("../"),
.headerSearchPath("Source/Public/FirebaseFirestore"),
.headerSearchPath("Protos/nanopb"),
.define("PB_FIELD_32BIT", to: "1"),
.define("PB_NO_PACKED_STRUCTS", to: "1"),
.define("PB_ENABLE_MALLOC", to: "1"),
.define("FIRFirestore_VERSION", to: firebaseVersion),
],
linkerSettings: [
.linkedFramework("SystemConfiguration", .when(platforms: [.iOS, .macOS, .tvOS])),
.linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
.linkedLibrary("c++"),
]
.binaryTarget(
name: "FirebaseFirestore",
url: "https://dl.google.com/firebase/ios/bin/firestore/10.8.0/FirebaseFirestore.zip",
checksum: "56ea3c98343cc31e3579faf5292ec73223c86e6502848ad2bf4870f6cbc63104"
),

.target(
Expand All @@ -718,7 +669,7 @@ let package = Package(
dependencies: [
"FirebaseCore",
"FirebaseCoreExtension",
"FirebaseFirestore",
"FirebaseFirestoreTarget",
"FirebaseSharedSwift",
],
path: "Firestore",
Expand Down Expand Up @@ -1207,7 +1158,7 @@ let package = Package(
"FirebaseCore",
"FirebaseDatabase",
"FirebaseDynamicLinks",
"FirebaseFirestore",
"FirebaseFirestoreTarget",
"FirebaseFirestoreSwift",
"FirebaseFunctions",
"FirebaseInAppMessaging",
Expand Down Expand Up @@ -1246,7 +1197,7 @@ let package = Package(
"FirebaseCore",
"FirebaseDatabase",
"FirebaseDynamicLinks",
"FirebaseFirestore",
"FirebaseFirestoreTarget",
"FirebaseFunctions",
"FirebaseInAppMessaging",
"FirebaseInstallations",
Expand Down Expand Up @@ -1333,7 +1284,7 @@ let package = Package(

.target(
name: "FirebaseFirestoreTestingSupport",
dependencies: ["FirebaseFirestore"],
dependencies: ["FirebaseFirestoreTarget"],
path: "FirebaseTestingSupport/Firestore/Sources",
publicHeadersPath: "./",
cSettings: [
Expand Down Expand Up @@ -1365,27 +1316,6 @@ if ProcessInfo.processInfo.environment["FIREBASECI_USE_LOCAL_FIRESTORE_ZIP"] !=
path: "FirebaseFirestore.xcframework"
)
}

// TODO(ncooke3): Below re-defining is not needed when original
// FirebaseFirestoreTarget definition matches below definition.
if let firestoreTargetIndex = package.targets
.firstIndex(where: { $0.name == "FirebaseFirestoreTarget" }) {
package.targets[firestoreTargetIndex] = .target(
name: "FirebaseFirestoreTarget",
dependencies: [
.target(
name: "FirebaseFirestore",
condition: .when(platforms: [.iOS, .tvOS, .macOS])
),
.product(name: "abseil", package: "abseil-cpp-SwiftPM"),
.product(name: "gRPC-cpp", package: "grpc-ios"),
.product(name: "nanopb", package: "nanopb"),
"FirebaseCore",
"leveldb",
],
path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
)
}
}

// MARK: - Helper Functions
Expand Down

0 comments on commit 9d986c8

Please sign in to comment.