summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2019-02-13 10:57:10 +1100
committerChris Johns <chrisj@rtems.org>2019-02-14 07:47:30 +1100
commit7b36a6b60d553b34bdca5b95a34b0192bd6cac50 (patch)
tree6cb94144becaaf873e151cc94dcb9466fbcfb562 /wscript
parentd721375610a5d511515cb7bf165d7fa8c7dd32c8 (diff)
downloadrtems-docs-7b36a6b60d553b34bdca5b95a34b0192bd6cac50.tar.bz2
waf: Use the release date in the coverpage
Diffstat (limited to 'wscript')
-rw-r--r--wscript18
1 files changed, 16 insertions, 2 deletions
diff --git a/wscript b/wscript
index 06ac034..5244417 100644
--- a/wscript
+++ b/wscript
@@ -66,6 +66,17 @@ def coverpage_js(ctx):
with open(ctx.outputs[0].abspath(), 'w') as o:
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):
#
@@ -88,7 +99,7 @@ def build(ctx):
ctx.recurse(b)
#
- # Build the catalogue, coverpage.js and install.
+ # Build the catalogue, coverpage.js, index.html and install.
#
ctx(rule = catalogue,
target = 'catalogue.xml',
@@ -98,10 +109,13 @@ def build(ctx):
target = 'coverpage.js',
source = ['wscript', 'catalogue.xml', 'common/coverpage/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.
#
- ctx.install_as('${PREFIX}/index.html', 'common/coverpage/coverpage.html')
static_dir = ctx.path.find_dir('common/coverpage/static')
ctx.install_files('${PREFIX}/static',
static_dir.ant_glob('**'),