Skip to content

Commit 05ce64b

Browse files
committed
Fix: README.md and directory
The current proposal doesn't work with provided instructions.
1 parent 32b5df3 commit 05ce64b

File tree

11 files changed

+106
-76
lines changed

11 files changed

+106
-76
lines changed

BUILD

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
113
load("@score_cr_checker//:cr_checker.bzl", "copyright_checker")
214

315
copyright_checker(
4-
name = "copyright_check",
5-
srcs = ["src"],
16+
name = "copyright",
17+
srcs = [
18+
"src",
19+
"tests",
20+
"//:BUILD",
21+
"//:MODULE.bazel",
22+
],
623
template = "@score_cr_checker//resources:templates",
724
config = "@score_cr_checker//resources:config",
825
visibility = ["//visibility:public"],

MODULE.bazel

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
113
module(name = "cpp_rust_template_repository", version = "1.0")
214

3-
415
# Add GoogleTest dependency
516
bazel_dep(name = "googletest", version = "1.14.0")
617

718
# Rust rules for Bazel
819
bazel_dep(name = "rules_rust", version = "0.56.0")
920

10-
1121
# Add your custom module from the bazel_registry
1222
bazel_dep(name = "score_cr_checker", version = "0.2.0")

README.md

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
This repository serves as a **template** for setting up **C++ and Rust projects** using **Bazel**.
44
It 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
3538
git clone https://github.com/eclipse-score/YOUR_PROJECT.git
3639
cd 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
5272
bazel run //src:main
5373
```
74+
5475
#### Rust
76+
5577
```sh
5678
bazel run //rust:main
5779
```
5880

5981
### 4️⃣ Run Tests
82+
6083
```sh
6184
bazel test //tests/...
6285
```

src/BUILD

Whitespace-only changes.

src/cpp/BUILD

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/cpp/main.cpp

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/rust/BUILD

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/rust/main.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/cpp/BUILD

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
113
cc_test(
214
name = "cpp_test_main",
315
srcs = ["test_main.cpp"],

tests/cpp/test_main.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/********************************************************************************
2+
* Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
113
#include <gtest/gtest.h>
214

315
// Function to be tested

0 commit comments

Comments
 (0)