This describes how to Firestore CPP SDK works on supported platforms, and how to contribute this Firestore CPP SDK.
Please read README.md and CONTRIBUTING.md from the repository root first.
There is no specific prerequisites for Firestore, README.md from the root directory
should have everything you need.
One slight enhancement is to use [https://github.com/pyenv/pyenv][pyenv] to manage your python versions, if you work on multiple projects with different python requirements.
For CPP SDK to compile, you generally need your pyenv which python to point to
a Python3 installation.
It is easier to work this Firestore CPP SDK by keeping a high level archetecture in mind:
To summarize, the C++ Code in this directory is an adapting layer on top of the underlying SDKs: Firestore Android SDK for Android, and C++ Core SDK for everything else.
These dependencies live within different github repos, so understanding where and which versions of the dependencies being used is critical to troubleshooting, should the issues stem from those dependencies or the interop layer.
Desktop builds of the Firestore SDK uses CMAKE to build and test. The complete set
of tests lives under ${REPO_ROOT}/firestore/integration_test_internal. To build
the Firestore CPP SDK and its test suites:
# from ${REPO_ROOT}/firestore/integration_test_internal
mkdir cmake-build-debug
cd cmake-build-debug
# Generate build files
cmake .. # Or OPENSSL_ROOT_DIR=${PATH_TO_OPENSSL} cmake ..
# Build SDK and tests
cmake --build . -jOnce above steps are successful, there should be a integration_test under the current directory:
./integration_test # Run all tests against Firestore Prod Backend
USE_FIRESTORE_EMULATOR=yes ./integration_test # Run all tests against Firestore Emulator
# Run all tests against Firestore Emulator on a custom port
USE_FIRESTORE_EMULATOR=yes FIRESTORE_EMULATOR_PORT=9999 ./integration_test
./integration_test --gtest_filter="*Query*" # Run a subset of testsIt is also possible to change where we get the underlying C++ Core SDK living under
firebase-ios-sdk by providing a custom cmake flag FIRESTORE_DEP_SOURCE:
# Default behavior when not specified, getting the Core SDK the last C++ SDK release
# was released with.
cmake -DFIRESTORE_DEP_SOURCE=RELEASED ..
# Clones the origin/master branch of `firebase-ios-sdk` to get the Core SDK.
cmake -DFIRESTORE_DEP_SOURCE=TIP ..
# Clones the origin/master branch of `firebase-ios-sdk` to get the Core SDK.
cmake -DFIRESTORE_DEP_SOURCE=origin/master ..
# Clones commit '555555' of `firebase-ios-sdk`.
cmake -DFIRESTORE_DEP_SOURCE=555555 ..Open up the repo root directory from CLion should load all symbols for the SDK itsel should
load all symbols for the SDK itself. Once loaded, you can right load on
firestore/integration_test_internal/CMakeLists.txt and load project to load the tests into
the IDE.
