Skip to content
Prev Previous commit
Next Next commit
Revert plantuml solution
Solution doesn't work, need to find a better way in the future
  • Loading branch information
MaximilianSoerenPollak committed May 7, 2025
commit fd8d442356009779d92c606335a901a8f7b1df58
39 changes: 15 additions & 24 deletions docs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,21 @@ sphinx_requirements = all_requirements + [
"@docs-as-code//src/extensions/score_source_code_linker:score_source_code_linker",
]

def plantuml_setup():
def docs(source_files_to_scan_for_needs_links = None, source_dir = "docs", conf_dir = "docs", build_dir_for_incremental = "_build", docs_targets = []):
"""
Creates all targets related to documentation.
By using this function, you'll get any and all updates for documentation targets in one place.
Current restrictions:
* only callable from 'docs/BUILD'
"""

sphinx_build_binary(
name = "sphinx_build",
visibility = ["//visibility:public"],
data = ["@docs-as-code//src:docs_assets"],
deps = sphinx_requirements,
)

java_binary(
name = "plantuml",
jvm_flags = ["-Djava.awt.headless=true"],
Expand All @@ -78,29 +92,6 @@ def plantuml_setup():
visibility = ["//visibility:public"],
)

def sphinx_setup():
"""
Creates sphinx build binary target needed for documentation.
Only call this once from your WORKSPACE or a central BUILD file.
"""
sphinx_build_binary(
name = "sphinx_build",
visibility = ["//visibility:public"],
data = ["@docs-as-code//src:docs_assets"],
deps = sphinx_requirements,
)

def docs(source_files_to_scan_for_needs_links = None, source_dir = "docs", conf_dir = "docs", build_dir_for_incremental = "_build", docs_targets = [], setup_dependencies = False):
"""
Creates all targets related to documentation.
By using this function, you'll get any and all updates for documentation targets in one place.
Current restrictions:
* only callable from 'docs/BUILD'
"""
if setup_dependencies:
plantuml_setup()
sphinx_setup()

# Parse source files for needs links
# This needs to be created to generate a target, otherwise it won't execute as dependency for other macros
parse_source_files_for_needs_links(
Expand Down