Skip to content

Commit a18b175

Browse files
committed
plant_uml_parser: create a public rule to parse groups of UML files
1 parent 09de2b1 commit a18b175

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

bazel/rules/rules_score/private/architectural_design.bzl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,26 @@ _architectural_design = rule(
226226
**VERBOSITY_ATTR
227227
),
228228
)
229+
def _parse_puml_diagrams_impl(ctx):
230+
return _parse_puml_diagrams(ctx, ctx.files.files)
231+
232+
parse_puml_diagrams = rule(
233+
implementation = _parse_puml_diagrams_impl,
234+
doc = "Helper rule to run the PlantUML parser on a list of .puml files and produce FlatBuffers binaries and lobster files.",
235+
attrs = {
236+
"files": attr.label_list(
237+
allow_files = [".puml", ".plantuml"],
238+
mandatory = True,
239+
doc = "List of .puml/.plantuml files to parse",
240+
),
241+
"_puml_parser": attr.label(
242+
default = Label("@score_tooling//plantuml/parser:parser"),
243+
executable = True,
244+
cfg = "exec",
245+
doc = "PlantUML parser tool that generates FlatBuffers from .puml files",
246+
),
247+
},
248+
)
229249

230250
# ============================================================================
231251
# Public Macro

bazel/rules/rules_score/rules_score.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ load(
2020
load(
2121
"//bazel/rules/rules_score/private:architectural_design.bzl",
2222
_architectural_design = "architectural_design",
23+
_parse_puml_diagrams = "parse_puml_diagrams",
2324
)
2425
load(
2526
"//bazel/rules/rules_score/private:assumed_system_requirements.bzl",
@@ -71,6 +72,7 @@ load(
7172
)
7273

7374
architectural_design = _architectural_design
75+
parse_puml_diagrams = _parse_puml_diagrams
7476
assumptions_of_use = _assumptions_of_use
7577
assumed_system_requirements = _assumed_system_requirements
7678
component_requirements = _component_requirements

0 commit comments

Comments
 (0)