DSAnnotation is a modular Clang-based tooling pipeline that scans C++ translation units for Declarative Services annotations and emits a merged OSGi-style manifests compatible for CppMicroServices Declarative Services.
include/dsannotation/
core/ # Domain models (Component, Reference, Error, Result)
parsing/ # AST visitor + parser interfaces/implementations
serialization/ # Manifest builder, merger, writer abstractions
support/ # Error reporting, filesystem, syntax helpers
config/ # Runtime configuration objects
src/
core/ # Concrete domain types
parsing/ # Parsing pipeline implementations
serialization/ # JSON generation & manifest merge
support/ # Platform services (filesystem, checks)
app/
main.cpp # Composition root & Clang tool wiring
tests/
... # GoogleTest unit coverage
##Requirements Being a clang tool it obviously depends on the LLVM clang. However, to achieve the AST parsing, it requires a few more clang, libclang-dev and LLVM libraries which might not come in pre-released LLVM zips.
In unix the following packages should give you everything:
apt-get install clang llvm libclang-dev
However, on windows you might need to build LLVM from source, to get all the dependencies.
cmake -S . -B build
cmake --build build --config ReleaseThe top-level CMakeLists.txt exposes:
dsannotation_core,dsannotation_support,dsannotation_parsing,dsannotation_serialization– structured static librariesdsannotation– CLI executabledsannotation_tests– GoogleTest suite (see below)
build\dsannotation.exe --help
build\dsannotation.exe -p path\to\compilation_database -i path\to\existing\manifest.json -o out\dir source.cppOutput is written to ParserConfig::outputDirectory / ParserConfig::outputFileName (default manifest.json). Existing manifests are merged so custom bundle metadata is preserved.
cmake --build build --target dsannotation_tests
ctest --test-dir build -C ReleaseAdditional unit tests are being added under tests/ and linked against the modular libraries.