Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 108-implement-rpc-call-for-server-side-scripting
  • dev
  • f-consol-message
  • f-rel-path
  • f-related-projects
  • f-remote-path
  • f-role
  • f-sss4grpc
  • f-to-string
  • f-update-requirements
  • f-windows-conan-create
  • main
  • v0.0.1
  • v0.0.10
  • v0.0.15
  • v0.0.16
  • v0.0.18
  • v0.0.19
  • v0.0.2
  • v0.0.3
  • v0.0.4
  • v0.0.5
  • v0.0.6
  • v0.0.7
  • v0.0.8
  • v0.0.9
  • v0.1
  • v0.1.1
  • v0.1.2
  • v0.2.0
  • v0.2.1
  • v0.2.2
  • v0.3.0
33 results

Target

Select target project
  • caosdb/src/caosdb-cpplib
1 result
Select Git revision
  • 108-implement-rpc-call-for-server-side-scripting
  • dev
  • f-consol-message
  • f-rel-path
  • f-related-projects
  • f-remote-path
  • f-role
  • f-sss4grpc
  • f-to-string
  • f-update-requirements
  • f-windows-conan-create
  • main
  • v0.0.1
  • v0.0.10
  • v0.0.15
  • v0.0.16
  • v0.0.18
  • v0.0.19
  • v0.0.2
  • v0.0.3
  • v0.0.4
  • v0.0.5
  • v0.0.6
  • v0.0.7
  • v0.0.8
  • v0.0.9
  • v0.1
  • v0.1.1
  • v0.1.2
  • v0.2.0
  • v0.2.1
  • v0.2.2
  • v0.3.0
