From b264bf98e9e96354f19e6623ce4135367c362e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Fri, 20 Sep 2024 15:45:45 +0200 Subject: [PATCH] Format fixes (try to make the CI happy) --- pkg/distillery/dune | 11 +- pkg/topkg.ml | 234 +++++++++++++++++++------------- src/lib/client/dune | 66 +++++---- src/lib/eliom_common.server.mli | 2 + src/lib/eliom_lib.client.ml | 32 ++--- src/lib/eliom_lib.client.mli | 40 +++--- src/lib/server/dune | 59 ++++---- src/lib/server/monitor/dune | 26 ++-- src/ocamlbuild/dune | 10 +- src/ppx/dune | 97 +++++++------ src/tools/dune | 12 +- 11 files changed, 340 insertions(+), 249 deletions(-) diff --git a/pkg/distillery/dune b/pkg/distillery/dune index 0095f00401..29d860ac88 100644 --- a/pkg/distillery/dune +++ b/pkg/distillery/dune @@ -1,7 +1,8 @@ (data_only_dirs templates) + (install - (section lib) - (files - (glob_files templates/app.exe/**) - (glob_files templates/app.lib/**) - (glob_files templates/basic.ppx/**))) + (section lib) + (files + (glob_files templates/app.exe/**) + (glob_files templates/app.lib/**) + (glob_files templates/basic.ppx/**))) diff --git a/pkg/topkg.ml b/pkg/topkg.ml index eb71337e36..4c981db976 100644 --- a/pkg/topkg.ml +++ b/pkg/topkg.ml @@ -36,7 +36,7 @@ end (** Package description. *) module type Pkg = sig - type builder = [ `OCamlbuild | `Other of string * string ] + type builder = [`OCamlbuild | `Other of string * string] (** The type for build tools. Either [`OCamlbuild] or an [`Other (tool, bdir)] tool [tool] that generates its build artefacts in [bdir]. *) @@ -44,7 +44,13 @@ module type Pkg = sig type moves (** The type for install moves. *) - type field = ?cond:bool -> ?exts:string list -> ?dst:string -> ?target:string -> string -> moves + type field = + ?cond:bool + -> ?exts:string list + -> ?dst:string + -> ?target:string + -> string + -> moves (** The type for field install functions. A call [field cond exts dst path] generates install moves as follows: {ul @@ -56,12 +62,15 @@ module type Pkg = sig [Filename.basename path].} *) val lib : field + val bin : ?auto:bool -> field (** If [auto] is true (defaults to false) generates [path ^ ".native"] if {!Env.native} is [true] and [path ^ ".byte"] if {!Env.native} is [false]. *) - val sbin : ?auto:bool -> field (** See {!bin}. *) + val sbin : ?auto:bool -> field + (** See {!bin}. *) + val toplevel : field val share : field val share_root : field @@ -70,6 +79,7 @@ module type Pkg = sig val misc : field val stublibs : field val man : field + val describe : string -> builder:builder -> moves list -> unit (** [describe name builder moves] describes a package named [name] with builder [builder] and install moves [moves]. *) @@ -78,7 +88,7 @@ end (* Implementation *) module Topkg : sig - val cmd : [`Build | `Explain | `Help ] + val cmd : [`Build | `Explain | `Help] val env : (string * bool) list val err_parse : string -> 'a val err_mdef : string -> 'a @@ -86,7 +96,6 @@ module Topkg : sig val err_file : string -> string -> 'a val warn_unused : string -> unit end = struct - (* Parses the command line. The actual cmd execution occurs in the call to Pkg.describe. *) @@ -98,25 +107,29 @@ end = struct let err_mdef a = err "bool `%s' is defined more than once" a let err_miss a = err "argument `%s=(true|false)' is missing" a let err_file f e = err "%s: %s" f e + let warn_unused k = Format.eprintf "%s: warning: environment key `%s` unused.@." Sys.argv.(0) k let cmd, env = - let rec parse_env acc = function (* not t.r. *) - | arg :: args -> - begin try + let rec parse_env acc = function + (* not t.r. *) + | arg :: args -> ( + try (* String.cut ... *) let len = String.length arg in let eq = String.index arg '=' in let bool = bool_of_string (String.sub arg (eq + 1) (len - eq - 1)) in let key = String.sub arg 0 eq in - if key = "" then raise Exit else - try 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 - end - | [] -> acc + if key = "" + then raise Exit + else + try + 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) + | [] -> acc in match List.tl (Array.to_list Sys.argv) with | "explain" :: args -> `Explain, parse_env [] args @@ -126,14 +139,18 @@ end module Env : sig include Env + val get : unit -> (string * bool) list end = struct let env = ref [] let get () = !env let add_bool key b = env := (key, b) :: !env + let bool key = - let b = try List.assoc key Topkg.env with - | Not_found -> if Topkg.cmd = `Build then Topkg.err_miss key else true + let b = + try List.assoc key Topkg.env + with Not_found -> + if Topkg.cmd = `Build then Topkg.err_miss key else true in add_bool key b; b @@ -145,20 +162,27 @@ module Exts : Exts = struct let interface = [".mli"; ".cmi"; ".cmti"] let interface_opt = ".cmx" :: interface let library = [".cma"; ".cmxa"; ".cmxs"; ".a"] - let module_library = (interface_opt @ library) + let module_library = interface_opt @ library end module Pkg : Pkg = struct - type builder = [ `OCamlbuild | `Other of string * string ] - type move = { - field_name : string; - target : string option; - source : string; - dest : string } + type builder = [`OCamlbuild | `Other of string * string] + + type move = + {field_name : string; target : string option; source : string; dest : string} + type moves = move list - type field = ?cond:bool -> ?exts:string list -> ?dst:string -> ?target:string -> string -> moves + + type field = + ?cond:bool + -> ?exts:string list + -> ?dst:string + -> ?target:string + -> string + -> moves let str = Printf.sprintf + let warn_unused () = let keys = List.map fst Topkg.env in let keys_used = List.map fst (Env.get ()) in @@ -168,14 +192,13 @@ module Pkg : Pkg = struct let has_suffix = Filename.check_suffix let build_command ?(exec_sep = " ") btool mvs = - let no_build = [ ".cmti"; ".cmt"] in + let no_build = [".cmti"; ".cmt"] in let exec = Buffer.create 1871 in - let add_target = function {field_name=field; source=src; dest=dst;target} -> - let target = match target with - | None -> src - | Some s -> s in - if not (List.exists (has_suffix target) no_build) then - Buffer.add_string exec (str "%s%s" exec_sep target) + let add_target = function + | {field_name = field; source = src; dest = dst; target} -> + let target = match target with None -> src | Some s -> s in + if not (List.exists (has_suffix target) no_build) + then Buffer.add_string exec (str "%s%s" exec_sep target) in Buffer.add_string exec btool; List.iter add_target mvs; @@ -184,53 +207,58 @@ module Pkg : Pkg = struct let split_char sep p = let len = String.length p in let rec split beg cur = - if cur >= len then - if cur - beg > 0 - then [String.sub p beg (cur - beg)] - else [] - else if p.[cur] = sep then - String.sub p beg (cur - beg) :: split (cur + 1) (cur + 1) - else - split beg (cur + 1) in + if cur >= len + then if cur - beg > 0 then [String.sub p beg (cur - beg)] else [] + else if p.[cur] = sep + then String.sub p beg (cur - beg) :: split (cur + 1) (cur + 1) + else split beg (cur + 1) + in split 0 0 let holes src dst = - let aux x = match split_char '%' x with - | [x;y] -> Some (x,y) - | _ -> None in + let aux x = + match split_char '%' x with [x; y] -> Some (x, y) | _ -> None + in match aux src, aux dst with - | Some (s_path,s_suffix),Some(d_path,d_suffix) -> Some (s_path,s_suffix,d_path,d_suffix) - | None,None -> None - | Some (s_path,s_suffix),None -> Some (s_path,s_suffix,dst,s_suffix) + | Some (s_path, s_suffix), Some (d_path, d_suffix) -> + Some (s_path, s_suffix, d_path, d_suffix) + | None, None -> None + | Some (s_path, s_suffix), None -> Some (s_path, s_suffix, dst, s_suffix) | _ -> assert false let list_files bdir src dst = match holes src dst with | None -> [str "%s/%s" bdir src, dst] - | Some (s_path,s_suffix,d_path,d_suffix) -> - let p = bdir ^ "/" ^ s_path in - let l = Array.to_list (Sys.readdir p) in - 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) l + | Some (s_path, s_suffix, d_path, d_suffix) -> + let p = bdir ^ "/" ^ s_path in + let l = Array.to_list (Sys.readdir p) in + 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 )) + l let build_install bdir mvs = - let no_build = [ ".cmti"; ".cmt"] in + let no_build = [".cmti"; ".cmt"] in let install = Buffer.create 1871 in let rec add_mvs current = function - | {field_name=field; source=src; dest=dst;target} :: mvs when field = current -> - let target = match target with - | None -> src - | Some s -> s in - let option = if List.exists (has_suffix target) no_build then "?" else "" in - List.iter (fun (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 -> - if current <> "" (* first *) then Buffer.add_string install " ]\n"; - Buffer.add_string install (str "%s: [" field); - add_mvs field mvs + | {field_name = field; source = src; dest = dst; target} :: mvs + when field = current -> + let target = match target with None -> src | Some s -> s in + let option = + if List.exists (has_suffix target) no_build then "?" else "" + in + List.iter + (fun (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 -> + if current <> "" (* first *) then Buffer.add_string install " ]\n"; + Buffer.add_string install (str "%s: [" field); + add_mvs field mvs | [] -> () in add_mvs "" mvs; @@ -238,7 +266,8 @@ module Pkg : Pkg = struct Buffer.contents install let pr = Format.printf - let pr_explanation btool bdir pkg mvs = + + let pr_explanation btool bdir pkg mvs = let env = Env.get () in let exec = build_command ~exec_sep:" \\\n " btool mvs in let install = build_install bdir mvs in @@ -247,7 +276,7 @@ module Pkg : Pkg = struct pr "Build tool: %s@," btool; pr "Build directory: %s@," bdir; pr "Environment:@, "; - List.iter (fun (k,v) -> pr "%s=%b@, " k v) (List.sort compare env); + List.iter (fun (k, v) -> pr "%s=%b@, " k v) (List.sort compare env); pr "@,Build invocation:@,"; pr " %s@,@," exec; pr "Install file:@,"; @@ -257,33 +286,42 @@ module Pkg : Pkg = struct let pr_help () = pr "Usage example:@\n %s" Sys.argv.(0); - List.iter (fun (k,v) -> pr " %s=%b" k v) (List.sort compare (Env.get ())); + List.iter (fun (k, v) -> pr " %s=%b" k v) (List.sort compare (Env.get ())); pr "@." let build btool bdir pkg mvs = let exec = build_command btool mvs in let e = Sys.command exec in - if e <> 0 then exit e else - let install = build_install bdir mvs in - let install_file = pkg ^ ".install" in - try - let oc = open_out install_file in - output_string oc install; flush oc; close_out oc - with Sys_error e -> Topkg.err_file install_file e + if e <> 0 + then exit e + else + let install = build_install bdir mvs in + let install_file = pkg ^ ".install" in + try + let oc = open_out install_file in + output_string oc install; flush oc; close_out oc + with Sys_error e -> Topkg.err_file install_file e let mvs ?(drop_exts = []) field ?(cond = true) ?(exts = []) ?dst ?target src = - if not cond then [] else - let mv src dst = {field_name=field; source=src; dest=dst; target} in - let expand exts s d = List.map (fun e -> mv (s ^ e) (d ^ e)) exts in - let dst = match dst with None -> Filename.basename src | Some dst -> dst in - let files = if exts = [] then [mv src dst] else expand exts src dst in - let keep {source=src} = not (List.exists (has_suffix src) drop_exts) in - List.find_all keep files + if not cond + then [] + else + let mv src dst = {field_name = field; source = src; dest = dst; target} in + let expand exts s d = List.map (fun e -> mv (s ^ e) (d ^ e)) exts in + let dst = + match dst with None -> Filename.basename src | Some dst -> dst + in + let files = if exts = [] then [mv src dst] else expand exts src dst in + let keep {source = src} = not (List.exists (has_suffix src) drop_exts) in + List.find_all keep files let lib = let drop_exts = - if Env.native && not Env.native_dynlink then [ ".cmxs" ] else - if not Env.native then [ ".a"; ".cmx"; ".cmxa"; ".cmxs" ] else [] + if Env.native && not Env.native_dynlink + then [".cmxs"] + else if not Env.native + then [".a"; ".cmx"; ".cmxa"; ".cmxs"] + else [] in mvs ~drop_exts "lib" @@ -295,17 +333,20 @@ module Pkg : Pkg = struct let misc = mvs "misc" let stublibs = mvs "stublibs" let man = mvs "man" + let bin_drops = if not Env.native then [".native"] else [] - let bin_drops = if not Env.native then [ ".native" ] else [] let bin_mvs field ?(auto = false) ?cond ?exts ?dst ?target src = let src, dst = - if not auto then src, dst else - let dst = match dst with - | None -> Some (Filename.basename src) - | Some _ as dst -> dst - in - let src = if Env.native then src ^ ".native" else src ^ ".byte" in - src, dst + if not auto + then src, dst + else + let dst = + match dst with + | None -> Some (Filename.basename src) + | Some _ as dst -> dst + in + let src = if Env.native then src ^ ".native" else src ^ ".byte" in + src, dst in mvs ~drop_exts:bin_drops field ?cond ?dst ?exts ?target src @@ -314,9 +355,10 @@ module Pkg : Pkg = struct let describe pkg ~builder mvs = let mvs = List.sort compare (List.flatten mvs) in - let btool, bdir = match builder with - | `OCamlbuild -> "ocamlbuild -use-ocamlfind -classic-display", "_build" - | `Other (btool, bdir) -> btool, bdir + let btool, bdir = + match builder with + | `OCamlbuild -> "ocamlbuild -use-ocamlfind -classic-display", "_build" + | `Other (btool, bdir) -> btool, bdir in match Topkg.cmd with | `Explain -> pr_explanation btool bdir pkg mvs diff --git a/src/lib/client/dune b/src/lib/client/dune index 3e3ba3e528..973c944a9c 100644 --- a/src/lib/client/dune +++ b/src/lib/client/dune @@ -1,28 +1,48 @@ (library - (name eliom_client) - (public_name eliom.client) - (synopsis "Eliom: client-side") - (wrapped false) - (modes byte) - (modules_without_implementation eliom_content_sigs eliom_form_sigs - eliom_parameter_sigs eliom_registration_sigs eliom_service_sigs - eliom_shared_sigs eliom_wrap) - (preprocess (pps lwt_ppx js_of_ocaml-ppx js_of_ocaml-ppx_deriving_json)) - (library_flags (:standard -linkall)) - (libraries ocsigenserver.cookies ocsigenserver.polytables js_of_ocaml - js_of_ocaml-tyxml js_of_ocaml-lwt js_of_ocaml-lwt.logger - lwt_react ocsigenserver.baselib.base cohttp tyxml - reactiveData) - (foreign_stubs (language c) (names eliom_stubs)) - (js_of_ocaml (javascript_files eliom_client.js))) + (name eliom_client) + (public_name eliom.client) + (synopsis "Eliom: client-side") + (wrapped false) + (modes byte) + (modules_without_implementation + eliom_content_sigs + eliom_form_sigs + eliom_parameter_sigs + eliom_registration_sigs + eliom_service_sigs + eliom_shared_sigs + eliom_wrap) + (preprocess + (pps lwt_ppx js_of_ocaml-ppx js_of_ocaml-ppx_deriving_json)) + (library_flags + (:standard -linkall)) + (libraries + ocsigenserver.cookies + ocsigenserver.polytables + js_of_ocaml + js_of_ocaml-tyxml + js_of_ocaml-lwt + js_of_ocaml-lwt.logger + lwt_react + ocsigenserver.baselib.base + cohttp + tyxml + reactiveData) + (foreign_stubs + (language c) + (names eliom_stubs)) + (js_of_ocaml + (javascript_files eliom_client.js))) (include dune.client) (rule - (target dune.client) - (mode promote) - (deps (glob_files ../*) (universe)) - (action - (with-stdout-to - %{target} - (run ../../tools/gen_dune.exe --client ..)))) \ No newline at end of file + (target dune.client) + (mode promote) + (deps + (glob_files ../*) + (universe)) + (action + (with-stdout-to + %{target} + (run ../../tools/gen_dune.exe --client ..)))) diff --git a/src/lib/eliom_common.server.mli b/src/lib/eliom_common.server.mli index 0c628984ab..9db4d308f3 100644 --- a/src/lib/eliom_common.server.mli +++ b/src/lib/eliom_common.server.mli @@ -110,8 +110,10 @@ exception Eliom_site_information_not_available of string In that case you must delay the function call using {!Eliom_service.register_eliom_module}. *) + exception Cannot_call_this_function_before_app_is_linked_to_a_site (** Statically linked app: You cannot call this function before [Eliom_run]. *) + type full_state_name = {user_scope : user_scope; secure : bool; site_dir_str : string} diff --git a/src/lib/eliom_lib.client.ml b/src/lib/eliom_lib.client.ml index 81a67be1af..73e65094b3 100644 --- a/src/lib/eliom_lib.client.ml +++ b/src/lib/eliom_lib.client.ml @@ -22,9 +22,9 @@ include Ocsigen_lib_base include ( Eliom_lib_base : module type of Eliom_lib_base - with type 'a Int64_map.t = 'a Eliom_lib_base.Int64_map.t - with type 'a String_map.t = 'a Eliom_lib_base.String_map.t - with type 'a Int_map.t = 'a Eliom_lib_base.Int_map.t) + with type 'a Int64_map.t = 'a Eliom_lib_base.Int64_map.t + with type 'a String_map.t = 'a Eliom_lib_base.String_map.t + with type 'a Int_map.t = 'a Eliom_lib_base.Int_map.t) (*****************************************************************************) @@ -74,10 +74,9 @@ module Url = struct let path_of_url_string s = match Url.url_of_string s with | Some path -> path_of_url path - | _ -> ( + | _ -> (* assuming relative URL and improvising *) - split_path - @@ try String.(sub s 0 (index s '?')) with Not_found -> s) + split_path (try String.(sub s 0 (index s '?')) with Not_found -> s) end module Lwt_log = struct @@ -169,12 +168,11 @@ let make_cryptographic_safe_string ?len:_ () = failwith "make_cryptographic_safe_string not implemented client-side" module Dom_reference = struct - class type ['a, 'b] map = - object - method set : 'a -> 'b -> unit Js.meth - method get : 'a -> 'b Js.Optdef.t Js.meth - method delete : 'a -> unit Js.meth - end + class type ['a, 'b] map = object + method set : 'a -> 'b -> unit Js.meth + method get : 'a -> 'b Js.Optdef.t Js.meth + method delete : 'a -> unit Js.meth + end let create_map () : (_, _) map Js.t = let map = Js.Unsafe.global##._Map in @@ -195,9 +193,9 @@ module Dom_reference = struct Js.Optdef.get (retain_map##get node) (fun () -> - let m = create_map () in - retain_map##set node m; - m) + let m = create_map () in + retain_map##set node m; + m) in m##set key (Obj.repr keep) @@ -212,6 +210,6 @@ module Dom_reference = struct Js.Optdef.iter (retain_map##get src) (fun m -> - Js.Optdef.iter (m##get key) (fun keep -> retain dst ~key ~keep); - m##delete key) + Js.Optdef.iter (m##get key) (fun keep -> retain dst ~key ~keep); + m##delete key) end diff --git a/src/lib/eliom_lib.client.mli b/src/lib/eliom_lib.client.mli index bf876064dd..cbe71f3694 100644 --- a/src/lib/eliom_lib.client.mli +++ b/src/lib/eliom_lib.client.mli @@ -24,17 +24,17 @@ open Js_of_ocaml (** See {% <> %}. *) include module type of Ocsigen_lib_base - with type poly = Ocsigen_lib_base.poly - and type yesnomaybe = Ocsigen_lib_base.yesnomaybe - and type ('a, 'b) leftright = ('a, 'b) Ocsigen_lib_base.leftright - and type 'a Clist.t = 'a Ocsigen_lib_base.Clist.t - and type 'a Clist.node = 'a Ocsigen_lib_base.Clist.node + with type poly = Ocsigen_lib_base.poly + and type yesnomaybe = Ocsigen_lib_base.yesnomaybe + and type ('a, 'b) leftright = ('a, 'b) Ocsigen_lib_base.leftright + and type 'a Clist.t = 'a Ocsigen_lib_base.Clist.t + and type 'a Clist.node = 'a Ocsigen_lib_base.Clist.node include module type of Eliom_lib_base - with type 'a Int64_map.t = 'a Eliom_lib_base.Int64_map.t - with type 'a String_map.t = 'a Eliom_lib_base.String_map.t - with type 'a Int_map.t = 'a Eliom_lib_base.Int_map.t + with type 'a Int64_map.t = 'a Eliom_lib_base.Int64_map.t + with type 'a String_map.t = 'a Eliom_lib_base.String_map.t + with type 'a Int_map.t = 'a Eliom_lib_base.Int_map.t type file_info = File.file Js.t @@ -78,14 +78,14 @@ end module Lwt_log : sig include module type of Lwt_log_js - with type level = Lwt_log_core.level - and type logger = Lwt_log_core.logger - and type section = Lwt_log_core.section - and type template = Lwt_log_core.template - and module Section = Lwt_log_core.Section - - val raise_error - : ?inspect:'v + with type level = Lwt_log_core.level + and type logger = Lwt_log_core.logger + and type section = Lwt_log_core.section + and type template = Lwt_log_core.template + and module Section = Lwt_log_core.Section + + val raise_error : + ?inspect:'v -> ?exn:exn -> ?section:section -> ?location:string * int * int @@ -93,8 +93,8 @@ module Lwt_log : sig -> string -> 'a - val raise_error_f - : ?inspect:'v + val raise_error_f : + ?inspect:'v -> ?exn:exn -> ?section:section -> ?location:string * int * int @@ -138,15 +138,19 @@ module Dom_reference : sig type key val new_key : unit -> key + val retain : ?key:key -> _ Js.t -> keep:_ -> unit (** [retain v ~keep] prevents [keep] from being garbage collected while [v] is live. An optional key can be specified if one needs to remove this association later one. *) + val retain_generic : ?key:key -> _ -> keep:_ -> unit (** Same as [retain] but works with any object. More error-prone *) + val release : key:key -> _ -> unit (** [release ~key o] removes the association between the value [v] and the value associated to [key]. *) + val transfer : key:key -> src:_ -> dst:_ -> unit (** [transfer ~key ~src ~dst] transfers the association between the value [src] and the value associated to key [key] to value diff --git a/src/lib/server/dune b/src/lib/server/dune index ee6832de74..6f02cb8e96 100644 --- a/src/lib/server/dune +++ b/src/lib/server/dune @@ -1,31 +1,44 @@ (library - (name eliom_server) - (public_name eliom.server) - (synopsis "Eliom: server-side") - (wrapped false) - (modules_without_implementation eliom_content_sigs eliom_form_sigs - eliom_parameter_sigs eliom_registration_sigs eliom_service_sigs - eliom_shared_sigs) - (preprocess (pps lwt_ppx js_of_ocaml-ppx_deriving_json)) - (flags (:standard (:include type_includes))) - (library_flags (:standard -linkall)) - (libraries lwt_react ocsigenserver ocsipersist tyxml)) + (name eliom_server) + (public_name eliom.server) + (synopsis "Eliom: server-side") + (wrapped false) + (modules_without_implementation + eliom_content_sigs + eliom_form_sigs + eliom_parameter_sigs + eliom_registration_sigs + eliom_service_sigs + eliom_shared_sigs) + (preprocess + (pps lwt_ppx js_of_ocaml-ppx_deriving_json)) + (flags + (:standard + (:include type_includes))) + (library_flags + (:standard -linkall)) + (libraries lwt_react ocsigenserver ocsipersist tyxml)) (include dune.server) (rule - (target dune.server) - (mode promote) - (deps (glob_files ../*) (universe)) - (action - (with-stdout-to - %{target} - (run ../../tools/gen_dune.exe --server ..)))) + (target dune.server) + (mode promote) + (deps + (glob_files ../*) + (universe)) + (action + (with-stdout-to + %{target} + (run ../../tools/gen_dune.exe --server ..)))) ; We need to refer to types defined by Js_of_ocaml without a link ; dependency to some code that only makes sense in a browser. -(rule (target type_includes) - (deps (universe)) - (action - (with-stdout-to %{target} - (system "printf '('; ocamlfind query -i-format js_of_ocaml; printf ')'")))) + +(rule + (target type_includes) + (deps (universe)) + (action + (with-stdout-to + %{target} + (system "printf '('; ocamlfind query -i-format js_of_ocaml; printf ')'")))) diff --git a/src/lib/server/monitor/dune b/src/lib/server/monitor/dune index 04c9f4e815..44f1f90f6c 100644 --- a/src/lib/server/monitor/dune +++ b/src/lib/server/monitor/dune @@ -1,15 +1,17 @@ (library - (name monitor) - (public_name eliom.server.monitor) - (wrapped false) - (modules eliom_monitor) - (preprocess (pps lwt_ppx)) - (libraries eliom.server)) + (name monitor) + (public_name eliom.server.monitor) + (wrapped false) + (modules eliom_monitor) + (preprocess + (pps lwt_ppx)) + (libraries eliom.server)) (library - (name monitor_start) - (public_name eliom.server.monitor.start) - (wrapped false) - (modules eliom_monitor_main) - (preprocess (pps lwt_ppx)) - (libraries monitor eliom.server)) + (name monitor_start) + (public_name eliom.server.monitor.start) + (wrapped false) + (modules eliom_monitor_main) + (preprocess + (pps lwt_ppx)) + (libraries monitor eliom.server)) diff --git a/src/ocamlbuild/dune b/src/ocamlbuild/dune index 5d657a8570..49d399cb24 100644 --- a/src/ocamlbuild/dune +++ b/src/ocamlbuild/dune @@ -1,6 +1,6 @@ (library - (name ocamlbuild_eliom) - (public_name eliom.ocamlbuild) - (synopsis "Eliom ocamlbuild plugin (js_of_ocaml part included)") - (wrapped false) - (libraries js_of_ocaml-ocamlbuild)) + (name ocamlbuild_eliom) + (public_name eliom.ocamlbuild) + (synopsis "Eliom ocamlbuild plugin (js_of_ocaml part included)") + (wrapped false) + (libraries js_of_ocaml-ocamlbuild)) diff --git a/src/ppx/dune b/src/ppx/dune index df6e1be5f2..d81dae672c 100644 --- a/src/ppx/dune +++ b/src/ppx/dune @@ -1,58 +1,65 @@ (library - (name ppx_server) - (public_name eliom.ppx.server) - (synopsis "Ppx syntax extension: server side") - (wrapped false) - (kind ppx_rewriter) - (modules ppx_eliom_server) - (preprocess (pps ppxlib.metaquot)) - (libraries ppx_utils)) + (name ppx_server) + (public_name eliom.ppx.server) + (synopsis "Ppx syntax extension: server side") + (wrapped false) + (kind ppx_rewriter) + (modules ppx_eliom_server) + (preprocess + (pps ppxlib.metaquot)) + (libraries ppx_utils)) (library - (name ppx_client) - (public_name eliom.ppx.client) - (synopsis "Ppx syntax extension: client side") - (wrapped false) - (kind ppx_rewriter) - (modules ppx_eliom_client) - (preprocess (pps ppxlib.metaquot)) - (libraries ppx_utils)) + (name ppx_client) + (public_name eliom.ppx.client) + (synopsis "Ppx syntax extension: client side") + (wrapped false) + (kind ppx_rewriter) + (modules ppx_eliom_client) + (preprocess + (pps ppxlib.metaquot)) + (libraries ppx_utils)) (library - (name ppx_type) - (wrapped false) - (public_name eliom.ppx.type) - (synopsis "Ppx syntax extension: type inference") - (kind ppx_rewriter) - (modules ppx_eliom_type) - (preprocess (pps ppxlib.metaquot)) - (libraries ppx_utils)) + (name ppx_type) + (wrapped false) + (public_name eliom.ppx.type) + (synopsis "Ppx syntax extension: type inference") + (kind ppx_rewriter) + (modules ppx_eliom_type) + (preprocess + (pps ppxlib.metaquot)) + (libraries ppx_utils)) (library - (name ppx_utils) - (public_name eliom.ppx.utils) - (wrapped false) - (modules ppx_eliom_utils) - (preprocess (pps ppxlib.metaquot ppx_optcomp)) - (libraries ppxlib)) + (name ppx_utils) + (public_name eliom.ppx.utils) + (wrapped false) + (modules ppx_eliom_utils) + (preprocess + (pps ppxlib.metaquot ppx_optcomp)) + (libraries ppxlib)) (executable - (name ppx_eliom_server_ex) - (public_name ppx_eliom_server) - (libraries ppx_server) - (preprocess (pps ppxlib.metaquot)) - (modules ppx_eliom_server_ex)) + (name ppx_eliom_server_ex) + (public_name ppx_eliom_server) + (libraries ppx_server) + (preprocess + (pps ppxlib.metaquot)) + (modules ppx_eliom_server_ex)) (executable - (name ppx_eliom_client_ex) - (public_name ppx_eliom_client) - (libraries ppx_client) - (preprocess (pps ppxlib.metaquot)) - (modules ppx_eliom_client_ex)) + (name ppx_eliom_client_ex) + (public_name ppx_eliom_client) + (libraries ppx_client) + (preprocess + (pps ppxlib.metaquot)) + (modules ppx_eliom_client_ex)) (executable - (name ppx_eliom_types_ex) - (public_name ppx_eliom_types) - (libraries ppx_type) - (preprocess (pps ppxlib.metaquot)) - (modules ppx_eliom_types_ex)) + (name ppx_eliom_types_ex) + (public_name ppx_eliom_types) + (libraries ppx_type) + (preprocess + (pps ppxlib.metaquot)) + (modules ppx_eliom_types_ex)) diff --git a/src/tools/dune b/src/tools/dune index ea55f9cad9..007ae75700 100644 --- a/src/tools/dune +++ b/src/tools/dune @@ -1,11 +1,13 @@ (executables - (names eliomc eliomdep eliomdoc eliompp distillery gen_dune) - (public_names eliomc eliomdep eliomdoc eliompp eliom-distillery -) - (libraries str unix findlib)) + (names eliomc eliomdep eliomdoc eliompp distillery gen_dune) + (public_names eliomc eliomdep eliomdoc eliompp eliom-distillery -) + (libraries str unix findlib)) (ocamllex eliompp_lexer) (install (section bin) - (files (eliomc.exe as eliomopt) (eliomc.exe as eliomcp) - (eliomc.exe as js_of_eliom))) + (files + (eliomc.exe as eliomopt) + (eliomc.exe as eliomcp) + (eliomc.exe as js_of_eliom)))