-
Notifications
You must be signed in to change notification settings - Fork 15
/
B0.ml
66 lines (54 loc) · 2.15 KB
/
B0.ml
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
63
64
65
66
open B0_kit.V000
(* OCaml library names *)
let react = B0_ocaml.libname "react"
let react_top = B0_ocaml.libname "react.top"
let unix = B0_ocaml.libname "unix"
let compiler_libs_toplevel = B0_ocaml.libname "compiler-libs.toplevel"
(* Libraries *)
let react_lib =
let srcs = Fpath.[ `File (v "src/react.mli"); `File (v "src/react.ml") ] in
let requires = [] in
B0_ocaml.lib react ~doc:"The react library" ~srcs ~requires
let react_top_lib =
let srcs = Fpath.[ `File (v "src/react_top.ml") ] in
let requires = [compiler_libs_toplevel] in
let doc = "The react toplevel support library" in
B0_ocaml.lib react_top ~doc ~srcs ~requires
(* Tests *)
let test_exe ?(requires = []) src ~doc =
let src = Fpath.v src in
let srcs = Fpath.[`File src] in
let meta = B0_meta.(empty |> tag test) in
let requires = react :: requires in
B0_ocaml.exe (Fpath.basename ~strip_ext:true src) ~srcs ~doc ~meta ~requires
let test = test_exe "test/test.ml" ~doc:"Test suite"
let clock =
test_exe "test/clock.ml" ~doc:"Reactive clock example" ~requires:[unix]
let breakout =
test_exe "test/breakout.ml" ~doc:"Breakout game example" ~requires:[unix]
(* Packs *)
let default =
let meta =
B0_meta.empty
|> B0_meta.(add authors) ["The react programmers"]
|> B0_meta.(add maintainers)
["Daniel Bünzli <daniel.buenzl [email protected]>"]
|> B0_meta.(add homepage) "https://erratique.ch/software/react"
|> B0_meta.(add online_doc) "https://erratique.ch/software/react/doc/"
|> B0_meta.(add licenses) ["ISC"]
|> B0_meta.(add repo) "git+https://erratique.ch/repos/react.git"
|> B0_meta.(add issues) "https://github.com/dbuenzli/react/issues"
|> B0_meta.(add description_tags)
["reactive"; "declarative"; "signal"; "event"; "frp"; "org:erratique"]
|> B0_meta.tag B0_opam.tag
|> B0_meta.add B0_opam.depends
[ "ocaml", {|>= "4.08.0"|};
"ocamlfind", {|build|};
"ocamlbuild", {|build|};
"topkg", {|build & >= "1.0.3"|};
]
|> B0_meta.add B0_opam.build
{|[["ocaml" "pkg/pkg.ml" "build" "--dev-pkg" "%{dev}%"]]|}
in
B0_pack.make "default" ~doc:"react package" ~meta ~locked:true @@
B0_unit.list ()