Files
vpn-dns-gateway/demo/ci/extract-architecture.py
T
vsun1 27b82c169e
vpn-dns-gateway/pipeline/head This commit looks good
vpn-dns-gateway/pipeline/pr-main This commit looks good
Add frozen TikZRefinery demo baseline and build pipeline
2026-11-25 22:46:33 -05:00

30 lines
1.1 KiB
Python

"""Generate source-based diagrams, separate from the authored architecture."""
from pathlib import Path
import subprocess
output = Path('/output/architecture')
output.mkdir(exist_ok=True)
configuration = output / 'Doxyfile'
configuration.write_text('''PROJECT_NAME = TikZRefinery
OUTPUT_DIRECTORY = /output/architecture
INPUT = /workspace/demo/tikzrefinery/code/src /workspace/demo/tikzrefinery/code/plugins /workspace/demo/tikzrefinery/code/plugin-api
RECURSIVE = YES
FILE_PATTERNS = *.h *.cpp
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
GENERATE_HTML = YES
GENERATE_LATEX = NO
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
DOT_IMAGE_FORMAT = svg
INTERACTIVE_SVG = NO
QUIET = YES
WARN_IF_UNDOCUMENTED = NO
WARN_LOGFILE = /output/reports/doxygen-warnings.txt
''')
subprocess.run(['doxygen', str(configuration)], check=True)
graphs = list((output / 'html').glob('*coll*graph.svg')) + list((output / 'html').glob('*inherit*graph.svg'))
assert graphs, 'No source-based class graph was generated'
print(f'PASS: generated {len(graphs)} class/collaboration graphs from C++ source')