How covesa/capicxx-wamp-tools works
Project type and purpose
• This is an extensible “code‐generation tool” project for CommonAPI WAMP bindings.
• It provides:
• A Java/Xtend core library that reads Franca IDL (.fidl) files and generates WAMP binding code.
• A standalone CLI (jar) for headless code generation.
• An Eclipse-based UI plugin to invoke generation from the IDE.
• Example projects (C++ server + JS client) and an automated test suite.
• Eclipse feature/update-site and target-platform modules for distribution.
File structure
Top-level Maven/Eclipse modules:
• org.genivi.commonapi.wamp ← core generator library (Xtend+Java)
• org.genivi.commonapi.wamp.cli ← standalone CLI front-end (Java)
• org.genivi.commonapi.wamp.ui ← Eclipse plugin front-end
• org.genivi.commonapi.wamp.examples ← sample Franca models + generated C++/JS code + crossbar scripts
• org.genivi.commonapi.wamp.tests ← unit tests (Java/Xtend), Mocha tests, C++ runtime tests
• org.genivi.commonapi.wamp.feature ← Eclipse feature descriptor
• org.genivi.commonapi.wamp.updatesite← update site packaging + scripts
• org.genivi.commonapi.wamp.releng ← release-engineering scripts/config
• org.genivi.commonapi.wamp.target ← Eclipse target platform definitions
README
• Confirms that the core is a code generator for CommonAPI WAMP.
• Outlines the CLI usage, command-line options, and notes a separate C++ runtime library dependency.
• Mentions an experimental JS generator integrated into Franca IDE (Franca 13+).
Main components & their relationships
A. Franca IDL Input
→ fed into the core generator library (org.genivi.commonapi.wamp).
B. Front-ends:
1. CLI module
• Depends on the core library.
• Packs as “org.genivi.commonapi.wamp.cli-<version>.jar”.
• Exposes command-line flags (-f, -d, -np, etc.).
2. Eclipse UI plugin
• Dependent on core library.
• Contributes menu item in Franca sub-menu (“Generate JS code for Autobahn-binding”).
• Reads workspace .fidl files and invokes the same generator modules.
C. Core generator library (generator modules)
• Contains Xtend generators for:
– Proxy code
– Stub adapter code
– Types support
– Deployment specs
– Automake/CMake helper scripts
• Preference & validation classes for configurable generation parameters.
• Verification & model-builder utilities.
D. Outputs
• C++ code (stub, proxy, types, deployment spec)
• JS client proxy + example blueprint files
• Generated code lands in configurable dest folders (common, proxy, stub, subdirs).
E. External dependencies
• Franca IDL (input format)
• capicxx-wamp-runtime (C++ runtime library)
• Node.js + Autobahn|JS (for generated JS clients & Mocha tests)
• Crossbar router (for WAMP transport in examples/tests)
• CMake build system (for C++ server examples & tests)
F. Examples & tests
• org.genivi.commonapi.wamp.examples:
– Several testcases (example10, example12, etc.) with .fidl models
– CMakeLists, client index.html + server .cpp/.hpp stubs
– workdir scripts (runServer.sh, runRESTClient.sh) + crossbar config.
• org.genivi.commonapi.wamp.tests:
– Java/Xtend unit tests for generator correctness
– Mocha tests driving a real WAMP router + generated code
– Reference C++ deployment adapters for verification
G. Distribution & release
• Feature, updatesite, releng, target modules to assemble an Eclipse update site & target platform.
Architectural patterns & design principles
• Modular, plugin-based architecture (Maven multimodule).
• Clear “front-ends vs. core” separation: both CLI and UI invoke the same generator code.
• Generator logic implemented in Xtend (meta-programming) with dependency injection (Guice modules).
• Test-driven: unit tests (Xtend/Java), integration tests (Mocha + C++).
• Example-driven documentation & verification.