The main object of this module is to enable constructing and deconstructing uProtocol CloudEvents.
IMPORTANT NOTE: This project is under active development
The core module contains functional factory methods for creating CloudEvents as well as functional factory methods that make it more intuitive to create URIs that are used to configure source and sink (destination) elements in the uProtocol CloudEvents.
This module contains the data model structures as well as core functionality for building uProtocol CloudEvents and URIs for sink and source attributes.
The SDKs are then used by the code generators to auto-populate service stubs with generated code that builds CloudEvents. For more information on auto-generating service stubs, please refer to uProtocol Main Project
- Compiler: GCC/G++ 11 or Clang 13
- vcpkg
- Ubuntu 22.04
- cgreen testing library
At first to make it working, you have to install some linux libraries as dependencies
$ sudo apt-get install build-essential \
libbsd-dev \
make \
ninja-build \
pkg-config \
clang-format \
cmake \
uuid \
gcc-11 \
g++-11 \
lcov \
uuid-dev \
openssl \
libssl-dev
In this package we're using the cgreen testing library.
$ git clone https://github.com/cgreen-devs/cgreen.git
$ cd cgreen
$ make
$ sudo make install
It should appear in /usr/local/lib and in /usr/local/include
$ sudo apt-get install libgtest-dev
$ sudo apt-get install openssl-devel
$ sudo apt-get install libuuid-devel
$ sudo apt-get install rapidjson-devel
$ install spdlog : https://github.com/gabime/spdlog
$ install cgreen : https://github.com/cgreen-devs/cgreen/blob/master/INSTALL.md
$ install protobuf : git clone --progress -b v3.21.12 https://github.com/protocolbuffers/protobuf
mkdir build & cd build\
cmake ../cmake \
-DCMAKE_BUILD_TYPE=Release \
-Dprotobuf_BUILD_SHARED_LIBS=ON \
-Dprotobuf_BUILD_TESTS=OFF; \
sudo -E make -j4 install
$ git clone --branch uprotocol-core-api-1.5.5 https://github.com/eclipse-uprotocol/up-core-api.git
$ git clone https://github.com/eclipse-uprotocol/uprotocol-sdk-cpp.git
$ cd uprotocol-sdk-cpp
$ code .
Using VSCode with the CMake & CMake Tools plugins, following steps will be done automatically when the project is opened in VSCode. Build and test can be triggered using the extension.
Please refer the following link for the CMake Tools extension: https://code.visualstudio.com/docs/cpp/CMake-linux
If the CMake Tools plugin is not configured to auto generate, then manually run cmake and build using the following commands.
$ mkdir build
$ cd build
$ /usr/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++ -S .. -B build -G Ninja
$ ninja
$ ninja test
Now you should see formatting the code with clang-format, building and running the unit tests.
Give a ⭐️ if this project helped you!