Changeset 3a71759 in rtems-docs


Ignore:
Timestamp:
01/18/16 05:05:50 (8 years ago)
Author:
Amar Takhar <amar@…>
Branches:
4.11, 5, master
Children:
11e1a6f
Parents:
46498bd
git-author:
Amar Takhar <amar@…> (01/18/16 05:05:50)
git-committer:
Amar Takhar <verm@…> (05/03/16 00:51:24)
Message:

Rework how conf.py is handled.

Needed to switch due to increasing complexity.

Files:
13 added
16 edited

Legend:

Unmodified
Added
Removed
  • ada_user/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "ADA User",
    16                 "FILE_DOC":                             "rtemsada_user",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • book/wscript

    r46498bd r3a71759  
    33path.append(abspath('../common/'))
    44
    5 from waf import cmd_configure, cmd_build
     5from waf import cmd_configure_path, cmd_build_path, cmd_options_path
    66
    77
    88def options(ctx):
    9         ctx.add_option('--rtems-path-py', type='string', help="Path to py/ in RTEMS.")
     9        cmd_options_path(ctx)
    1010
    1111def configure(ctx):
    12         if not ctx.options.rtems_path_py:
    13                 ctx.fatal("--rtems-path-py is required")
    14 
    15         ctx.env.RTEMS_PATH = ctx.options.rtems_path_py
    16         cmd_configure(ctx)
     12        cmd_configure_path(ctx)
    1713
    1814def build(ctx):
    19 
    2015        dirs = [
    2116                "user",
     
    7065        }
    7166
    72         cmd_build(ctx, sub, source_dir="build")
     67        cmd_build_path(ctx)
  • bsp_howto/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "BSP Howto",
    16                 "FILE_DOC":                             "rtemsbsp_howto",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • c_user/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "C User",
    16                 "FILE_DOC":                             "rtemsc_user",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • common/conf.py

    r46498bd r3a71759  
    1 import sys, os
    2 sys.path.append(os.path.abspath('.'))
    3 sys.path.append(os.path.abspath('../../common/'))
    4 
    5 @CONF_EXTRA@
     1#import sys, os
     2#sys.path.append(os.path.abspath('.'))
     3#sys.path.append(os.path.abspath('../../common/'))
     4
    65
    76extensions = [
     
    1716
    1817# Add any paths that contain templates here, relative to this directory.
    19 templates_path = ['_templates']
     18templates_path = ['build/_templates']
    2019
    2120# The suffix of source filenames.
     
    3029# General information about the project.
    3130project = u'RTEMS Documentation Project'
    32 copyright = u'2014, RTEMS Project'
     31copyright = u'2016, RTEMS Project'
    3332
    3433# The version info for the project you're documenting, acts as replacement for
     
    113112# relative to this directory. They are copied after the builtin static files,
    114113# so a file named "default.css" will overwrite the builtin "default.css".
    115 html_static_path = ['_static']
     114html_static_path = ['build/_static']
    116115
    117116# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
     
    163162
    164163# Output file base name for HTML help builder.
    165 htmlhelp_basename = 'rtemsuserdoc'
     164htmlhelp_basename = 'rtemsdoc'
    166165
    167166
  • common/waf.py

    r46498bd r3a71759  
    11import sys, os
     2
     3
    24
    35def cmd_configure(ctx):
    46        ctx.find_program("sphinx-build", var="SPHINX_BUILD")
    57
    6 def cmd_build(ctx, sub, source_dir="."):
     8def cmd_build(ctx, conf_dir=".", source_dir="."):
    79        srcnode = ctx.srcnode.abspath()
    8 
    9         file_conf = ctx.path.parent.find_node("common/conf.py")
    10         tg = ctx(
    11                 features    = "subst",
    12                 source      = file_conf,
    13                 target          = file_conf.name
    14         )
    15 
    16         tg.__dict__.update(sub)
    17 
    1810
    1911        # Copy resources.
     
    3022
    3123        ctx(
    32                 rule   = "${SPHINX_BUILD} -b html -c build -j %s -d build/doctrees %s build/html" % (ctx.options.jobs, source_dir),
     24                rule   = "${SPHINX_BUILD} -b html -c %s -j %d -d build/doctrees %s build/html" % (conf_dir, ctx.options.jobs, source_dir),
    3325                cwd     = ctx.path.abspath(),
    34                 source =  ctx.path.ant_glob('**/*.rst') + ctx.path.ant_glob('conf.py'),
     26                source =  ctx.path.ant_glob('**/*.rst'),# + ctx.path.ant_glob('conf.py'),
    3527                target = ctx.path.find_or_declare('html/index.html')
    3628        )
    3729
     30def cmd_options_path(ctx):
     31        ctx.add_option('--rtems-path-py', type='string', help="Path to py/ in RTEMS.")
     32
     33
     34def cmd_configure_path(ctx):
     35        if not ctx.options.rtems_path_py:
     36                ctx.fatal("--rtems-path-py is required")
     37
     38        ctx.env.RTEMS_PATH = ctx.options.rtems_path_py
     39
     40        cmd_configure(ctx)
     41
     42
     43CONF_FRAG = """
     44sys.path.append(os.path.abspath('../../common/'))
     45sys.path.append('%s')
     46templates_path = ['_templates']
     47html_static_path = ['_static']
     48"""
     49
     50
     51# XXX: fix this ugly hack.  No time to waste on it.
     52def cmd_build_path(ctx):
     53        def run(task):
     54
     55                with open("conf.py") as fp:
     56                        conf = "import sys, os\nsys.path.append(os.path.abspath('../../common/'))\n"
     57                        conf += fp.read()
     58
     59                task.inputs[0].abspath()
     60                task.outputs[0].write(conf + (CONF_FRAG % ctx.env.RTEMS_PATH))
     61
     62        ctx(
     63                rule   = run,
     64                source = [ctx.path.parent.find_node("common/conf.py"), ctx.path.find_node("./conf.py")],
     65                target = ctx.path.get_bld().make_node('conf.py')
     66    )
     67
     68        cmd_build(ctx, conf_dir="build", source_dir="build")
  • cpu_supplement/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "CPU Supplement",
    16                 "FILE_DOC":                             "rtemcpu_supplement",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • develenv/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "Development Environment",
    16                 "FILE_DOC":                             "rtemsdevelenv",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • filesystem/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "Filesystem",
    16                 "FILE_DOC":                             "rtemsfilesystem",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • networking/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "Networking",
    16                 "FILE_DOC":                             "rtemsnetworking",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • porting/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "POSIX",
    16                 "FILE_DOC":                             "rtemsposix",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • posix1003_1/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "POSIX 1003_1",
    16                 "FILE_DOC":                             "rtemsposix1003_1",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • posix_users/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "POSIX Users",
    16                 "FILE_DOC":                             "rtemsposix_users",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • rtemsconfig/wscript

    r46498bd r3a71759  
    33path.append(abspath('../common/'))
    44
     5from waf import cmd_options_path, cmd_configure_path, cmd_build_path
    56
    6 from waf import cmd_configure, cmd_build
    77
    88def options(ctx):
    9             ctx.add_option('--rtems-path-py', type='string', help="Path to py/ in RTEMS.")
     9                cmd_options_path(ctx)
    1010
    1111def configure(ctx):
    12 
    13         if not ctx.options.rtems_path_py:
    14                 ctx.fatal("--rtems-path-py is required")
    15 
    16         ctx.env.RTEMS_PATH = ctx.options.rtems_path_py
    17 
    18         cmd_configure(ctx)
    19 
    20 
     12        cmd_configure_path(ctx)
    2113
    2214def build(ctx):
    23 #       path.append(ctx.env.RTEMS_PATH)
     15        cmd_build_path(ctx)
    2416
    25         sub = {
    26                 "VERSION":                              "1.0",
    27                 "RELEASE":                              "5.0.0",
    28                 "DOC":                                  "RTEMS Config",
    29                 "FILE_DOC":                             "rtemsconfig",
    30                 "CONF_EXTRA":                   "sys.path.append('%s')" % ctx.env.RTEMS_PATH
    31         }
    32 
    33         cmd_build(ctx, sub)
  • shell/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "Shell",
    16                 "FILE_DOC":                             "rtemsshell",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
  • user/wscript

    r46498bd r3a71759  
    99
    1010def build(ctx):
    11 
    12         sub = {
    13                 "VERSION":                              "1.0",
    14                 "RELEASE":                              "5.0.0",
    15                 "DOC":                                  "User Manual",
    16                 "FILE_DOC":                             "rtemsmanual",
    17         }
    18 
    19         cmd_build(ctx, sub)
     11        cmd_build(ctx)
Note: See TracChangeset for help on using the changeset viewer.