Skip to content

Commit b639ed1

Browse files
Optionally configure the input dir [OI-652] (#111)
1 parent 3262a9c commit b639ed1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

doxygen/doxygen.bzl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ def _swift_doxygen_impl(ctx):
2020

2121
config = configure_file_impl(ctx, vars, ctx.attr.name + "_Doxyfile")[0].files.to_list()[0]
2222

23+
input_dir = ""
24+
if "PROJECT_SOURCE_DIR" in vars:
25+
input_dir = vars["PROJECT_SOURCE_DIR"]
26+
27+
project_name = ""
28+
if "PROJECT_NAME" in vars:
29+
project_name = vars["PROJECT_NAME"]
30+
2331
ctx.actions.run_shell(
2432
inputs = [config] + ctx.files.deps,
2533
outputs = [doxygen_out],
@@ -36,9 +44,11 @@ def _swift_doxygen_impl(ctx):
3644
sed -i "s|@DOXYGEN_DOT_FOUND@|$DOXYGEN_DOT_FOUND|g" {config}
3745
sed -i "s|@DOXYGEN_DOT_PATH@|$DOXYGEN_DOT_PATH|g" {config}
3846
sed -i "s|@PLANTUML_JAR_PATH@|/usr/local/bin/plantuml.jar|g" {config}
47+
sed -i "s|@INPUT_DIR@|{input_dir}|g" {config}
48+
sed -i "s|@PROJECT_NAME@|{project_name}|g" {config}
3949
4050
PATH=$PATH doxygen {config}
41-
""".format(config = config.path),
51+
""".format(config = config.path, input_dir = input_dir, project_name = project_name),
4252
)
4353

4454
return [DefaultInfo(files = depset([doxygen_out, config]))]

0 commit comments

Comments
 (0)