Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ dash_license_checker(
use_format_targets()

docs(
data = [
"@score_platform//:needs_json",
],
source_dir = "docs",
)
9 changes: 8 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,11 @@ bazel_dep(name = "aspect_rules_lint", version = "1.5.3")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")

#docs-as-code
bazel_dep(name = "score_docs_as_code", version = "1.1.0")
bazel_dep(name = "score_docs_as_code", version = "1.3.0")

bazel_dep(name = "score_platform", version = "0.3.0")
git_override(
module_name = "score_platform",
remote = "https://github.com/eclipse-score/score.git",
commit = "64eb8acf8436c60f1a6daaf6bc67763797792838", # trlc-2.0.2 release
)
68 changes: 4 additions & 64 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,71 +12,11 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

Module Template Documentation
Example Documentation
=============================

This documentation describes the structure, usage and configuration of the Bazel-based C++/Rust module template.
.. toctree::
:maxdepth: 5

.. contents:: Table of Contents
:depth: 2
:local:
scrample/index.rst

Overview
--------

This repository provides a standardized setup for projects using **C++** or **Rust** and **Bazel** as a build system.
It integrates best practices for build, test, CI/CD and documentation.

Requirements
------------

.. stkh_req:: Example Functional Requirement
:id: stkh_req__docgen_enabled__example
:status: valid
:safety: QM
:security: YES
:reqtype: Functional
:rationale: Ensure documentation builds are possible for all modules


Project Layout
--------------

The module template includes the following top-level structure:

- `src/`: Main C++/Rust sources
- `tests/`: Unit and integration tests
- `examples/`: Usage examples
- `docs/`: Documentation using `docs-as-code`
- `.github/workflows/`: CI/CD pipelines

Quick Start
-----------

To build the module:

.. code-block:: bash

bazel build //src/...

To run tests:

.. code-block:: bash

bazel test //tests/...

Configuration
-------------

The `project_config.bzl` file defines metadata used by Bazel macros.

Example:

.. code-block:: python

PROJECT_CONFIG = {
"asil_level": "QM",
"source_code": ["cpp", "rust"]
}

This enables conditional behavior (e.g., choosing `clang-tidy` for C++ or `clippy` for Rust).
28 changes: 28 additions & 0 deletions docs/scrample/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
..
# *******************************************************************************
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

Scample example
=============================

.. # Component level

.. comp_req:: Comp_Req_1
:id: comp_req__scrample__comp_req_1
:reqtype: Functional
:security: NO
:safety: ASIL_B
:satisfies: S-CORE_feat_req__baselibs__core_utilities
:status: valid

Example component requirement
Loading