-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdune
62 lines (54 loc) · 1.31 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
56
57
58
59
60
61
62
(library
(public_name acutis)
(modules acutis)
(libraries acutis.internals))
(executable
(name acutis_cli)
(public_name acutis)
(modules acutis_cli)
(package acutis)
(libraries acutis yojson dune-build-info))
(executable
(name acutis_js)
(modules acutis_js)
(modes js)
(libraries acutis)
(js_of_ocaml
(flags
(--enable effects)
(--disable excwrap))
; excwrap breaks the Eleventy plugin.
; Dune's dev profile needs this flag in build_runtime_flags.
(build_runtime_flags
(--disable excwrap)))
(preprocess
(pps js_of_ocaml-ppx)))
(rule
(copy %{dep:acutis_js.bc.js} main.cjs))
(executable
(name package_json)
(modules package_json))
; We pass all of the file names as arguments so Dune can track dependencies and
; so other source files don't need to hard-code them.
(rule
(deps README.md LICENSE)
(action
(with-stdout-to
package.json
(run
%{dep:package_json.exe}
--version
%{version:acutis}
--export
"./eleventy"
./%{dep:eleventy.js}
--export
"."
./%{dep:main.cjs}
--import
"#main"
./%{dep:main.cjs}))))
; Our docs folder contains symlinks to our Dune build folder, but otherwise uses
; a completely different build system. It's easier to just manage it separately.
; We need to exclude it so as not to confuse Dune.
(dirs :standard \ docs)