[Pkg-ocaml-maint-commits] [cppo] 01/05: Imported Upstream version 1.4.0

Hendrik Tews hendrik-guest at moszumanska.debian.org
Thu Jan 19 14:14:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

hendrik-guest pushed a commit to branch master
in repository cppo.

commit 46f583e50935a4c2fc51ba8dfdb668ace4bc3b65
Author: Hendrik Tews <hendrik at askra.de>
Date:   Thu Jan 19 14:23:03 2017 +0100

    Imported Upstream version 1.4.0
---
 Makefile                              |  2 +-
 README.md                             |  5 +++--
 ocamlbuild_plugin/ocamlbuild_cppo.ml  | 29 ++++++++++++++---------------
 ocamlbuild_plugin/ocamlbuild_cppo.mli |  7 +++++++
 4 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index b031fe2..c2cea59 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = 1.3.2
+VERSION = 1.4.0
 
 ifeq "$(shell ocamlc -config |grep os_type)" "os_type: Win32"
 EXE=.exe
diff --git a/README.md b/README.md
index c749301..1c419f9 100644
--- a/README.md
+++ b/README.md
@@ -406,8 +406,9 @@ let () =
     )
 ```
 
-The plugin will apply cppo on all files ending in `.cppo.ml` in order
-to produce`.ml` files. The following tags are available:
+By default the plugin will apply cppo on all files ending in `.cppo.ml`
+`cppo.mli`, and `cppo.mlpack`, in order to produce `.ml`, `.mli`,
+and`.mlpack` files.  The following tags are available:
 * `cppo_D(X)` ≡ `-D X`
 * `cppo_U(X)` ≡ `-U X`
 * `cppo_q` ≡ `-q`
diff --git a/ocamlbuild_plugin/ocamlbuild_cppo.ml b/ocamlbuild_plugin/ocamlbuild_cppo.ml
index 153d071..f301c36 100644
--- a/ocamlbuild_plugin/ocamlbuild_cppo.ml
+++ b/ocamlbuild_plugin/ocamlbuild_cppo.ml
@@ -1,23 +1,22 @@
 
 open Ocamlbuild_plugin
 
+let cppo_rules ext =
+  let dep   = "%(name).cppo"-.-ext
+  and prod1 = "%(name: <*> and not <*.cppo>)"-.-ext
+  and prod2 = "%(name: <**/*> and not <**/*.cppo>)"-.-ext in
+  let cppo_rule prod env _build =
+    let dep = env dep in
+    let prod = env prod in
+    let tags = tags_of_pathname prod ++ "cppo" in
+    Cmd (S[A "cppo"; T tags; S [A "-o"; P prod]; P dep ])
+  in
+  rule ("cppo: *.cppo."-.-ext^" -> *."-.-ext)  ~dep ~prod:prod1 (cppo_rule prod1);
+  rule ("cppo: **/*.cppo."-.-ext^" -> **/*."-.-ext)  ~dep ~prod:prod2 (cppo_rule prod2)
+
 let dispatcher = function
   | After_rules -> begin
-      let cppo_rules ext =
-        let dep   = "%(name).cppo"-.-ext
-        and prod1 = "%(name: <*> and not <*.cppo>)"-.-ext
-        and prod2 = "%(name: <**/*> and not <**/*.cppo>)"-.-ext in
-        let cppo_rule prod env _build =
-          let dep = env dep in
-          let prod = env prod in
-          let tags = tags_of_pathname prod ++ "cppo" in
-          Cmd (S[A "cppo"; T tags; S [A "-o"; P prod]; P dep ])
-        in
-        rule ("cppo: *.cppo."-.-ext^" -> *."-.-ext)  ~dep ~prod:prod1 (cppo_rule prod1);
-        rule ("cppo: **/*.cppo."-.-ext^" -> **/*."-.-ext)  ~dep ~prod:prod2 (cppo_rule prod2);
-      in
-      List.iter cppo_rules ["ml"; "mli"];
-
+      List.iter cppo_rules ["ml"; "mli"; "mlpack"];
       pflag ["cppo"] "cppo_D" (fun s -> S [A "-D"; A s]) ;
       pflag ["cppo"] "cppo_U" (fun s -> S [A "-U"; A s]) ;
       pflag ["cppo"] "cppo_I" (fun s ->
diff --git a/ocamlbuild_plugin/ocamlbuild_cppo.mli b/ocamlbuild_plugin/ocamlbuild_cppo.mli
index 692d887..2124358 100644
--- a/ocamlbuild_plugin/ocamlbuild_cppo.mli
+++ b/ocamlbuild_plugin/ocamlbuild_cppo.mli
@@ -1,2 +1,9 @@
 
+(** [cppo_rules extension] will add rules to Ocamlbuild so that
+    cppo is applied to files ending in "cppo.[extension]".
+
+    By default rules are inserted for files ending with "ml", "mli" and
+    "mlpack". *)
+val cppo_rules : string -> unit
+
 val dispatcher : Ocamlbuild_plugin.hook -> unit

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/cppo.git



More information about the Pkg-ocaml-maint-commits mailing list