Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
version=0.28.1
version=0.29.0
parse-docstrings = false
wrap-comments = false
break-cases = fit
break-collection-expressions = fit-or-vertical
break-fun-decl = wrap
break-fun-sig = wrap
break-infix = wrap
break-infix-before-func = false
break-sequences = false
break-separators = before
break-string-literals = never
break-struct = force
cases-matching-exp-indent = compact
doc-comments = after-when-possible
dock-collection-brackets = false
indicate-multiline-delimiters = no
infix-precedence = indent
let-and = compact
let-binding-spacing = compact
module-item-spacing = compact
parens-tuple = multi-line-only
parens-tuple-patterns = multi-line-only
sequence-style = terminator
sequence-blank-line = compact
single-case = compact
type-decl = compact
if-then-else = keyword-first
field-space = loose
space-around-arrays = false
space-around-records = false
space-around-lists = false
space-around-variants = false
ocp-indent-compat = true
function-indent-nested = always
indicate-multiline-delimiters = closing-on-separate-line
26 changes: 18 additions & 8 deletions build/build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module Intern = struct
Some
(function
| `Client -> "src/ppx/ppx_eliom_client_ex." ^ best
| `Server -> "src/ppx/ppx_eliom_server_ex." ^ best)
| `Server -> "src/ppx/ppx_eliom_server_ex." ^ best
)

let with_package = function
| "eliom.ppx.type" -> "pkg_ppx_eliom_types"
Expand All @@ -35,8 +36,8 @@ let _ =
Doc.init ();
let link source dest =
rule (Printf.sprintf "%s -> %s" source dest) ~dep:source ~prod:dest
(fun env _ ->
Cmd (S [A "ln"; A "-f"; P (env source); P (env dest)]))
(fun env _ -> Cmd (S [A "ln"; A "-f"; P (env source); P (env dest)])
)
in
(* add I pflag *)
pflag ["ocaml"; "compile"] "I" (fun x -> S [A "-I"; A x]);
Expand All @@ -51,26 +52,34 @@ let _ =
["ocaml"; "compile"; "pkg_" ^ name]
(S
[ A "-ppx"
; Quote (S [P (path ^ name ^ "_ex." ^ best); A "-as-ppx"]) ]);
; Quote (S [P (path ^ name ^ "_ex." ^ best); A "-as-ppx"])
]
);
flag
["ocaml"; "ocamldep"; "pkg_" ^ name]
(S
[ A "-ppx"
; Quote (S [P (path ^ name ^ "_ex." ^ best); A "-as-ppx"]) ]);
; Quote (S [P (path ^ name ^ "_ex." ^ best); A "-as-ppx"])
]
);
dep ["ocaml"; "ocamldep"; "pkg_" ^ name] [path ^ name ^ "_ex." ^ best];
flag_and_dep
["ocaml"; "infer_interface"; "pkg_" ^ name]
(S
[ A "-ppx"
; Quote (S [P (path ^ name ^ "_ex." ^ best); A "-as-ppx"]) ]);
; Quote (S [P (path ^ name ^ "_ex." ^ best); A "-as-ppx"])
]
);
dep
["ocaml"; "infer_interface"; "pkg_" ^ name]
[path ^ name ^ "_ex." ^ best];
flag_and_dep
["doc"; "pkg_" ^ name]
(S
[ A "-ppx"
; Quote (S [P (path ^ name ^ "_ex." ^ best); A "-as-ppx"]) ]);
; Quote (S [P (path ^ name ^ "_ex." ^ best); A "-as-ppx"])
]
);
dep ["doc"; "pkg_" ^ name] [path ^ name ^ "_ex." ^ best]
in
add_syntax "ppx_eliom_utils" "src/ppx/";
Expand All @@ -86,7 +95,8 @@ let _ =
in
List.iter (link_exec "eliomc") ["eliomopt"; "eliomcp"; "js_of_eliom"];
link_exec "distillery" "eliom-distillery"
| _ -> ())
| _ -> ()
)

let _ =
Options.make_links := false;
Expand Down
15 changes: 10 additions & 5 deletions build/doc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ let init_wikidoc () =
~stamp:"%.wikidocdir/wiki.stamp" ~dep:"%.odocl"
(Ocamlbuild_pack.Ocaml_tools.document_ocaml_project
~ocamldoc:ocamldoc_wiki "%.odocl" "%.wikidocdir/index.wiki"
"%.wikidocdir");
"%.wikidocdir"
);
flag ["wikidoc"]
& S [A "-colorize-code"; A "-i"; A wikidoc_dir; A "-g"; A "odoc_wiki.cma"];
pflag ["wikidoc"] "subproject" (fun sub ->
S [A "-passopt"; A "-subproject"; A sub])
S [A "-passopt"; A "-subproject"; A sub]
)
with Failure e -> ()
(* Silently fail if the package wikidoc isn't available *)

Expand All @@ -46,12 +48,15 @@ let init_mandoc () =
~prod:"%.mandocdir/man.%(ext)" ~stamp:"%.mandocdir/man.%(ext).stamp"
~dep:"%.odocl"
(Ocamlbuild_pack.Ocaml_tools.document_ocaml_project ~ocamldoc:ocamldoc_man
"%.odocl" "%.mandocdir/man.%(ext)" "%.mandocdir");
"%.odocl" "%.mandocdir/man.%(ext)" "%.mandocdir"
);
pflag ["apiref"] "man_ext" (fun ext ->
S [A "-man-mini"; A "-man-section"; A ext; A "-man-suffix"; A ext])
S [A "-man-mini"; A "-man-section"; A ext; A "-man-suffix"; A ext]
)

let init () =
init_wikidoc ();
init_mandoc ();
(* ocamldoc intro *)
pflag_and_dep ["doc"] "with_intro" (fun f -> S [A "-intro"; P f])
pflag_and_dep ["doc"] "with_intro" (fun f -> S [A "-intro"; P f]
)
30 changes: 19 additions & 11 deletions pkg/build.ml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ let () =
"src/ppx/ppx_eliom_server"
; Pkg.bin ~auto:true ~dst:"ppx_eliom_client" "src/ppx/ppx_eliom_client_ex"
; Pkg.bin ~auto:true ~dst:"ppx_eliom_server" "src/ppx/ppx_eliom_server_ex"
; Pkg.bin ~auto:true ~dst:"ppx_eliom_types" "src/ppx/ppx_eliom_types_ex" ]
; Pkg.bin ~auto:true ~dst:"ppx_eliom_types" "src/ppx/ppx_eliom_types_ex"
]
(* CLIENT LIBS *)
@ Pkg.lib ~dst:"client/client" ~exts:[".cma"] "src/lib/client/client"
:: Pkg.lib ~dst:"client/eliom_client_main.cmo"
Expand All @@ -102,7 +103,8 @@ let () =
:: Pkg.stublibs "src/lib/client/dlleliom_stubs.so"
:: List.map
(fun x ->
Pkg.lib ~dst:(spf "client/%s" x) (spf "src/lib/client/%s" x))
Pkg.lib ~dst:(spf "client/%s" x) (spf "src/lib/client/%s" x)
)
client_extra
(* SERVER LIBS *)
@ Pkg.lib ~dst:"server/monitor/eliom_monitor" ~exts:Exts.module_library
Expand All @@ -112,19 +114,25 @@ let () =
:: Pkg.lib ~dst:"server/server" ~exts:exts_lib "src/lib/server/server"
:: List.map
(fun x ->
Pkg.lib ~dst:(spf "server/%s" x) (spf "src/lib/server/%s" x))
Pkg.lib ~dst:(spf "server/%s" x) (spf "src/lib/server/%s" x)
)
server_extra
@ [ (* MISC *)
Pkg.doc "README.md"
; Pkg.doc "CHANGES"
; Pkg.etc "pkg/etc/mime.types" ]
; Pkg.etc "pkg/etc/mime.types"
]
@ List.flatten
(List.map
(fun (name, files) ->
List.map
(fun file ->
Pkg.lib
~dst:(spf "templates/%s/%s" name file)
(spf "%s/%s/%s" templates_dir name file))
files)
templates_files))
List.map
(fun file ->
Pkg.lib
~dst:(spf "templates/%s/%s" name file)
(spf "%s/%s/%s" templates_dir name file)
)
files
)
templates_files
)
)
26 changes: 18 additions & 8 deletions pkg/filelist.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ let server =
; "eliom_parameter_sigs"
; "eliom_registration_sigs"
; "eliom_service_sigs"
; "eliom_shared_sigs" ]
; "eliom_shared_sigs"
]
; interface =
[ "eliom_bus"
; "eliom_client_value"
Expand All @@ -34,7 +35,8 @@ let server =
; "eliom_tools"
; "eliom_types"
; "eliom_uri"
; "eliom_wrap" ]
; "eliom_wrap"
]
; internal =
[ "eliom_comet_base"
; "eliom_common_base"
Expand Down Expand Up @@ -66,7 +68,9 @@ let server =
; "eliommod_sessadmin"
; "eliommod_sessexpl"
; "eliommod_sessiongroups"
; "eliommod_timeouts" ] }
; "eliommod_timeouts"
]
}

let client =
{ interface_only =
Expand All @@ -75,7 +79,8 @@ let client =
; "eliom_parameter_sigs"
; "eliom_registration_sigs"
; "eliom_service_sigs"
; "eliom_shared_sigs" ]
; "eliom_shared_sigs"
]
; interface =
[ "eliom_bus"
; "eliom_client_value"
Expand All @@ -96,7 +101,8 @@ let client =
; "eliom_tools"
; "eliom_types"
; "eliom_unwrap"
; "eliom_uri" ]
; "eliom_uri"
]
; internal =
[ "eliom_comet_base"
; "eliom_common"
Expand All @@ -117,12 +123,15 @@ let client =
; "eliom_types_base"
; "eliommod_cookies"
; "eliommod_dom"
; "eliommod_parameters" ] }
; "eliommod_parameters"
]
}

let server_ext =
{ interface_only = []
; interface = ["atom_feed"; "eliom_atom"; "eliom_openid"; "eliom_s2s"]
; internal = [] }
; internal = []
}

let ocamlbuild =
{interface_only = []; interface = ["ocamlbuild_eliom"]; internal = []}
Expand All @@ -131,7 +140,8 @@ let ppx =
{ interface_only = []
; interface =
["ppx_eliom"; "ppx_eliom_client"; "ppx_eliom_type"; "ppx_eliom_server"]
; internal = ["ppx_eliom_utils"] }
; internal = ["ppx_eliom_utils"]
}

let ( -.- ) name ext = name ^ "." ^ ext

Expand Down
17 changes: 10 additions & 7 deletions pkg/topkg.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module type Pkg = sig
(** The type for install moves. *)

type field =
?cond:bool
?cond:bool
-> ?exts:string list
-> ?dst:string
-> ?target:string
Expand Down Expand Up @@ -128,7 +128,8 @@ end = struct
ignore (List.assoc key acc);
err_mdef key
with Not_found -> parse_env ((key, bool) :: acc) args
with Invalid_argument _ | Not_found | Exit -> err_parse arg)
with Invalid_argument _ | Not_found | Exit -> err_parse arg
)
| [] -> acc
in
match List.tl (Array.to_list Sys.argv) with
Expand Down Expand Up @@ -174,7 +175,7 @@ module Pkg : Pkg = struct
type moves = move list

type field =
?cond:bool
?cond:bool
-> ?exts:string list
-> ?dst:string
-> ?target:string
Expand Down Expand Up @@ -235,8 +236,9 @@ module Pkg : Pkg = struct
let l = List.filter (fun f -> has_suffix f s_suffix) l in
List.map
(fun s ->
( str "%s/%s%s" bdir s_path s
, str "%s%s%s" d_path (Filename.chop_suffix s s_suffix) d_suffix ))
( str "%s/%s%s" bdir s_path s
, str "%s%s%s" d_path (Filename.chop_suffix s s_suffix) d_suffix )
)
l

let build_install bdir mvs =
Expand All @@ -251,8 +253,9 @@ module Pkg : Pkg = struct
in
List.iter
(fun (src, dst) ->
Buffer.add_string install
(str "\n \"%s%s\" {\"%s\"}" option src dst))
Buffer.add_string install
(str "\n \"%s%s\" {\"%s\"}" option src dst)
)
(list_files bdir src dst);
add_mvs current mvs
| {field_name = field} :: _ as mvs ->
Expand Down
Loading
Loading