waf: Use the release date in the coverpage

This commit is contained in:
Chris Johns 2019-02-13 10:57:10 +11:00
parent d721375610
commit 7b36a6b60d
2 changed files with 18 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<head> <head>
<title>RTEMS - Documentation</title> <title>RTEMS - Documentation</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="created" content="11th Jan 2017 15:32" /> <meta name="created" content="@VER_DATE@" />
<meta name="description" content="" /> <meta name="description" content="" />
<meta name="keywords" content="" /> <meta name="keywords" content="" />
<meta charset="utf-8"> <meta charset="utf-8">
@ -60,7 +60,7 @@
<hr> <hr>
<footer class="footer text-center"> <footer class="footer text-center">
<div class="container"> <div class="container">
Copyright 2017 RTEMS Project &copy; Copyright 1988, @COPYRIGHT_YEAR@ RTEMS Project and contributors.
</div> </div>
</footer> </footer>
<!-- footer-bottom --> <!-- footer-bottom -->

18
wscript
View File

@ -66,6 +66,17 @@ def coverpage_js(ctx):
with open(ctx.outputs[0].abspath(), 'w') as o: with open(ctx.outputs[0].abspath(), 'w') as o:
o.write(js.replace('@CATALOGUE', xml)) o.write(js.replace('@CATALOGUE', xml))
def index_html(ctx):
html = ''
year = ctx.env.DATE.split()[2]
for f in ctx.inputs:
if f.abspath().endswith('.html'):
with open(f.abspath()) as i:
html += i.read()
with open(ctx.outputs[0].abspath(), 'w') as o:
html = html.replace('@COPYRIGHT_YEAR@', year)
html = html.replace('@VER_DATE@', ctx.env.DATE)
o.write(html)
def build(ctx): def build(ctx):
# #
@ -88,7 +99,7 @@ def build(ctx):
ctx.recurse(b) ctx.recurse(b)
# #
# Build the catalogue, coverpage.js and install. # Build the catalogue, coverpage.js, index.html and install.
# #
ctx(rule = catalogue, ctx(rule = catalogue,
target = 'catalogue.xml', target = 'catalogue.xml',
@ -98,10 +109,13 @@ def build(ctx):
target = 'coverpage.js', target = 'coverpage.js',
source = ['wscript', 'catalogue.xml', 'common/coverpage/coverpage.js']) source = ['wscript', 'catalogue.xml', 'common/coverpage/coverpage.js'])
ctx.install_as('${PREFIX}/coverpage.js', 'coverpage.js') ctx.install_as('${PREFIX}/coverpage.js', 'coverpage.js')
ctx(rule = index_html,
target = 'coverpage.html',
source = ['wscript', 'common/coverpage/coverpage.html'])
ctx.install_as('${PREFIX}/index.html', 'coverpage.html')
# #
# Install the static content. # Install the static content.
# #
ctx.install_as('${PREFIX}/index.html', 'common/coverpage/coverpage.html')
static_dir = ctx.path.find_dir('common/coverpage/static') static_dir = ctx.path.find_dir('common/coverpage/static')
ctx.install_files('${PREFIX}/static', ctx.install_files('${PREFIX}/static',
static_dir.ant_glob('**'), static_dir.ant_glob('**'),