-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathconf.py
More file actions
98 lines (85 loc) · 3.51 KB
/
Copy pathconf.py
File metadata and controls
98 lines (85 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# *******************************************************************************
# 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
# *******************************************************************************
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
import shutil
from pathlib import Path
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = "Lifecycle and Health Management"
project_url = "https://eclipse-score.github.io/lifecycle/"
project_prefix = "LIFE_"
author = "S-CORE"
version = "0.1"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"sphinx_design",
"sphinx_needs",
"sphinxcontrib.plantuml",
"score_plantuml",
"score_metamodel",
"score_draw_uml_funcs",
"score_source_code_linker",
"score_layout",
"myst_parser",
]
include_patterns = [
"index.rst",
"docs/**",
"examples/docs/**",
"score/launch_manager/docs/**",
"score/launch_manager/src/lifecycle_client/docs/**",
"score/health_monitor/docs/**",
]
exclude_patterns = [
# The following entries are not required when building the documentation via 'bazel
# build //docs:docs', as that command runs in a sandboxed environment. However, when
# building the documentation via 'bazel run //docs:incremental' or esbonio, these
# entries are required to prevent the build from failing.
"bazel-*",
".venv_docs",
]
templates_path = ["templates"]
# Enable numref
numfig = True
def setup(app):
# When Sphinx runs inside a Bazel action (bazel build //:needs_json), the
# CWD is the execroot / sandbox root and the JSON schema files are linked
# there at their workspace-relative paths (src/...) because they are
# declared as tools. However, the Sphinx source tree lives under
# bazel-out/…/_needs_json/_sources/, so literalinclude directives that
# traverse four levels up from docs/module/…/user_guide/ land at
# _sources/src/…, which Bazel does not populate automatically. Copying
# the files into the source tree directory makes literalinclude work
# without touching the RST files or the external docs macro.
#
# For non-Bazel runs (bazel run //:docs, local sphinx-build) the source
# JSON files already exist at srcdir.parent / "src" / …, so the guard
# below is a no-op.
srcdir = Path(app.srcdir)
workspace_root = Path(os.getcwd())
src_json_dir = (
workspace_root
/ "score/lifecycle/score/launch_manager/src/daemon/src/configuration/config_schema"
)
dest_json_dir = (
srcdir.parent
/ "score/lifecycle/score/launch_manager/src/daemon/src/configuration/config_schema"
)
if src_json_dir.exists() and not dest_json_dir.exists():
dest_json_dir.parent.mkdir(parents=True, exist_ok=True)
shutil.copytree(src_json_dir, dest_json_dir)