source: rtems-docs/wscript @ 98977bf

5
Last change on this file since 98977bf was 98977bf, checked in by Chris Johns <chrisj@…>, on 02/06/19 at 22:31:33

Version change, forgot to add wscript to the commit.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1#
2# RTEMS Project Documentation
3#
4
5import sys
6import os.path
7
8sys.path.append(os.path.abspath('common'))
9
10import waflib
11import waf as docs_waf
12import version
13
14#
15# Branch version
16#
17rtems_major_version = '5'
18
19#
20# The documents to build.
21#
22build_all = ['user',
23             'c-user',
24             'bsp-howto',
25             'posix-users',
26             'posix-compliance',
27             'eng',
28             'filesystem',
29             'networking',
30             'shell',
31             'cpu-supplement',
32             'develenv',
33             'eclipse']
34
35building = build_all
36
37def options(opt):
38    docs_waf.cmd_options(opt)
39
40def configure(conf):
41    for b in building:
42        conf.recurse(b)
43    conf.env['BUILD_FROM_TOP'] = 'yes'
44
45def catalogue(ctx):
46    docs_waf.xml_catalogue(ctx, building)
47
48def coverpage_js(ctx):
49    js = None
50    xml = None
51    for f in ctx.inputs:
52        if f.abspath().endswith('.js'):
53            with open(f.abspath()) as i:
54                js = i.read()
55        elif f.abspath().endswith('.xml'):
56            with open(f.abspath()) as i:
57                xml = i.read()
58    xml = xml.replace('\n', ' \\\n');
59    with open(ctx.outputs[0].abspath(), 'w') as o:
60        o.write(js.replace('@CATALOGUE', xml))
61
62
63def build(ctx):
64    #
65    # Get the version.
66    #
67    ver_version, ver_date, ver_released = version.get(ctx, rtems_major_version)
68    ctx.env.DATE = ver_date
69    ctx.env.RELEASE = ver_version + ' (' + ver_date + ')'
70    ctx.env.VERSION = ver_version
71    ctx.to_log('Build: %s%s' % (ctx.env.RELEASE, os.linesep))
72
73    #
74    #
75    # Generate any PlantUML images if enabled.
76    #
77    ctx.recurse('images')
78    ctx.add_group('images')
79
80    for b in building:
81        ctx.recurse(b)
82
83    #
84    # Build the catalogue, coverpage.js and install.
85    #
86    ctx(rule = catalogue,
87        target = 'catalogue.xml',
88        source = ['wscript', 'common/waf.py'] + ['%s/conf.py' % x for x in building])
89    ctx.install_files('${PREFIX}', 'catalogue.xml')
90    ctx(rule = coverpage_js,
91        target = 'coverpage.js',
92        source = ['wscript', 'catalogue.xml', 'common/coverpage/coverpage.js'])
93    ctx.install_as('${PREFIX}/coverpage.js', 'coverpage.js')
94    #
95    # Install the static content.
96    #
97    ctx.install_as('${PREFIX}/index.html', 'common/coverpage/coverpage.html')
98    static_dir = ctx.path.find_dir('common/coverpage/static')
99    ctx.install_files('${PREFIX}/static',
100                      static_dir.ant_glob('**'),
101                      cwd = static_dir,
102                      relative_trick = True)
103
104def install(ctx):
105    for b in building:
106        ctx.recurse(b)
107
108def cmd_spell(ctx):
109    for b in building:
110        ctx.recurse(b)
111
112def cmd_linkcheck(ctx):
113    for b in building:
114        ctx.recurse(b)
Note: See TracBrowser for help on using the repository browser.