22
33This repository serves as a ** template** for setting up ** C++ and Rust projects** using ** Bazel** .
44It provides a ** standardized project structure** , ensuring best practices for:
5+
56- ** Build configuration** with Bazel.
67- ** Testing** (unit and integration tests).
78- ** Documentation** setup.
@@ -14,49 +15,71 @@ The template includes a **basic "Hello World" example** for both **C++ and Rust*
1415
1516## 📂 Project Structure
1617
17- | File/Folder | Description |
18- | -----------------------| -------------|
19- | ` README.md ` | Short description & build instructions |
20- | ` src/ ` | Source files for the module |
21- | ` tests/ ` | Unit tests (UT) and integration tests (IT) |
22- | ` docs/ ` | Documentation (Doxygen for C++ / mdBook for Rust) |
23- | ` .github/workflows/ ` | CI/CD pipelines |
24- | ` .vscode/ ` | Recommended VS Code settings |
25- | ` .bazelrc ` , ` MODULE.bazel ` , ` BUILD ` | Bazel configuration & settings |
26- | ` LICENSE.md ` | Licensing information |
27- | ` CONTRIBUTION.md ` | Contribution guidelines |
18+ | File/Folder | Description |
19+ | ----------------------------------- | ------------------------------------------------- |
20+ | ` README.md ` | Short description & build instructions |
21+ | ` examples/ ` | Examples how to invoke targets of the module |
22+ | ` src/ ` | Source files for the module |
23+ | ` tests/ ` | Unit tests (UT) and integration tests (IT) |
24+ | ` docs/ ` | Documentation (Doxygen for C++ / mdBook for Rust) |
25+ | ` .github/workflows/ ` | CI/CD pipelines |
26+ | ` .vscode/ ` | Recommended VS Code settings |
27+ | ` .bazelrc ` , ` MODULE.bazel ` , ` BUILD ` | Bazel configuration & settings |
28+ | ` LICENSE.md ` | Licensing information |
29+ | ` CONTRIBUTION.md ` | Contribution guidelines |
2830
2931---
3032
3133## 🚀 Getting Started
3234
3335### 1️⃣ Clone the Repository
36+
3437``` sh
3538git clone https://github.com/eclipse-score/YOUR_PROJECT.git
3639cd YOUR_PROJECT
3740```
3841
39- ### 2️⃣ Build the Project
40- #### C++
42+ ### 2️⃣ Build the Examples of module
43+
44+ > DISCLAMER: Depending what module implements, it's possible that different
45+ > configuration flags needs to be set on command line.
46+
47+ To build all targets of the module the following command can be used:
48+
4149``` sh
42- bazel build //...
50+ bazel build //src/ ...
4351```
44- #### Rust
52+
53+ This command will instruct Bazel to build all targets that are under Bazel
54+ package ` src/ ` . The ideal solution is to provide single target that builds
55+ artifacts, for example:
56+
4557``` sh
46- bazel build //rust/...
58+ bazel build //src/ < module_name > :release_artifacts
4759```
4860
61+ where ` :release_artifacts ` is filegroup target that collects all release
62+ artifacts of the module.
63+
64+ > NOTE: This is just proposal, the final decision is on module maintainer how
65+ > the module code needs to be built.
66+
4967### 3️⃣ Run the Example
68+
5069#### C++
70+
5171``` sh
5272bazel run //src:main
5373```
74+
5475#### Rust
76+
5577``` sh
5678bazel run //rust:main
5779```
5880
5981### 4️⃣ Run Tests
82+
6083``` sh
6184bazel test //tests/...
6285```
0 commit comments