-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdune
55 lines (50 loc) · 1.49 KB
/
dune
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
50
51
52
53
54
55
(executable
(name fablejs)
(modules fablejs)
(libraries brr fabula)
(modes js))
(rule
(deps story.html)
(action
(with-stdout-to embedded.ml
(progn
(echo "let index title extra = Format.asprintf {|")
; (cat story.html)
(run sed s@_build/default/[email protected]@ story.html)
(echo "|} title extra\n")
(echo "let default_css = {|")
(cat default.css)
(echo "|}")
(echo "let runtime = {|")
(cat fablejs.bc.js)
(echo "|}")
(echo "let interpret = {|")
(cat interpret.js)
(echo "|}")
(echo "let test = {|")
(cat test/runtime.t/test.js)
(echo "|}")))))
(executable
(name fable)
(public_name fable)
(modules fable embedded)
(libraries fabula)
(preprocess (pps ppx_deriving_yojson ppx_deriving.std)))
(env (dev (flags (:standard -warn-error -A))))
(subdir deploy
(rule
(alias editor)
(deps ../story.html (glob_files ../examples/*.md)
../editor/examples.sh ../editor/editor.html)
(action (progn
(copy ../fablejs.bc.js fablejs.bc.js)
(copy ../editor/editor.js editor.js)
; (copy ../editor/editor.html index.html)
(with-stdout-to index.html
(run ../editor/examples.sh ../editor/editor.html))
; (copy ../story.html story.html)
(with-stdout-to story.html
(run sed -e s/%s// -e s@_build/default/[email protected]@ ../story.html))
(write-file story.js "var story = [];")
(copy ../interpret.js interpret.js)
(copy ../default.css default.css)))))