Skip to content

Commit

Permalink
build: Add support for specifying documents to build
Browse files Browse the repository at this point in the history
Use as a comma separated list:

  --doc-list=eng,c-user
  • Loading branch information
verm authored and Kinsey Moore committed Feb 21, 2025
1 parent 0096f2e commit 4f9f4a5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions common/waf.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ def run_sphinx(bld):
ctx.end_msg('found')

def cmd_configure(ctx):
ctx.env.DOC_LIST = ctx.options.doc_list[0].split(
",") if ctx.options.doc_list else []
ctx.env.PYTHON = ["python3"]
ctx.check_python_version((3,9))
ctx.load("python")
Expand Down Expand Up @@ -272,6 +274,7 @@ def cmd_configure(ctx):
ctx.env.append_value('SPHINX_OPTIONS', opt)
ctx.end_msg(msg)


#
# Check extensions.
#
Expand All @@ -291,6 +294,7 @@ def cmd_configure(ctx):
else:
pass


#
# Optional builds.
#
Expand Down Expand Up @@ -569,6 +573,11 @@ def cmd_options(ctx):
action = 'store_true',
default = False,
help = "Build DITAA images using PlantUML from source, need ditaa and puml")
ctx.add_option('--doc-list',
action = 'store',
default = "",
nargs="+",
help = "Comma separated list of docs to build.")

def cmd_options_path(ctx):
cmd_options(ctx)
Expand Down
7 changes: 7 additions & 0 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ def build(ctx):
ctx.recurse('images')
ctx.add_group('images')

if ctx.env.DOC_LIST:
global building
for doc in ctx.env.DOC_LIST:
if doc not in building:
ctx.fatal("'{}' not in doc list".format(doc))
building = ctx.env.DOC_LIST

for b in building:
ctx.recurse(b)

Expand Down

0 comments on commit 4f9f4a5

Please sign in to comment.