Skip to content
Closed
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
File renamed without changes.
File renamed without changes.
53 changes: 53 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# *******************************************************************************
# Copyright (c) 2025 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
# *******************************************************************************

load("@score_docs_as_code//:docs.bzl", "docs")
load("@score_tooling//:defs.bzl", "copyright_checker", "setup_starpls", "use_format_targets")

setup_starpls(
name = "starpls_server",
visibility = ["//visibility:public"],
)

copyright_checker(
name = "copyright",
srcs = [
"src",
"tests",
"//:BUILD",
"//:MODULE.bazel",
],
config = "@score_tooling//cr_checker/resources:config",
template = "@score_tooling//cr_checker/resources:templates",
visibility = ["//visibility:public"],
)


# Add target for formatting checks
use_format_targets()

docs(
source_dir = "docs",
)

load("//:full_docs.bzl", "all_docs")

all_docs(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with having a separate command here. Let's see how we can merge POC1 and POC2 next week.

conf = "full_docs/conf.py",
subdocs = {
"@score_platform//:docs_sources": "platform",
":docs_sources": "integration",
"@score_docs_as_code//:docs_sources": "docs_as_code",
"@score_process//:docs_sources": "process",
},
)
31 changes: 31 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# *******************************************************************************
# Copyright (c) 2025 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
# *******************************************************************************
module(
name = "reference_integration",
version = "0.1",
)
bazel_dep(name = "rules_pkg", version = "1.1.0")

bazel_dep(name = "rules_python", version = "1.4.1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
python_version = "3.12",
)
use_repo(python)

bazel_dep(name = "score_tooling", version = "1.0.1")
bazel_dep(name = "score_platform", version = "0.3.0")
bazel_dep(name = "score_process", version = "1.2.0")
bazel_dep(name = "score_docs_as_code", version = "1.4.0")
git_override(module_name = "score_docs_as_code", commit = "f74f2e7", remote = "https://github.com/eclipse-score/docs-as-code") # workaround until 1.4.1+ is released
55 changes: 55 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# *******************************************************************************
# 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


# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "S-CORE Reference Integration"
project_url = "https://eclipse-score.github.io/module_template/"
project_prefix = "INT_"
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",
]

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
20 changes: 20 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
..
# *******************************************************************************
# 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
# *******************************************************************************

#####################
Reference Integration
#####################

This is the reference integration of S-CORE.

83 changes: 83 additions & 0 deletions full_docs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
"""Bazel rules for combining multiple Sphinx documentation sets into a unified documentation site."""

load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
load("@rules_python//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs")

def _adapt_path(path):
"""Adapt the file path by removing leading segments such that index.rst has no leading segments."""
parts = path.split("/")
if parts[0] == "external":
# Necessary for files from other Bazel modules
parts = parts[3:]
else:
# Necessary for files in this module
parts = parts[1:]
return "/".join(parts)

def _full_docs_impl(ctx):
"""Implementation function for the docs_combo rule.

This function aggregates multiple documentation targets by creating symlinks
to their files and generating a top-level index.rst with a table of contents
that references all subdocumentation.
"""
# Generate symlinks to dependency documentation
output = []
for tgt in ctx.attr.subdocs:
name = ctx.attr.subdocs[tgt]
for f in tgt.files.to_list():
s = ctx.actions.declare_file(name + "/" + _adapt_path(f.path))
ctx.actions.symlink(output = s, target_file = f)
print("s.path: " + s.path + " f.path: " + f.path)
output.append(s)

# Generate index with toctree
index = ctx.actions.declare_file("index.rst")
contents = ""
contents += "All of S-CORE\n"
contents += "=============\n\n"
contents += ".. toctree::\n"
contents += " :maxdepth: 2\n\n"
for tgt in ctx.attr.subdocs:
name = ctx.attr.subdocs[tgt]
contents += " " + name + "/index\n"
contents += "\nThis overview document is automatically generated.\n"
ctx.actions.write(output = index, content = contents)
output.append(index)

return [DefaultInfo(files = depset(output))]


docs_combo = rule(
implementation = _full_docs_impl,
attrs = {
"subdocs": attr.label_keyed_string_dict(
doc = "Dictionary mapping documentation targets to their display names",
default = {},
),
},
)


def all_docs(subdocs = {}, conf = "full_docs/conf.py"):
"""Macro to create a complete documentation build combining multiple doc sources."""
docs_combo(
name = "all_docs",
subdocs = subdocs,
)
sphinx_docs(
name = "full_html",
srcs = [":all_docs"],
config = conf,
extra_opts = [
#"-W",
"--keep-going",
"-T", # show more details in case of errors
"--jobs",
"auto",
],
formats = ["html"],
sphinx = ":sphinx_build",
strip_prefix = "full_docs/",
visibility = ["//visibility:public"],
)
55 changes: 55 additions & 0 deletions full_docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# *******************************************************************************
# 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


# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "S-CORE Full Documentation"
project_url = "https://eclipse-score.github.io/module_template/"
project_prefix = "ALL_"
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",
]

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