-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
wscript
49 lines (36 loc) · 1.4 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from waflib import Task
from waflib.TaskGen import extension
@extension('.adoc')
def run_asciidoc(self, node):
out = node.change_ext(".html")
if 'white-papers' in node.abspath():
tsk = self.create_task("asciidoc_simple", node, [out])
else:
tsk = self.create_task("asciidoc", node, [out])
tsk.cwd = node.parent.get_bld().abspath()
class asciidoc(Task.Task):
color = "BLUE"
run_str = '${BIN_ASCIIDOC} -b html5 -a linkcss -o ${TGT[0].name} ${SRC[0].abspath()}'
ext_out = ".html"
class asciidoc_simple(Task.Task):
color = "BLUE"
run_str = '${BIN_ASCIIDOC} -o ${TGT[0].name} ${SRC[0].abspath()}'
ext_out = ".html"
def configure(ctx):
ctx.find_program("asciidoc", var="BIN_ASCIIDOC", mandatory=True)
def build(ctx):
www_source = ctx.path.ant_glob("**/*.adoc")
img_source = [x.name for x in ctx.path.ant_glob('**/*.png')] + ["asciidoc.js", "asciidoc.css", "favicon.ico"] \
+ [x.relpath() for x in ctx.path.find_node('white-papers').ant_glob('**', excl=['**/*.adoc', '**/TODO'])]
ctx(
target="www",
source=www_source,
)
# Copy static data so pages can be viewed in build/
ctx(
features="subst",
is_copy=True,
source=img_source,
target=img_source,
)
ctx.install_files(ctx.env.PREFIX, img_source + [x.change_ext(".html") for x in www_source], cwd=ctx.bldnode, relative_trick=True)