-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Code reorg to move all public headers under src/api #14371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: cheryllin/firestoreSwiftCpp
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,14 +14,15 @@ | |
* limitations under the License. | ||
*/ | ||
|
||
#ifndef FIRESTORE_CORE_INTERFACEFORSWIFT_API_FIREBASEFIRESTORECPP_H_ | ||
#define FIRESTORE_CORE_INTERFACEFORSWIFT_API_FIREBASEFIRESTORECPP_H_ | ||
#ifndef FIRESTORE_CORE_SRC_API_FIREBASEFIRESTORECPP_H_ | ||
#define FIRESTORE_CORE_SRC_API_FIREBASEFIRESTORECPP_H_ | ||
|
||
#import "CollectionStage.h" | ||
#import "FirestorePipeline.h" | ||
#import "Pipeline.h" | ||
#import "PipelineResult.h" | ||
#import "PipelineSource.h" | ||
#import "Stage.h" | ||
#import "Firestore/core/src/api/FIRCallbackWrapper.h" | ||
Check failure on line 20 in Firestore/core/src/api/FirebaseFirestoreCpp.h
|
||
#import "Firestore/core/src/api/collection_stage.h" | ||
#import "Firestore/core/src/api/firestore_pipeline.h" | ||
#import "Firestore/core/src/api/pipeline.h" | ||
#import "Firestore/core/src/api/pipeline_result.h" | ||
#import "Firestore/core/src/api/pipeline_source.h" | ||
#import "Firestore/core/src/api/stage.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One of the main reasons for restructuring the iOS SDK is to enable Swift source files to access all C++ APIs. Are there any technical limitations or restrictions in moving the existing API headers, like document reference header, into this file? |
||
|
||
#endif // FIRESTORE_CORE_INTERFACEFORSWIFT_API_FIREBASEFIRESTORECPP_H_ | ||
#endif // FIRESTORE_CORE_SRC_API_FIREBASEFIRESTORECPP_H_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1356,7 +1356,7 @@ func abseilDependency() -> Package.Dependency { | |
if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
packageInfo = ( | ||
"https://github.com/firebase/abseil-cpp-SwiftPM.git", | ||
"0.20240116.1" ..< "0.20240117.0" | ||
"0.20240722.2" ..< "0.20240723.0" | ||
) | ||
} else { | ||
packageInfo = ( | ||
|
@@ -1374,7 +1374,7 @@ func grpcDependency() -> Package.Dependency { | |
// If building Firestore from source, abseil will need to be built as source | ||
// as the headers in the binary version of abseil are unusable. | ||
if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
packageInfo = ("https://github.com/grpc/grpc-ios.git", "1.65.0" ..< "1.66.0") | ||
packageInfo = ("https://github.com/grpc/grpc-ios.git", "1.69.0" ..< "1.70.0") | ||
} else { | ||
packageInfo = ("https://github.com/google/grpc-binary.git", "1.65.1" ..< "1.66.0") | ||
} | ||
|
@@ -1401,24 +1401,21 @@ func firestoreWrapperTarget() -> Target { | |
) | ||
} | ||
|
||
func firebaseFirestoreCppTarget() -> Target { | ||
func firebaseFirestoreObjCppTarget() -> Target { | ||
if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
return .target( | ||
name: "FirebaseFirestoreCpp", | ||
name: "FirebaseFirestoreObjCpp", | ||
dependencies: [ | ||
"FirebaseAppCheckInterop", | ||
"FirebaseCore", | ||
"leveldb", | ||
"FirebaseFirestoreInternalWrapper", | ||
.product(name: "nanopb", package: "nanopb"), | ||
.product(name: "gRPC-cpp", package: "grpc-ios"), | ||
"FirebaseFirestoreCpp", | ||
], | ||
path: "Firestore/core/interfaceForSwift", | ||
publicHeadersPath: "api", // Path to the public headers | ||
path: "Firestore/Source", | ||
publicHeadersPath: "Public", // Path to the public headers | ||
cxxSettings: [ | ||
.headerSearchPath("../../../"), | ||
.headerSearchPath("../../Protos/nanopb"), | ||
.headerSearchPath("api"), // Ensure the header search path is correct | ||
.headerSearchPath("../../"), | ||
.headerSearchPath("Public/FirebaseFirestore/"), | ||
.headerSearchPath("../Protos/nanopb"), | ||
] | ||
) | ||
} else { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please add a todo here to remind me to change the binary building process? |
||
|
@@ -1451,7 +1448,7 @@ func firestoreTargets() -> [Target] { | |
if ProcessInfo.processInfo.environment["FIREBASE_SOURCE_FIRESTORE"] != nil { | ||
return [ | ||
.target( | ||
name: "FirebaseFirestoreInternalWrapper", | ||
name: "FirebaseFirestoreCpp", | ||
dependencies: [ | ||
"FirebaseAppCheckInterop", | ||
"FirebaseCore", | ||
|
@@ -1462,6 +1459,8 @@ func firestoreTargets() -> [Target] { | |
], | ||
path: "Firestore", | ||
exclude: [ | ||
// Exclude legacy objc layer | ||
"Source/", | ||
"CHANGELOG.md", | ||
"CMakeLists.txt", | ||
"Example/", | ||
|
@@ -1480,7 +1479,6 @@ func firestoreTargets() -> [Target] { | |
"core/CMakeLists.txt", | ||
"core/src/util/config_detected.h.in", | ||
"core/test/", | ||
"core/interfaceForSwift/", | ||
"fuzzing/", | ||
"test.sh", | ||
// Swift PM doesn't recognize hpp files, so we're relying on search paths | ||
|
@@ -1494,15 +1492,13 @@ func firestoreTargets() -> [Target] { | |
"core/src/util/secure_random_openssl.cc", | ||
], | ||
sources: [ | ||
"Source/", | ||
"Protos/nanopb/", | ||
"core/include/", | ||
"core/src", | ||
], | ||
publicHeadersPath: "Source/Public", | ||
publicHeadersPath: "core/src/api", | ||
cSettings: [ | ||
.headerSearchPath("../"), | ||
.headerSearchPath("Source/Public/FirebaseFirestore"), | ||
.headerSearchPath("Protos/nanopb"), | ||
.define("PB_FIELD_32BIT", to: "1"), | ||
.define("PB_NO_PACKED_STRUCTS", to: "1"), | ||
|
@@ -1518,15 +1514,15 @@ func firestoreTargets() -> [Target] { | |
.linkedLibrary("c++"), | ||
] | ||
), | ||
firebaseFirestoreCppTarget(), | ||
firebaseFirestoreObjCppTarget(), | ||
.target( | ||
name: "FirebaseFirestore", | ||
dependencies: [ | ||
"FirebaseCore", | ||
"FirebaseCoreExtension", | ||
"FirebaseFirestoreInternalWrapper", | ||
"FirebaseSharedSwift", | ||
"FirebaseFirestoreCpp", | ||
"FirebaseFirestoreObjCpp", | ||
"FirebaseSharedSwift", | ||
], | ||
path: "Firestore", | ||
exclude: [ | ||
|
@@ -1548,6 +1544,10 @@ func firestoreTargets() -> [Target] { | |
"Swift/Source/", | ||
], | ||
resources: [.process("Source/Resources/PrivacyInfo.xcprivacy")], | ||
cxxSettings: [ | ||
.headerSearchPath("../"), | ||
.headerSearchPath("Protos/nanopb"), | ||
], | ||
swiftSettings: [ | ||
.interoperabilityMode(.Cxx), // C++ interoperability setting | ||
] | ||
|
@@ -1619,6 +1619,6 @@ func firestoreTargets() -> [Target] { | |
publicHeadersPath: "." | ||
), | ||
firestoreInternalTarget, | ||
firebaseFirestoreCppTarget(), | ||
firebaseFirestoreObjCppTarget(), | ||
] | ||
} |
Unchanged files with check annotations Beta
} | ||
int LocalStore::Backfill() const { | ||
return persistence_->Run("Backfill Indexes", [&] { | ||
Check warning on line 589 in Firestore/core/src/local/local_store.cc
|
||
return index_backfiller_->WriteIndexEntries(this); | ||
}); | ||
} |
static func convertToArrayFromCppVector(_ vector: CppPipelineResult) | ||
-> [PipelineResult] { | ||
// Create a Swift array and populate it by iterating over the C++ vector | ||
var swiftArray: [PipelineResult] = [] | ||
// for index in vector.indices { | ||
// let cppResult = vector[index] |
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
import Firebase | ||
// Verify that the following Firebase Swift APIs can be found. | ||
import FirebaseAnalytics |
androidMinimumVersion = actionCodeSettings?.androidMinimumVersion | ||
androidInstallApp = actionCodeSettings?.androidInstallIfNotAvailable ?? false | ||
handleCodeInApp = actionCodeSettings?.handleCodeInApp ?? false | ||
dynamicLinkDomain = actionCodeSettings?.dynamicLinkDomain | ||
Check warning on line 180 in FirebaseAuth/Sources/Swift/Backend/RPC/GetOOBConfirmationCodeRequest.swift
|
||
linkDomain = actionCodeSettings?.linkDomain | ||
super.init( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed when
interfaceForSwift
did not need to be here before?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure exactly why, I suspect it is because headers under
interfaceForSwift
were using relative paths before. After the move, they are using absolute paths from SRCROOT. But we need the second search path here because the umbrella header still includeFirebaseFirestoreCpp.h
without absolute path.