-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Delete Firestore public C++ API #2050
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3a6089e
Add firebase_cpp_sdk 5.4.0
wilhuff 7a3ecd2
Move C++ public API headers to cpp/include
wilhuff 3606763
Add Firebase C++ API tests.
wilhuff 0fc93c4
Add support for building on Linux
wilhuff cc9f6e9
Add clang-format configuration for Firestore/cpp
wilhuff 17c6a82
Add windows build support
wilhuff 970ca74
Review feedback
wilhuff f08e580
Revert build changes to support Firebase C++ integration.
wilhuff 5968113
Delete Firestore/cpp and public C++ artifacts
wilhuff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2018 Google | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
add_subdirectory(include/firebase/firestore) | ||
|
||
add_subdirectory(test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2018 Google | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Workaround to make the headers show up in IDEs | ||
# (see https://stackoverflow.com/questions/27039019/ and open issue on CMake | ||
# issue tracker: https://gitlab.kitware.com/cmake/cmake/issues/15234) | ||
add_custom_target( | ||
firebase_firestore_ide | ||
SOURCES | ||
collection_reference.h | ||
document_change.h | ||
document_reference.h | ||
document_snapshot.h | ||
event_listener.h | ||
field_path.h | ||
field_value.h | ||
firestore.h | ||
listener_registration.h | ||
map_field_value.h | ||
metadata_changes.h | ||
query.h | ||
query_snapshot.h | ||
set_options.h | ||
settings.h | ||
snapshot_metadata.h | ||
source.h | ||
transaction.h | ||
write_batch.h | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2018 Google | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
cc_test( | ||
firebase_firestore_cpp_test | ||
SOURCES | ||
firebase_app_test.cc | ||
DEPENDS | ||
firebase_app | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2018 Google | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include <memory> | ||
|
||
#include "firebase/app.h" | ||
#include "gtest/gtest.h" | ||
|
||
using firebase::App; | ||
using firebase::AppOptions; | ||
|
||
TEST(FirebaseAppTest, TestCreate) { | ||
AppOptions options; | ||
std::unique_ptr<App> app{App::Create(options)}; | ||
ASSERT_NE(nullptr, app.get()); | ||
EXPECT_STREQ(firebase::kDefaultAppName, app->name()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright 2018 Google | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_path( | ||
FIREBASE_CPP_SDK_DIR include/firebase/future.h | ||
HINTS | ||
$ENV{FIREBASE_CPP_SDK_DIR} | ||
${FIREBASE_BINARY_DIR}/external/src/firebase_cpp_sdk | ||
) | ||
|
||
find_path( | ||
FIREBASE_CPP_INCLUDE_DIR firebase/future.h | ||
PATHS | ||
${FIREBASE_CPP_SDK_DIR}/include | ||
) | ||
|
||
if(APPLE) | ||
if("${CMAKE_OSX_SYSROOT}" MATCHES "iphoneos") | ||
# iOS | ||
set(FIREBASE_CPP_LIB_DIR ${FIREBASE_CPP_SDK_DIR}/libs/ios/${CMAKE_SYSTEM_PROCESSOR}) | ||
else() | ||
set(FIREBASE_CPP_LIB_DIR ${FIREBASE_CPP_SDK_DIR}/libs/darwin/universal) | ||
endif() | ||
endif() | ||
|
||
find_library( | ||
FIREBASE_CPP_APP_LIBRARY | ||
NAMES firebase_app | ||
HINTS | ||
${FIREBASE_CPP_LIB_DIR} | ||
) | ||
|
||
find_package_handle_standard_args( | ||
firebase_cpp_sdk | ||
DEFAULT_MSG | ||
FIREBASE_CPP_INCLUDE_DIR | ||
FIREBASE_CPP_APP_LIBRARY | ||
) | ||
|
||
if(FIREBASE_CPP_SDK_FOUND) | ||
set(FIREBASE_CPP_INCLUDE_DIRS ${FIREBASE_CPP_INCLUDE_DIR}) | ||
|
||
if (NOT TARGET firebase_app) | ||
add_library(firebase_app UNKNOWN IMPORTED) | ||
set_target_properties( | ||
firebase_app PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES ${FIREBASE_CPP_INCLUDE_DIRS} | ||
IMPORTED_LOCATION ${FIREBASE_CPP_APP_LIBRARY} | ||
) | ||
endif() | ||
endif(FIREBASE_CPP_SDK_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2018 Google | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
include(ExternalProject) | ||
|
||
if(TARGET firebase_cpp_sdk) | ||
return() | ||
endif() | ||
|
||
set(version 5.4.0) | ||
|
||
ExternalProject_Add( | ||
firebase_cpp_sdk | ||
|
||
DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR} | ||
URL https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_${version}.zip | ||
URL_HASH SHA256=e21302574a806ee6111e58eef9cf226ac61e2736bc98e7abee2b44fb41deaa6b | ||
|
||
PREFIX ${PROJECT_BINARY_DIR} | ||
|
||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
TEST_COMMAND "" | ||
) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This only works on apple, because this variable is otherwise empty. Patch for linux below. You're on your own for windows.
Sadly, while the patch allows everything to compile, the test immediately segfaults under at least gcc 7.3.0 and clang 5.0. (https://firebase.google.com/docs/cpp/setup#desktop-workflow lists the latter as explicitly tested.) The library's been stripped of symbols, so it's a little tricky to debug. No need to figure that out before submitting though.
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.
Though come to think of it, travis might prevent you from submitting with linux in a broken state...
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.
Yeah, I think a better patch would be
The crash comes from the fact that the C++ SDK is compiled with gcc4 which predates gcc5's new C++11 ABI.
I thought I could fix this by adding something like this to the test CMakeLists.txt:
Unfortunately, this now fails to build because gtest has been compiled with the C++11 ABI but the test iteself has not. The way to fix this is to propagate this down to all of the dependencies we build via ExternalProject. I'm working on that now.