Changeset 0263581 in rtems-docs


Ignore:
Timestamp:
Mar 26, 2017, 11:27:29 PM (3 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
33989b6
Parents:
ad5d632
Message:

waf: Fix linkcheck and spell commands.

Clean up and remove code that is not needed.

Fix sphinx-build quoting to work on Windows.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • common/waf.py

    rad5d632 r0263581  
    2222    return '%s %s %s' % (d, m, y)
    2323
     24def version_cmdline(ctx):
     25    return "-Drelease='%s' -Dversion='%s'" % (ctx.env.VERSION, ctx.env.VERSION)
     26
     27def sphinx_cmdline(ctx, build_type, conf_dir, doctrees, source_dir, output_dir):
     28    rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \
     29           (sphinx_verbose(ctx), build_type, conf_dir, version_cmdline(ctx),
     30            doctrees, source_dir, output_dir)
     31    return rule
     32
    2433def cmd_spell(ctx):
    2534    from waflib import Options
     
    4958        call(cmd)
    5059
    51 
    52 def cmd_linkcheck(ctx, conf_dir=".", source_dir="."):
    53     ctx_rule = "${BIN_SPHINX_BUILD} -b linkcheck -c %s -j %d " + \
    54                "-d build/doctrees %s build/linkcheck" % (conf_dir,
    55                                                          ctx.options.jobs,
    56                                                              source_dir)
    57     ctx(
    58         rule   = ctx_rule,
     60def cmd_linkcheck(ctx):
     61    conf_dir = ctx.path.get_src()
     62    source_dir = ctx.path.get_src()
     63    buildtype = 'linkcheck'
     64    build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
     65    rule = sphinx_cmdline(ctx, buildtype, conf_dir, doctrees, source_dir, output_dir)
     66    ctx(
     67        rule   = rule,
    5968        cwd    = ctx.path.abspath(),
    6069        source = ctx.path.ant_glob('**/*.rst'),
     
    104113    doctrees = os.path.join(os.path.dirname(output_dir), 'doctrees', buildtype)
    105114    return build_dir, output_node, output_dir, doctrees
    106 
    107 def version_cmdline(ctx):
    108     return "-Drelease='%s' -Dversion='%s'" % (ctx.env.VERSION, ctx.env.VERSION)
    109115
    110116def pdf_resources(ctx, buildtype):
     
    229235                          "(https://github.com/remy/inliner)")
    230236
    231 def sphinx_cmdline(ctx, build_type, conf_dir, doctrees, source_dir, output_dir):
    232     rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \
    233            (sphinx_verbose(ctx), build_type, conf_dir, version_cmdline(ctx),
    234             doctrees, source_dir, output_dir)
    235     return rule
    236 
    237237def doc_pdf(ctx, source_dir, conf_dir):
    238238    buildtype = 'latex'
     
    323323                      quiet = True)
    324324
    325 def cmd_build(ctx, conf_dir = ".", source_dir = "."):
    326     srcnode = ctx.srcnode.abspath()
     325def cmd_build(ctx):
     326    conf_dir = ctx.path.get_src()
     327    source_dir = ctx.path.get_src()
    327328
    328329    if ctx.env.BUILD_PDF == 'yes':
     
    446447
    447448    cat.unlink()
    448 
    449 CONF_FRAG = """
    450 sys.path.append(os.path.abspath('../../common/'))
    451 sys.path.append('%s')
    452 templates_path = ['_templates']
    453 html_static_path = ['_static']
    454 """
    455 
    456 # XXX: fix this ugly hack.  No time to waste on it.
    457 def cmd_build_path(ctx):
    458     def run(task):
    459 
    460         with open("conf.py") as fp:
    461             conf = "import sys, os\nsys.path.append(os.path.abspath('../../common/'))\n"
    462             conf += fp.read()
    463 
    464         task.inputs[0].abspath()
    465         task.outputs[0].write(conf + (CONF_FRAG % ctx.env.RTEMS_PATH))
    466 
    467     ctx(
    468         rule   = run,
    469         source = [ctx.path.parent.find_node("common/conf.py"),
    470                   ctx.path.find_node("./conf.py")],
    471         target = ctx.path.get_bld().make_node('conf.py')
    472     )
    473 
    474     cmd_build(ctx, conf_dir = "build", source_dir = "build")
  • wscript

    rad5d632 r0263581  
    8080    for b in building:
    8181        ctx.recurse(b)
     82
     83def cmd_spell(ctx):
     84    for b in building:
     85        ctx.recurse(b)
     86
     87def cmd_linkcheck(ctx):
     88    for b in building:
     89        ctx.recurse(b)
Note: See TracChangeset for help on using the changeset viewer.