Use a single top level version number.

Fix the path in the catalogue links to allow prefix testing on a local
disk.

Close #2940.
This commit is contained in:
Chris Johns 2017-03-20 11:42:56 +11:00
parent c2c29d8831
commit 81276042d2
18 changed files with 109 additions and 104 deletions

View File

@ -3,11 +3,9 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '4.11.0'
release = '4.11.0'
project = "RTEMS BSP and Device Driver Development Guide" project = "RTEMS BSP and Device Driver Development Guide"
latex_documents = [ latex_documents = [('index',
('index', 'bsp-howto.tex', u'RTEMS BSP and Device Driver Development Guide', u'RTEMS Documentation Project', 'manual'), 'bsp-howto.tex',
] u'RTEMS BSP and Device Driver Development Guide',
u'RTEMS Documentation Project', 'manual')]

View File

@ -3,11 +3,10 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '4.11.0'
release = '4.11.0'
project = "RTEMS C User Manual" project = "RTEMS C User Manual"
latex_documents = [ latex_documents = [('index',
('index', 'c-user.tex', u'RTEMS C User Documentation', u'RTEMS Documentation Project', 'manual'), 'c-user.tex',
] u'RTEMS C User Documentation',
u'RTEMS Documentation Project',
'manual')]

View File

@ -6,7 +6,7 @@ import datetime
def build_date(): def build_date():
now = datetime.date.today() now = datetime.date.today()
m = now.strftime('%b') m = now.strftime('%B')
y = now.strftime('%Y') y = now.strftime('%Y')
if now.day % 10 == 1: if now.day % 10 == 1:
s = 'st' s = 'st'
@ -51,10 +51,10 @@ copyright = u'2016, RTEMS Project (built %s)' % (build_date())
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '@VERSION@' #version = '@VERSION@'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '@RELEASE@' #release = '@RELEASE@'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View File

