|
@@ -1,7 +1,7 @@
|
|
|
(* setup.ml generated for the first time by OASIS v0.4.5 *)
|
|
|
|
|
|
(* OASIS_START *)
|
|
|
-(* DO NOT EDIT (digest: 222f72aedda36c0f8007ed5c735d6e4b) *)
|
|
|
+(* DO NOT EDIT (digest: facda6205b6c2f62ccec277c5a0df974) *)
|
|
|
(*
|
|
|
Regenerated by OASIS v0.4.5
|
|
|
Visit http://oasis.forge.ocamlcore.org for more information and
|
|
@@ -6649,21 +6649,199 @@ end
|
|
|
|
|
|
|
|
|
# 6651 "setup.ml"
|
|
|
+module CustomPlugin = struct
|
|
|
+(* # 22 "src/plugins/custom/CustomPlugin.ml" *)
|
|
|
+
|
|
|
+
|
|
|
+ (** Generate custom configure/build/doc/test/install system
|
|
|
+ @author
|
|
|
+ *)
|
|
|
+
|
|
|
+
|
|
|
+ open BaseEnv
|
|
|
+ open OASISGettext
|
|
|
+ open OASISTypes
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ type t =
|
|
|
+ {
|
|
|
+ cmd_main: command_line conditional;
|
|
|
+ cmd_clean: (command_line option) conditional;
|
|
|
+ cmd_distclean: (command_line option) conditional;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let run = BaseCustom.run
|
|
|
+
|
|
|
+
|
|
|
+ let main t _ extra_args =
|
|
|
+ let cmd, args =
|
|
|
+ var_choose
|
|
|
+ ~name:(s_ "main command")
|
|
|
+ t.cmd_main
|
|
|
+ in
|
|
|
+ run cmd args extra_args
|
|
|
+
|
|
|
+
|
|
|
+ let clean t pkg extra_args =
|
|
|
+ match var_choose t.cmd_clean with
|
|
|
+ | Some (cmd, args) ->
|
|
|
+ run cmd args extra_args
|
|
|
+ | _ ->
|
|
|
+ ()
|
|
|
+
|
|
|
+
|
|
|
+ let distclean t pkg extra_args =
|
|
|
+ match var_choose t.cmd_distclean with
|
|
|
+ | Some (cmd, args) ->
|
|
|
+ run cmd args extra_args
|
|
|
+ | _ ->
|
|
|
+ ()
|
|
|
+
|
|
|
+
|
|
|
+ module Build =
|
|
|
+ struct
|
|
|
+ let main t pkg extra_args =
|
|
|
+ main t pkg extra_args;
|
|
|
+ List.iter
|
|
|
+ (fun sct ->
|
|
|
+ let evs =
|
|
|
+ match sct with
|
|
|
+ | Library (cs, bs, lib) when var_choose bs.bs_build ->
|
|
|
+ begin
|
|
|
+ let evs, _ =
|
|
|
+ BaseBuilt.of_library
|
|
|
+ OASISHostPath.of_unix
|
|
|
+ (cs, bs, lib)
|
|
|
+ in
|
|
|
+ evs
|
|
|
+ end
|
|
|
+ | Executable (cs, bs, exec) when var_choose bs.bs_build ->
|
|
|
+ begin
|
|
|
+ let evs, _, _ =
|
|
|
+ BaseBuilt.of_executable
|
|
|
+ OASISHostPath.of_unix
|
|
|
+ (cs, bs, exec)
|
|
|
+ in
|
|
|
+ evs
|
|
|
+ end
|
|
|
+ | _ ->
|
|
|
+ []
|
|
|
+ in
|
|
|
+ List.iter
|
|
|
+ (fun (bt, bnm, lst) -> BaseBuilt.register bt bnm lst)
|
|
|
+ evs)
|
|
|
+ pkg.sections
|
|
|
+
|
|
|
+ let clean t pkg extra_args =
|
|
|
+ clean t pkg extra_args;
|
|
|
+ (* TODO: this seems to be pretty generic (at least wrt to ocamlbuild
|
|
|
+ * considering moving this to BaseSetup?
|
|
|
+ *)
|
|
|
+ List.iter
|
|
|
+ (function
|
|
|
+ | Library (cs, _, _) ->
|
|
|
+ BaseBuilt.unregister BaseBuilt.BLib cs.cs_name
|
|
|
+ | Executable (cs, _, _) ->
|
|
|
+ BaseBuilt.unregister BaseBuilt.BExec cs.cs_name;
|
|
|
+ BaseBuilt.unregister BaseBuilt.BExecLib cs.cs_name
|
|
|
+ | _ ->
|
|
|
+ ())
|
|
|
+ pkg.sections
|
|
|
+
|
|
|
+ let distclean t pkg extra_args =
|
|
|
+ distclean t pkg extra_args
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
+ module Test =
|
|
|
+ struct
|
|
|
+ let main t pkg (cs, test) extra_args =
|
|
|
+ try
|
|
|
+ main t pkg extra_args;
|
|
|
+ 0.0
|
|
|
+ with Failure s ->
|
|
|
+ BaseMessage.warning
|
|
|
+ (f_ "Test '%s' fails: %s")
|
|
|
+ cs.cs_name
|
|
|
+ s;
|
|
|
+ 1.0
|
|
|
+
|
|
|
+ let clean t pkg (cs, test) extra_args =
|
|
|
+ clean t pkg extra_args
|
|
|
+
|
|
|
+ let distclean t pkg (cs, test) extra_args =
|
|
|
+ distclean t pkg extra_args
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
+ module Doc =
|
|
|
+ struct
|
|
|
+ let main t pkg (cs, _) extra_args =
|
|
|
+ main t pkg extra_args;
|
|
|
+ BaseBuilt.register BaseBuilt.BDoc cs.cs_name []
|
|
|
+
|
|
|
+ let clean t pkg (cs, _) extra_args =
|
|
|
+ clean t pkg extra_args;
|
|
|
+ BaseBuilt.unregister BaseBuilt.BDoc cs.cs_name
|
|
|
+
|
|
|
+ let distclean t pkg (cs, _) extra_args =
|
|
|
+ distclean t pkg extra_args
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
+# 6799 "setup.ml"
|
|
|
open OASISTypes;;
|
|
|
|
|
|
let setup_t =
|
|
|
{
|
|
|
BaseSetup.configure = InternalConfigurePlugin.configure;
|
|
|
build = OCamlbuildPlugin.build [];
|
|
|
- test = [];
|
|
|
+ test =
|
|
|
+ [
|
|
|
+ ("tests",
|
|
|
+ CustomPlugin.Test.main
|
|
|
+ {
|
|
|
+ CustomPlugin.cmd_main =
|
|
|
+ [(OASISExpr.EBool true, ("$run_test", []))];
|
|
|
+ cmd_clean = [(OASISExpr.EBool true, None)];
|
|
|
+ cmd_distclean = [(OASISExpr.EBool true, None)]
|
|
|
+ })
|
|
|
+ ];
|
|
|
doc = [];
|
|
|
install = InternalInstallPlugin.install;
|
|
|
uninstall = InternalInstallPlugin.uninstall;
|
|
|
clean = [OCamlbuildPlugin.clean];
|
|
|
- clean_test = [];
|
|
|
+ clean_test =
|
|
|
+ [
|
|
|
+ ("tests",
|
|
|
+ CustomPlugin.Test.clean
|
|
|
+ {
|
|
|
+ CustomPlugin.cmd_main =
|
|
|
+ [(OASISExpr.EBool true, ("$run_test", []))];
|
|
|
+ cmd_clean = [(OASISExpr.EBool true, None)];
|
|
|
+ cmd_distclean = [(OASISExpr.EBool true, None)]
|
|
|
+ })
|
|
|
+ ];
|
|
|
clean_doc = [];
|
|
|
distclean = [];
|
|
|
- distclean_test = [];
|
|
|
+ distclean_test =
|
|
|
+ [
|
|
|
+ ("tests",
|
|
|
+ CustomPlugin.Test.distclean
|
|
|
+ {
|
|
|
+ CustomPlugin.cmd_main =
|
|
|
+ [(OASISExpr.EBool true, ("$run_test", []))];
|
|
|
+ cmd_clean = [(OASISExpr.EBool true, None)];
|
|
|
+ cmd_distclean = [(OASISExpr.EBool true, None)]
|
|
|
+ })
|
|
|
+ ];
|
|
|
distclean_doc = [];
|
|
|
package =
|
|
|
{
|
|
@@ -6764,7 +6942,71 @@ let setup_t =
|
|
|
bs_byteopt = [(OASISExpr.EBool true, [])];
|
|
|
bs_nativeopt = [(OASISExpr.EBool true, [])]
|
|
|
},
|
|
|
- {exec_custom = false; exec_main_is = "oclaunch.ml"})
|
|
|
+ {exec_custom = false; exec_main_is = "oclaunch.ml"});
|
|
|
+ Executable
|
|
|
+ ({
|
|
|
+ cs_name = "run_test";
|
|
|
+ cs_data = PropList.Data.create ();
|
|
|
+ cs_plugin_data = []
|
|
|
+ },
|
|
|
+ {
|
|
|
+ bs_build =
|
|
|
+ [
|
|
|
+ (OASISExpr.EBool true, false);
|
|
|
+ (OASISExpr.EFlag "tests", true)
|
|
|
+ ];
|
|
|
+ bs_install = [(OASISExpr.EBool true, false)];
|
|
|
+ bs_path = "src";
|
|
|
+ bs_compiled_object = Best;
|
|
|
+ bs_build_depends =
|
|
|
+ [
|
|
|
+ FindlibPackage ("alcotest", None);
|
|
|
+ FindlibPackage ("oUnit", None);
|
|
|
+ FindlibPackage ("core", None);
|
|
|
+ FindlibPackage ("threads", None);
|
|
|
+ FindlibPackage ("core_extended", None);
|
|
|
+ FindlibPackage ("atdgen", None)
|
|
|
+ ];
|
|
|
+ bs_build_tools =
|
|
|
+ [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"];
|
|
|
+ bs_c_sources = [];
|
|
|
+ bs_data_files = [];
|
|
|
+ bs_ccopt = [(OASISExpr.EBool true, [])];
|
|
|
+ bs_cclib = [(OASISExpr.EBool true, [])];
|
|
|
+ bs_dlllib = [(OASISExpr.EBool true, [])];
|
|
|
+ bs_dllpath = [(OASISExpr.EBool true, [])];
|
|
|
+ bs_byteopt = [(OASISExpr.EBool true, [])];
|
|
|
+ bs_nativeopt = [(OASISExpr.EBool true, [])]
|
|
|
+ },
|
|
|
+ {exec_custom = false; exec_main_is = "test/test.ml"});
|
|
|
+ Test
|
|
|
+ ({
|
|
|
+ cs_name = "tests";
|
|
|
+ cs_data = PropList.Data.create ();
|
|
|
+ cs_plugin_data = []
|
|
|
+ },
|
|
|
+ {
|
|
|
+ test_type = (`Test, "custom", Some "0.4");
|
|
|
+ test_command =
|
|
|
+ [(OASISExpr.EBool true, ("$run_test", []))];
|
|
|
+ test_custom =
|
|
|
+ {
|
|
|
+ pre_command = [(OASISExpr.EBool true, None)];
|
|
|
+ post_command = [(OASISExpr.EBool true, None)]
|
|
|
+ };
|
|
|
+ test_working_directory = Some "src/test";
|
|
|
+ test_run =
|
|
|
+ [
|
|
|
+ (OASISExpr.ENot (OASISExpr.EFlag "tests"), false);
|
|
|
+ (OASISExpr.EFlag "tests", false);
|
|
|
+ (OASISExpr.EAnd
|
|
|
+ (OASISExpr.EFlag "tests",
|
|
|
+ OASISExpr.EFlag "tests"),
|
|
|
+ true)
|
|
|
+ ];
|
|
|
+ test_tools =
|
|
|
+ [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"]
|
|
|
+ })
|
|
|
];
|
|
|
plugins =
|
|
|
[
|
|
@@ -6777,7 +7019,8 @@ let setup_t =
|
|
|
};
|
|
|
oasis_fn = Some "_oasis";
|
|
|
oasis_version = "0.4.5";
|
|
|
- oasis_digest = Some "\170\134\136a\241\018\026\"\180\230\139g\173\177&a";
|
|
|
+ oasis_digest =
|
|
|
+ Some "w\231\183\238E\027\192\029\180\212\172\209\001\200h\003";
|
|
|
oasis_exec = None;
|
|
|
oasis_setup_args = [];
|
|
|
setup_update = false
|
|
@@ -6785,6 +7028,6 @@ let setup_t =
|
|
|
|
|
|
let setup () = BaseSetup.setup setup_t;;
|
|
|
|
|
|
-# 6789 "setup.ml"
|
|
|
+# 7032 "setup.ml"
|
|
|
(* OASIS_STOP *)
|
|
|
let () = setup ();;
|