33 results
Show changes
Commits on Source (123)
FROM debian:buster-backports
FROM debian:bullseye
RUN apt-get update
RUN apt-get install -y cmake/buster-backports
RUN apt-get install -y cmake
RUN apt-get install -y lcov
RUN apt-get install -y doxygen
RUN apt-get install -y doxygen graphviz
RUN apt-get install -y clang-format-11 clang-tidy-11
RUN apt-get install -y python3-pip
RUN apt-get install -y git
......
......@@ -85,9 +85,6 @@ test:
- mkdir build
- cd build
- conan install .. -s "compiler.libcxx=libstdc++11"
- FILE_TO_BE_PATCHED="$(grep "std::unique_ptr<ContextAllocator> context_allocator) {}" -l -r $(conan config home))"
- echo "FILE_TO_BE_PATCHED=$FILE_TO_BE_PATCHED"
- sed -e "s|std::unique_ptr<ContextAllocator> context_allocator) {}|std::unique_ptr<ContextAllocator> /*context_allocator*/) {}|" -i $FILE_TO_BE_PATCHED
- cmake -DCMAKE_BUILD_TYPE=Debug ..
- cmake --build . -j
- cmake --build . -j --target unit_test_coverage
......@@ -143,12 +140,8 @@ trigger_inttest:
tags: [ cached-dind ]
stage: deploy
script:
- mkdir -p build
- cd build
- conan install .. -s "compiler.libcxx=libstdc++11"
- cmake ..
- cmake --build . --target doc-sphinx
- cp -r doc/sphinx_out ../public
- make doc
- cp -r build/doc/sphinx_out ./public
test_pages:
<<: *pages_prepare
......
# Summary
Insert a meaningful description for this merge request here. What is the
new/changed behavior? Which bug has been fixed? Are there related Issues?
# Focus
Point the reviewer to the core of the code change. Where should they start
reading? What should they focus on (e.g. security, performance,
maintainability, user-friendliness, compliance with the specs, finding more
corner cases, concrete questions)?
# Test Environment
How to set up a test environment for manual testing?
# Check List for the Author
Please, prepare your MR for a review. Be sure to write a summary and a
focus and create gitlab comments for the reviewer. They should guide the
reviewer through the changes, explain your changes and also point out open
questions. For further good practices have a look at [our review
guidelines](https://gitlab.com/caosdb/caosdb/-/blob/dev/REVIEW_GUIDELINES.md)
- [ ] All automated tests pass
- [ ] Reference related Issues
- [ ] Up-to-date CHANGELOG.md
- [ ] Annotations in code (Gitlab comments)
- Intent of new code
- Problems with old code
- Why this implementation?
# Check List for the Reviewer
- [ ] I understand the intent of this MR
- [ ] All automated tests pass
- [ ] Up-to-date CHANGELOG.md
- [ ] The test environment setup works and the intended behavior is
reproducible in the test environment
- [ ] In-code documentation and comments are up-to-date.
- [ ] Check: Are there specifications? Are they satisfied?
For further good practices have a look at [our review guidelines](https://gitlab.com/caosdb/caosdb/-/blob/dev/REVIEW_GUIDELINES.md).
/assign me
/target_branch dev
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.0.13 - Unreleased]
### Added
* New functions getEnumNameFromValue() and getEnumValueFromName().
* Extern C now supports the full C++ functionalities.
### Changed
* Integer values are 32 bit now.
### Deprecated
### Removed
### Fixed
* #11 - Transaction::GetResultSet() now always returns a valid reference.
* #25 - Compiles on MacOS with LLVM now.
### Security
doc/CHANGELOG.md
\ No newline at end of file
......@@ -20,11 +20,11 @@
cmake_minimum_required(VERSION 3.13)
set(libcaosdb_VERSION 0.0.20)
set(libcaosdb_VERSION 0.1.2)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_MAJOR 0)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_MINOR 5)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_PATCH 0)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_PRE_RELEASE "GRPC${libcaosdb_VERSION}")
set(libcaosdb_COMPATIBLE_SERVER_VERSION_MINOR 7)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_PATCH 3)
set(libcaosdb_COMPATIBLE_SERVER_VERSION_PRE_RELEASE "")
project(libcaosdb
VERSION ${libcaosdb_VERSION}
......@@ -79,8 +79,8 @@ add_subdirectory(doc)
# Protobuf/Grpc source files
set(PROTO_FILES
${PROJECT_SOURCE_DIR}/proto/proto/caosdb/info/v1alpha1/main.proto
${PROJECT_SOURCE_DIR}/proto/proto/caosdb/entity/v1alpha1/main.proto
${PROJECT_SOURCE_DIR}/proto/proto/caosdb/info/v1/main.proto
${PROJECT_SOURCE_DIR}/proto/proto/caosdb/entity/v1/main.proto
)
set(PROTO_PATH ${PROJECT_SOURCE_DIR}/proto/proto)
......@@ -157,6 +157,8 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
$<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(caosdb_grpc SYSTEM PUBLIC
${CONAN_INCLUDE_DIRS}
)
else()
......@@ -166,30 +168,47 @@ else()
endif()
target_link_libraries(caosdb
${CONAN_LIBS}
stdc++fs
)
target_include_directories(caosdb PUBLIC
$<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(caosdb SYSTEM PUBLIC
${CONAN_INCLUDE_DIRS}
)
add_library(ccaosdb SHARED src/ccaosdb.cpp)
target_link_libraries(ccaosdb
${LIBCAOSDB}
${CONAN_LIBS}
${LIBCAOSDB}
stdc++fs
)
target_include_directories(ccaosdb PUBLIC
$<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(ccaosdb SYSTEM PUBLIC
${CONAN_INCLUDE_DIRS}
)
add_executable(ccaosdbcli EXCLUDE_FROM_ALL src/ccaosdbcli.c)
target_include_directories(ccaosdbcli PUBLIC
$<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(ccaosdbcli SYSTEM PUBLIC
${CONAN_INCLUDE_DIRS}
)
target_link_libraries(ccaosdbcli
ccaosdb
${CONAN_LIBS}
${LIBCAOSDB}
ccaosdb
)
add_executable(cxxcaosdbcli EXCLUDE_FROM_ALL src/cxxcaosdbcli.cpp)
......@@ -197,6 +216,8 @@ target_include_directories(cxxcaosdbcli PUBLIC
$<BUILD_INTERFACE:${libcaosdb_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${libcaosdb_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(cxxcaosdbcli SYSTEM PUBLIC
${CONAN_INCLUDE_DIRS}
)
target_link_libraries(cxxcaosdbcli
......
# GENERAL
* >=conan-1.37.2 (e.g. with `pip install conan`)
* >=cmake-3.13
* >=gcc-10.2.0 | >=clang-11
# OPTIONAL
* For checking the schema of a json configuration file: >=jsonschema-3.2.0
# BUILD DOCS
* doxygen
* >=python-3.7
* >=pip-21.0.1
* python packages from the `doc/requirements.txt` file.
# BUILD AND RUN TESTS
* >=clang-tidy-11
* >=gtest-1.10.0
# COVERAGE
* >=gcc-10.2.0
* >=lcov-1.15
# FORMATTING
* >=clang-formatting-11
doc/DEPENDENCIES.md
\ No newline at end of file
doc/FEATURES.md
\ No newline at end of file
......@@ -58,9 +58,28 @@ conan-install:
conan install . -s $(CONAN_SETTINGS) --build=missing)
.PHONY: conan-install
conan-install-debug:
conan install . -s $(CONAN_SETTINGS) -s build_type=Debug || \
(echo "'conan install' failed, trying to build from sources..."; \
conan install . -s $(CONAN_SETTINGS) -s build_type=Debug --build=missing)
.PHONY: conan-install-debug
conan-create:
conan create . -s $(CONAN_SETTINGS)
.PHONY: conan-create
conan-create-debug:
conan create . -s $(CONAN_SETTINGS) -s build_type=Debug
.PHONY: conan-create-debug
conan: conan-install conan-create
.PHONY: conan
doc:
mkdir -p build && cd build && conan install .. -s $(CONAN_SETTINGS) \
&& cmake .. && cmake --build . --target doc-sphinx \
&& echo "The documentation starts at build/doc/sphinx_out/index.html ."
.PHONY: doc
conan-debug: conan-install-debug conan-create-debug
.PHONY: conan-debug
......@@ -7,8 +7,8 @@ for CaosDB and a part of the CaosDB project.
## Setup
Please read the [README_SETUP.md](README_SETUP.md) for instructions on how to
develop, build and use this code.
Please read the installation notes [online](https://docs.indiscale.com/caosdb-cpplib/Install_develop.html) or [in the source repository](doc/Install_develop.md) for instructions
on how to build, use and develop this code.
## Further Reading
......@@ -20,7 +20,7 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md).
## License
* Copyright (C) 2021 Indiscale GmbH <info@indiscale.com>
* Copyright (C) 2022 Indiscale GmbH <info@indiscale.com>
All files in this repository are licensed under a [GNU Affero General Public
License](LICENCE.md) (version 3 or later).
doc/README_SETUP.md
\ No newline at end of file
......@@ -13,20 +13,32 @@ guidelines of the CaosDB Project
## Steps
1. Create a release branch from the dev branch. This prevents further changes
to the code base and a never ending release process. Naming: `release-<VERSION>`
1. Create a release branch from the dev branch. This prevents further changes to
the code base and a never ending release process. Naming:
`release-<VERSION>`. Also create a branch with the same name in cppinttests.
2. Update CHANGELOG.md
3. Check all general prerequisites.
4. Prepare [CMakeLists.txt](./CMakeLists.txt): Check the `MAJOR`, `MINOR`, `PATCH`
version variables.
4. Update version numbers:
1. In [CMakeLists.txt](./CMakeLists.txt): Check the version variables and
make sure that the compatible caosdb-server version is set correctly.
2. In `conanfile.py`: Update the `version` variable.
3. In `caosdb-cppinttest/conanfile.py`: Update the version
5. Merge the release branch into the main branch.
6. Tag the latest commit of the main branch with `v<VERSION>`.
6. Tag the latest commit of the main branch with `v<VERSION>`. Push the tag and the main branch.
7. Delete the release branch.
7. Create release in Gitlab:
1. On [Releases](https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib/-/releases), click "New release"
2. Choose tag, type release title (same as tag), no milestone, possibly short release note, no
manual assets are necessary, possibly link to documentation.
8. TODO...
8. Delete the release branch.
9. Release cppinttests with updated cpplib version
10. Merge `main` back into `dev` and increase patch version by one to begin next
release cycle. Do the same in cppintest.
......@@ -136,6 +136,18 @@
include(CMakeParseArguments)
option(CODE_COVERAGE_VERBOSE "Verbose information" FALSE)
option(SKIP_CODE_COVERAGE "Skip code coverage" OFF)
if (SKIP_CODE_COVERAGE)
return()
endif()
find_library(covlib NAMES gcov lcov)
message(STATUS "covlib: >${covlib}<")
if (${covlib} STREQUAL "covlib-NOTFOUND")
message(STATUS "lcov or gcov libraries not found, skipping code coverage.")
return()
endif()
# Check prereqs
find_program( GCOV_PATH gcov )
......
......@@ -3,7 +3,7 @@ from conans import ConanFile, CMake, tools
class CaosdbConan(ConanFile):
name = "caosdb"
version = "0.0.20"
version = "0.1.2"
license = "AGPL-3.0-or-later"
author = "Timm C. Fitschen <t.fitschen@indiscale.com>"
url = "https://gitlab.indiscale.com/caosdb/src/caosdb-cpplib.git"
......@@ -14,11 +14,16 @@ class CaosdbConan(ConanFile):
default_options = {"shared": False, "fPIC": True}
generators = "cmake"
requires = [
("boost/1.76.0"),
("boost/1.77.0"),
("grpc/1.39.1"),
]
build_requires = [
("gtest/1.11.0"),
("grpc/1.38.0"),
]
exports = "*.cpp", "*.h", "*.cmake", "*CMakeLists.txt", "*.in", "*.proto", "*.c"
exports = ("*.cmake", "*CMakeLists.txt", "*.in",
"*.h", "*.proto", "*.c", "*.cpp",
"*.rst", "*.md",
)
exports_sources = "src", "doc", "include", "test", "cmake", "proto"
def config_options(self):
......
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
### Changed
### Deprecated
### Removed
### Fixed
- #41 Updated Conan version in CI pipeline.
### Security
### Documentation
## [0.1.2] - 2022-05-31
(Florian Spreckelsen)
### Fixed
- #41 Updated Conan version in CI pipeline.
## [0.1.1 - 2022-04-12]
### Security
- Bumped zlib dependency to 1.2.12.
## [0.1.0 - 2021-12-11]
Initial Release.
Please review [FEATURES.md](./FEATURES.md) for an overview of the features of
this library. Apart from that, the API documentation for
[C++](https://docs.indiscale.com/caosdb-cpplib/cppapi/index.html) and [plain
old C](https://docs.indiscale.com/caosdb-cpplib/capi/index.html) specify the
public API.
Note that this is still a pre-stable release as indicated by the major version
number. The API is still under development and is likely to change.
......@@ -18,6 +18,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
cmake_minimum_required(VERSION 3.13)
find_package(Doxygen)
if (DOXYGEN_FOUND)
......@@ -83,18 +84,22 @@ if (DOXYGEN_FOUND)
sphinx_out
DEPENDS doc-doxygen
Examples.rst
README_SETUP.md
Install_develop.rst
FEATURES.md
CHANGELOG.md
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Sphinx"
VERBATIM
)
# Copying files is necessary: https://stackoverflow.com/a/45808534/232888
# TODO fix for docs
#FILE(COPY
#Examples.rst
#README_SETUP.md
file(COPY
Examples.rst
Install_develop.rst
DEPENDENCIES.md
CHANGELOG.md
FEATURES.md
# Tutorial.rst
#DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
else ()
message("Sphinx need to be installed to generate the sphinx documentation")
endif ()
......
# Dependencies #
## General ##
```
>=conan-1.43 (e.g. with `pip install conan`)
>=cmake-3.13
>=gcc-10.2.0 | >=clang-11
```
## Optional ##
* For checking the schema of a json configuration file: `>=jsonschema-3.2.0`
## Build docs ##
```
doxygen
>=python-3.7
>=pip-21.0.1
python packages from the `doc/requirements.txt` file
```
## Build and run tests ##
```
>=clang-tidy-11
>=gtest-1.10.0
```
## Coverage ##
```
>=gcc-10.2.0
>=lcov-1.15
```
## Formatting ##
```
>=clang-formatting-11
```
......@@ -5,10 +5,10 @@ Examples
Connect to a CaosDB server
--------------------------
See also the hints on how to :doc:`get started<README_SETUP>`, and set-up of
libcaosdb. In order to connect to a CaosDB server with libcaosdb you first have to configure the
connection via a configuration file as explained in the :ref:`configuration section <Client Configuration>`. Once the configuration is set up, connecting to the server is
as easy as
See also the hints on how to :doc:`get started<Install_develop>`, and set-up of libcaosdb. In order
to connect to a CaosDB server with libcaosdb you first have to configure the connection via a
configuration file as explained in the :ref:`"Client Configuration" section <Client
Configuration>`. Once the configuration is set up, connecting to the server is as easy as
.. code:: cpp
......@@ -19,6 +19,7 @@ You can print the full version of the server that you are connected to (and
therby test the connection) via:
.. code:: cpp
// get version info of the server
connection.RetrieveVersionInfo()
const auto &v_info = connection->GetVersionInfo();
......@@ -57,8 +58,9 @@ you want to retrieve an Entity with id=123. This is done via
You can then use the getter methods like :cpp:any:`GetId<caosdb::entity::Entity::GetId>`,
:cpp:any:`GetParents<caosdb::entity::Entity::GetParents>`, or :cpp:any:`GetProperties`<caosdb::entity::Entity::GetProperties>` to get the
name, the parents, or the properties of the retrieved entity.
:cpp:any:`GetParents<caosdb::entity::Entity::GetParents>`, or
:cpp:any:`GetProperties`<caosdb::entity::Entity::GetProperties>` to get the name, the parents, or
the properties of the retrieved entity.
Retrieving multiple entities works in the same way. Type
......@@ -83,9 +85,9 @@ transaction manually. This is done by
transaction->RetrieveById("1233");
auto status = transaction->Execute();
A result set can be obtained
via :cpp:any:`GetResultSet`<caosdb::transaction::Transaction::GetResultSet>` which contains the resulting entities
and can, e.g., be checked for length.
A result set can be obtained via
:cpp:any:`GetResultSet`<caosdb::transaction::Transaction::GetResultSet>` which contains the
resulting entities and can, e.g., be checked for length.
Execute queries
---------------
......@@ -147,6 +149,7 @@ Insert, update and delete operations function the same way. The respective
task is added to a transaction and the transaction is executed.
.. code:: cpp
const auto &connection =
caosdb::connection::ConnectionManager::GetDefaultConnection();
......@@ -202,7 +205,7 @@ task is added to a transaction and the transaction is executed.
Up- and Download a file
---------------
-----------------------
.. code:: cpp
......