@ -56,12 +56,12 @@ function paintCatalogue(xml) {
else else
table += empty; table += empty;
if (pdf) if (pdf)
table += '<td><a href="' + '/' + pdf + '">' + table += '<td><a href="' + pdf + '">' +
'<img src="' + pdfIcon + '" width="20" height="20"></a></td>\n'; '<img src="' + pdfIcon + '" width="20" height="20"></a></td>\n';
else else
table += empty; table += empty;
if (singlehtml) if (singlehtml)
table += '<td><a href="' + '/' + singlehtml + '">' + table += '<td><a href="' + singlehtml + '">' +
'<img src="' + htmlIcon + '" width="20" height="20"></a></td>\n'; '<img src="' + htmlIcon + '" width="20" height="20"></a></td>\n';
else else
table += empty; table += empty;

View File

@ -5,6 +5,22 @@ import latex
sphinx_min_version = (1, 3) sphinx_min_version = (1, 3)
def build_date():
import datetime
now = datetime.date.today()
m = now.strftime('%B')
y = now.strftime('%Y')
if now.day % 10 == 1:
s = 'st'
elif now.day % 10 == 2:
s = 'nd'
elif now.day == 3:
s = 'rd'
else:
s = 'th'
d = '%2d%s' % (now.day, s)
return '%s %s %s' % (d, m, y)
def cmd_spell(ctx): def cmd_spell(ctx):
from waflib import Options from waflib import Options
from sys import argv from sys import argv
@ -88,6 +104,9 @@ def build_dir_setup(ctx, buildtype):
doctrees = os.path.join(os.path.dirname(output_dir), 'doctrees', buildtype) doctrees = os.path.join(os.path.dirname(output_dir), 'doctrees', buildtype)
return build_dir, output_node, output_dir, doctrees return build_dir, output_node, output_dir, doctrees
def version_cmdline(ctx):
return "-Drelease='%s' -Dversion='%s'" % (ctx.env.VERSION, ctx.env.VERSION)
def pdf_resources(ctx, buildtype): def pdf_resources(ctx, buildtype):
packages_base = ctx.path.parent.find_dir('common/latex') packages_base = ctx.path.parent.find_dir('common/latex')
if packages_base is None: if packages_base is None:
@ -135,6 +154,8 @@ def html_resources(ctx, buildtype):
def cmd_configure(ctx): def cmd_configure(ctx):
ctx.msg('Checking version', ctx.env.VERSION)
ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD", mandatory = True) ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD", mandatory = True)
ctx.find_program("aspell", var = "BIN_ASPELL", mandatory = False) ctx.find_program("aspell", var = "BIN_ASPELL", mandatory = False)
@ -180,8 +201,8 @@ def doc_pdf(ctx, source_dir, conf_dir):
buildtype = 'latex' buildtype = 'latex'
build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype) build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
pdf_resources(ctx, buildtype) pdf_resources(ctx, buildtype)
rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s -d %s %s %s" % \ rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \
(sphinx_verbose(ctx), buildtype, conf_dir, (sphinx_verbose(ctx), buildtype, conf_dir, version_cmdline(ctx),
doctrees, source_dir, output_dir) doctrees, source_dir, output_dir)
ctx( ctx(
rule = rule, rule = rule,
@ -232,8 +253,8 @@ def doc_singlehtml(ctx, source_dir, conf_dir):
buildtype = 'singlehtml' buildtype = 'singlehtml'
build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype) build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
html_resources(ctx, buildtype) html_resources(ctx, buildtype)
rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s -d %s %s %s" % \ rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \
(sphinx_verbose(ctx), buildtype, conf_dir, (sphinx_verbose(ctx), buildtype, conf_dir, version_cmdline(ctx),
doctrees, source_dir, output_dir) doctrees, source_dir, output_dir)
ctx( ctx(
rule = rule, rule = rule,
@ -254,8 +275,8 @@ def doc_html(ctx, conf_dir, source_dir):
buildtype = 'html' buildtype = 'html'
build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype) build_dir, output_node, output_dir, doctrees = build_dir_setup(ctx, buildtype)
html_resources(ctx, buildtype) html_resources(ctx, buildtype)
rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s -d %s %s %s" % \ rule = "${BIN_SPHINX_BUILD} %s -b %s -c %s %s -d %s %s %s" % \
(sphinx_verbose(ctx), buildtype, conf_dir, (sphinx_verbose(ctx), buildtype, conf_dir, version_cmdline(ctx),
doctrees, source_dir, output_dir) doctrees, source_dir, output_dir)
ctx( ctx(
rule = rule, rule = rule,
@ -313,7 +334,7 @@ def cmd_configure_path(ctx):
cmd_configure(ctx) cmd_configure(ctx)
def xml_catalogue(ctx, building, title): def xml_catalogue(ctx, building):
# #
# The following is a hack to find the top_dir because the task does # The following is a hack to find the top_dir because the task does
# provided a reference to top_dir like a build context. # provided a reference to top_dir like a build context.
@ -338,8 +359,8 @@ def xml_catalogue(ctx, building, title):
sys.path = sp[:] sys.path = sp[:]
catalogue[doc] = { catalogue[doc] = {
'title': bconf.project, 'title': bconf.project,
'version': bconf.version, 'version': str(ctx.env.VERSION),
'release': bconf.release, 'release': str(ctx.env.VERSION),
'pdf': bconf.latex_documents[0][1].replace('.tex', '.pdf'), 'pdf': bconf.latex_documents[0][1].replace('.tex', '.pdf'),
'html': '%s/index.html' % (doc), 'html': '%s/index.html' % (doc),
'singlehtml': '%s.html' % (doc) 'singlehtml': '%s.html' % (doc)
@ -350,11 +371,11 @@ def xml_catalogue(ctx, building, title):
cat = xml.Document() cat = xml.Document()
root = cat.createElement('rtems-docs') root = cat.createElement('rtems-docs')
root.setAttribute('date', 'today') root.setAttribute('date', build_date())
cat.appendChild(root) cat.appendChild(root)
heading = cat.createElement('catalogue') heading = cat.createElement('catalogue')
text = cat.createTextNode(title) text = cat.createTextNode(str(ctx.env.VERSION))
heading.appendChild(text) heading.appendChild(text)
root.appendChild(heading) root.appendChild(heading)

View File

@ -3,11 +3,10 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '1.0'
release = '4.11.0'
project = "RTEMS CPU Supplement Documentation" project = "RTEMS CPU Supplement Documentation"
latex_documents = [ latex_documents = [('index',
('index', 'cpu-supplement.tex', u'RTEMS CPU Supplement Documentation', u'RTEMS Documentation Project', 'manual'), 'cpu-supplement.tex',
] u'RTEMS CPU Supplement Documentation',
u'RTEMS Documentation Project',
'manual')]

View File

@ -3,9 +3,8 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '4.11.0' latex_documents = [('index',
release = '4.11.0' 'develenv.tex',
u'RTEMS Development Environment Documentation',
latex_documents = [ u'RTEMS Documentation Project',
('index', 'develenv.tex', u'RTEMS Development Environment Documentation', u'RTEMS Documentation Project', 'manual'), 'manual')]
]

View File

@ -3,11 +3,10 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '4.11.0'
release = '4.11.0'
project = "RTEMS Eclipse Manual" project = "RTEMS Eclipse Manual"
latex_documents = [ latex_documents = [('index',
('index', 'eclipse.tex', u'RTEMS Eclipse Manual', u'RTEMS Documentation Project', 'manual'), 'eclipse.tex',
] u'RTEMS Eclipse Manual',
u'RTEMS Documentation Project',
'manual')]

View File

@ -3,11 +3,10 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '4.11.0'
release = '4.11.0'
project = "RTEMS Filesystem Design Guide" project = "RTEMS Filesystem Design Guide"
latex_documents = [ latex_documents = [('index',
('index', 'filesystem.tex', u'RTEMS Filesystem Design Guide', u'RTEMS Filesystem Design Guide', 'manual'), 'filesystem.tex',
] u'RTEMS Filesystem Design Guide',
u'RTEMS Filesystem Design Guide',
'manual')]

View File

@ -3,11 +3,10 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '4.11.0'
release = '4.11.0'
project = "RTEMS Networking User Manual" project = "RTEMS Networking User Manual"
latex_documents = [ latex_documents = [('index',
('index', 'networking.tex', u'RTEMS Networking User Documentation', u'RTEMS Documentation Project', 'manual'), 'networking.tex',
] u'RTEMS Networking User Documentation',
u'RTEMS Documentation Project',
'manual')]

View File

@ -3,10 +3,8 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '1.0' latex_documents = [('index',
release = '5.0' 'porting.tex',
u'RTEMS Porting Documentation',
latex_documents = [ u'RTEMS Documentation Project',
('index', 'porting.tex', u'RTEMS Porting Documentation', u'RTEMS Documentation Project', 'manual'), 'manual')]
]

View File

@ -3,11 +3,10 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '4.11.0'
release = '4.11.0'
project = "RTEMS POSIX User Manual" project = "RTEMS POSIX User Manual"
latex_documents = [ latex_documents = [('index',
('index', 'posix-users.tex', u'RTEMS POSIX API User\'s Guide', u'RTEMS Documentation Project', 'manual'), 'posix-users.tex',
] u'RTEMS POSIX API User\'s Guide',
u'RTEMS Documentation Project',
'manual')]

View File

@ -3,9 +3,8 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '1.0' latex_documents = [('index',
release = '5.0' 'posix1003-1.tex',
u'RTEMS POSIX 1003_1 Documentation',
latex_documents = [ u'RTEMS Documentation Project',
('index', 'posix1003-1.tex', u'RTEMS POSIX 1003_1 Documentation', u'RTEMS Documentation Project', 'manual'), 'manual')]
]

View File

@ -3,11 +3,10 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '4.11.0'
release = '4.11.0'
project = "RTEMS Source Builder Manual" project = "RTEMS Source Builder Manual"
latex_documents = [ latex_documents = [('index',
('index', 'rsb.tex', u'RTEMS Source Builder', u'RTEMS Documentation Project', 'manual'), 'rsb.tex',
] u'RTEMS Source Builder',
u'RTEMS Documentation Project',
'manual')]

View File

@ -3,10 +3,8 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '1.0' latex_documents = [('index',
release = '5.0' 'rtemsconfig.tex',
u'RTEMS RTEMS Config Documentation',
latex_documents = [ u'RTEMS Documentation Project',
('index', 'rtemsconfig.tex', u'RTEMS RTEMS Config Documentation', u'RTEMS Documentation Project', 'manual'), 'manual')]
]

View File

@ -3,11 +3,10 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '4.11.0'
release = '4.11.0'
project = "RTEMS Shell Manual" project = "RTEMS Shell Manual"
latex_documents = [ latex_documents = [('index',
('index', 'shell.tex', u'RTEMS Shell Documentation', u'RTEMS Documentation Project', 'manual'), 'shell.tex',
] u'RTEMS Shell Documentation',
u'RTEMS Documentation Project',
'manual')]

View File

@ -3,9 +3,6 @@ sys.path.append(os.path.abspath('../common/'))
from conf import * from conf import *
version = '4.11.0'
release = '4.11.0'
project = "RTEMS User Manual" project = "RTEMS User Manual"
exclude_patterns = ['config/build.rst', exclude_patterns = ['config/build.rst',
@ -39,6 +36,8 @@ exclude_patterns = ['config/build.rst',
'waf/index.rst'] 'waf/index.rst']
latex_documents = [ latex_documents = [('index',
('index', 'user.tex', u'RTEMS User Manual', u'RTEMS Documentation Project', 'manual'), 'user.tex',
] u'RTEMS User Manual',
u'RTEMS Documentation Project',
'manual')]

View File

@ -9,7 +9,7 @@ path.append(abspath('common'))
import waflib import waflib
import waf as docs_waf import waf as docs_waf
version = '4.11 (4.11.2)' version = '4.11 (branch)'
build_all = ['user', build_all = ['user',
'rsb', 'rsb',
@ -29,12 +29,13 @@ def options(opt):
docs_waf.cmd_options(opt) docs_waf.cmd_options(opt)
def configure(conf): def configure(conf):
conf.env.VERSION = version
for b in building: for b in building:
conf.recurse(b) conf.recurse(b)
conf.env['BUILD_FROM_TOP'] = 'yes' conf.env['BUILD_FROM_TOP'] = 'yes'
def catalogue(ctx): def catalogue(ctx):
docs_waf.xml_catalogue(ctx, building, version) docs_waf.xml_catalogue(ctx, building)
def coverpage_js(ctx): def coverpage_js(ctx):
js = None js = None