summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-01-11 17:04:02 +1100
committerChris Johns <chrisj@rtems.org>2017-01-11 17:04:02 +1100
commit2591ca639056db4f6abe294cc7a81bb831c8f7f9 (patch)
tree30ba1d0a11d4e097fe5750e2024630bdfbea8036 /wscript
parentecf82d1b3d3a825f0340fd12f0bbe49a5139c31e (diff)
downloadrtems-docs-2591ca639056db4f6abe294cc7a81bb831c8f7f9.tar.bz2
html: Embed the catalogue XML in JS.
The is to work around a security issue with Chrome on Windows. This patches let the cover page load on Chrome and Edge on Windows 10.
Diffstat (limited to 'wscript')
-rw-r--r--wscript27
1 files changed, 24 insertions, 3 deletions
diff --git a/wscript b/wscript
index 96a8574..955e68f 100644
--- a/wscript
+++ b/wscript
@@ -9,7 +9,7 @@ path.append(abspath('common'))
import waflib
import waf as docs_waf
-version = '4.11 (4.11.2)'
+version = 'Master (4.11.99)'
build_all = ['user',
'rsb',
@@ -36,18 +36,39 @@ def configure(conf):
def catalogue(ctx):
docs_waf.xml_catalogue(ctx, building, version)
+def coverpage_js(ctx):
+ js = None
+ xml = None
+ for f in ctx.inputs:
+ if f.abspath().endswith('.js'):
+ with open(f.abspath()) as i:
+ js = i.read()
+ elif f.abspath().endswith('.xml'):
+ with open(f.abspath()) as i:
+ xml = i.read()
+ xml = xml.replace('\n', ' \\\n');
+ with open(ctx.outputs[0].abspath(), 'w') as o:
+ o.write(js.replace('@CATALOGUE', xml))
+
def build(ctx):
for b in building:
ctx.recurse(b)
#
- # Build the catalogue and install with the coverpage and static content.
+ # Build the catalogue, coverpage.js and install.
#
ctx(rule = catalogue,
target = 'catalogue.xml',
source = ['wscript', 'common/waf.py'])
ctx.install_files('${PREFIX}', 'catalogue.xml')
- ctx.install_files('${PREFIX}', 'common/html-coverpage/index.html')
+ ctx(rule = coverpage_js,
+ target = 'coverpage.js',
+ source = ['wscript', 'catalogue.xml', 'common/html-coverpage/coverpage.js'])
+ ctx.install_as('${PREFIX}/coverpage.js', 'coverpage.js')
+ #
+ # Install the static content.
+ #
+ ctx.install_as('${PREFIX}/index.html', 'common/html-coverpage/coverpage.html')
static_dir = ctx.path.find_dir('common/html-coverpage/static')
ctx.install_files('${PREFIX}/static',
static_dir.ant_glob('**'),