-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathB0.ml
58 lines (48 loc) · 1.82 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
open B0_kit.V000
open Result.Syntax
(* OCaml library names *)
let compiler_libs_toplevel = B0_ocaml.libname "compiler-libs.toplevel"
let rresult = B0_ocaml.libname "rresult"
let rresult_top = B0_ocaml.libname "rresult.top"
(* Libraries *)
let result_lib =
let srcs =
Fpath.[ `File (v "src/rresult.mli"); `File (v "src/rresult.ml"); ]
in
let requires = [] in
B0_ocaml.lib rresult ~doc:"The rresult library" ~srcs ~requires
let rresult_top =
let srcs = Fpath.[ `File (v "src/rresult_top.ml") ] in
let requires = [compiler_libs_toplevel] in
B0_ocaml.lib rresult_top ~doc:"The rresult.top library" ~srcs ~requires
(* Tests *)
let test =
let srcs = Fpath.[`File (v "test/test.ml")] in
let meta = B0_meta.(empty |> tag test) in
let requires = [ rresult ] in
B0_ocaml.exe "test" ~doc:"Test suite" ~srcs ~meta ~requires
(* Packs *)
let default =
let meta =
B0_meta.empty
|> B0_meta.(add authors) ["The rresult programmers"]
|> B0_meta.(add maintainers)
["Daniel Bünzli <daniel.buenzl [email protected]>"]
|> B0_meta.(add homepage) "https://erratique.ch/software/rresult"
|> B0_meta.(add online_doc)
"https://erratique.ch/software/rresult/doc/Rresult"
|> B0_meta.(add licenses) ["ISC"]
|> B0_meta.(add repo) "git+https://erratique.ch/repos/rresult.git"
|> B0_meta.(add issues) "https://github.com/dbuenzli/rresult/issues"
|> B0_meta.(add description_tags) ["result"; "error"; "org:erratique"]
|> B0_meta.tag B0_opam.tag
|> B0_meta.add B0_opam.build
{|[["ocaml" "pkg/pkg.ml" "build" "--dev-pkg" "%{dev}%"]]|}
|> B0_meta.add B0_opam.depends
[ "ocaml", {|>= "4.08.0"|};
"ocamlfind", {|build|};
"ocamlbuild", {|build|};
"topkg", {|build & >= "1.0.3"|} ]
in
B0_pack.make "default" ~doc:"rresult package" ~meta ~locked:true @@
B0_unit.list ()