Skip to content

Commit ad30777

Browse files
Adding ability to build documentation (#7)
* Adding ability to build documentation * Adding extensions
1 parent f1026f0 commit ad30777

File tree

10 files changed

+261
-0
lines changed

10 files changed

+261
-0
lines changed

.bazelrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
build --java_language_version=17
2+
build --tool_java_language_version=17
3+
build --java_runtime_version=remotejdk_17
4+
build --tool_java_runtime_version=remotejdk_17
5+
6+
test --test_output=errors
7+
8+
# stop legacy behavior of creating __init__.py files
9+
build --incompatible_default_to_explicit_init_py
10+
11+
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
12+
common --registry=https://bcr.bazel.build

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.4.0

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Commonly used for local settings and secrets
2+
.env
3+
4+
# Bazel
5+
bazel-*
6+
MODULE.bazel.lock
7+
user.bazelrc
8+
9+
# Ruff
10+
.ruff_cache
11+
12+
# docs:incremental and docs:ide_support build artifacts
13+
/_build*
14+
15+
# Vale - editorial style guide
16+
.vale.ini
17+
styles/
18+
19+
# direnv - folder-specific bash configuration
20+
.envrc
21+
22+
# Python
23+
.venv
24+
venv/
25+
__pycache__/
26+
/.coverage
27+
run_helper.py

.vscode/extensions.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"recommendations": [
3+
// Editing *.drawio.svg files directly in VS Code
4+
"hediet.vscode-drawio",
5+
6+
// Some convenient extensions for editing reStructuredText files
7+
"lextudio.restructuredtext",
8+
9+
// Linting and live preview for score docs
10+
"swyddfa.esbonio",
11+
12+
// ErrorLens highlights errors and warnings in your code / docs
13+
"usernamehw.errorlens",
14+
15+
// Linting and formatting for Python (LSP via ruff server)
16+
"charliermarsh.ruff",
17+
18+
// Code Spell checker
19+
"streetsidesoftware.code-spell-checker",
20+
]
21+
}

.vscode/settings.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
// General Settings
3+
"files.insertFinalNewline": true,
4+
"files.trimFinalNewlines": true,
5+
"files.trimTrailingWhitespace": true,
6+
"editor.insertSpaces": true,
7+
"editor.tabCompletion": "on",
8+
9+
// When using ruff for formatting 88 characters per line is the standard.
10+
"editor.rulers": [88],
11+
"[python]": {
12+
// Opinionated option for the future:
13+
// "editor.formatOnSave": true,
14+
"editor.codeActionsOnSave": {
15+
"source.sortImports": "explicit"
16+
},
17+
"editor.defaultFormatter": "charliermarsh.ruff"
18+
},
19+
20+
// RST Settings
21+
"[restructuredtext]": {
22+
"editor.tabSize": 3
23+
},
24+
//
25+
//
26+
"python.testing.pytestArgs": [
27+
".",
28+
"--ignore-glob=bazel-*/*",
29+
"--ignore-glob=.venv_docs/*",
30+
"--ignore-glob=_build/*"
31+
],
32+
"python.testing.unittestEnabled": false,
33+
"python.testing.pytestEnabled": true,
34+
"bazel.lsp.command": "bazel",
35+
"bazel.lsp.args": ["run", "//:starpls_server"]
36+
}

.yamlfmt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
formatter:
2+
type: basic
3+
retain_line_breaks: true

BUILD

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
# *******************************************************************************
13+
load("@score_format_checker//:macros.bzl", "use_format_targets")
14+
15+
# Enables formatting targets
16+
#'bazel test //:format.check'
17+
#'bazel run //:format.fix'
18+
use_format_targets()

MODULE.bazel

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
# *******************************************************************************
13+
14+
###############################################################################
15+
#
16+
# Packaging dependencies
17+
#
18+
###############################################################################
19+
bazel_dep(name = "rules_pkg", version = "1.0.1")
20+
21+
###############################################################################
22+
#
23+
# Python version
24+
#
25+
###############################################################################
26+
bazel_dep(name = "rules_python", version = "1.0.0")
27+
28+
PYTHON_VERSION = "3.12"
29+
30+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
31+
python.toolchain(
32+
configure_coverage_tool = True,
33+
is_default = True,
34+
python_version = PYTHON_VERSION,
35+
)
36+
use_repo(python)
37+
38+
# Additional Python rules provided by aspect, e.g. an improved version of
39+
bazel_dep(name = "aspect_rules_py", version = "1.0.0")
40+
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
41+
42+
###############################################################################
43+
#
44+
# Generic linting and formatting rules
45+
#
46+
###############################################################################
47+
bazel_dep(name = "aspect_rules_lint", version = "1.3.1")
48+
49+
# Provides, pytest & venv
50+
bazel_dep(name = "score_python_basics", version = "0.3.0")
51+
52+
# Checker rule for CopyRight checks/fixes
53+
bazel_dep(name = "score_cr_checker", version = "0.2.2")
54+
bazel_dep(name = "score_docs_as_code", version = "0.2.1")
55+
bazel_dep(name = "score_format_checker", version = "0.1.1")

process/BUILD

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
# *******************************************************************************
13+
14+
load("@aspect_rules_py//py:defs.bzl", "py_library")
15+
load("@score_docs_as_code//:docs.bzl", "docs")
16+
17+
# Creates all documentation targets:
18+
# - `process:incremental` for building docs incrementally at runtime
19+
# - `process:live_preview` for live preview in the browser without an IDE
20+
# - `process:ide_support` for creating python virtualenv for IDE support
21+
# - `process:docs` for building documentation at build-time
22+
23+
docs(
24+
conf_dir = "process", # Where 'conf.py' is
25+
docs_targets = [
26+
{
27+
"suffix": "", # local build without any dependencies on external needs
28+
},
29+
],
30+
source_dir = "process", # Where the RST files are located
31+
source_files_to_scan_for_needs_links = [
32+
# Note: you can add filegroups, globs, or entire targets here.
33+
],
34+
)

process/conf.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
# *******************************************************************************
13+
14+
# Configuration file for the Sphinx documentation builder.
15+
#
16+
# For the full list of built-in configuration values, see the documentation:
17+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
22+
23+
project = "Process Description"
24+
author = "S-CORE"
25+
version = "0.1"
26+
27+
# -- General configuration ---------------------------------------------------
28+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
29+
30+
31+
extensions = [
32+
"sphinx_design",
33+
"sphinx_needs",
34+
"sphinxcontrib.plantuml",
35+
"score_plantuml",
36+
"score_metamodel",
37+
"score_draw_uml_funcs",
38+
"score_source_code_linker",
39+
"score_layout",
40+
]
41+
42+
exclude_patterns = [
43+
# The following entries are not required when building the documentation via 'bazel
44+
# build //docs:docs', as that command runs in a sandboxed environment. However, when
45+
# building the documentation via 'bazel run //docs:incremental' or esbonio, these
46+
# entries are required to prevent the build from failing.
47+
"bazel-*",
48+
".venv_docs",
49+
]
50+
51+
templates_path = ["templates"]
52+
53+
# Enable numref
54+
numfig = True

0 commit comments

Comments
 (0)