Handle compiling the java test program from ocamlbuild too
authorKim Nguyễn <kn@lri.fr>
Sun, 10 Mar 2013 09:52:24 +0000 (10:52 +0100)
committerKim Nguyễn <kn@lri.fr>
Sun, 10 Mar 2013 09:52:24 +0000 (10:52 +0100)
main.itarget
myocamlbuild.ml

index d188d1e..45edc29 100644 (file)
@@ -1 +1,3 @@
 src/main.native
+tools/xml_diff.native
+tools/XPathEval.class
index d198faa..4dbf6f6 100644 (file)
@@ -37,5 +37,15 @@ let () = dispatch begin
         pflag [ "ocaml"; "compile"; "native" ] "inline" (fun i -> (S[ A"-inline"; A i ]));
         pflag [ "ocaml"; "compile" ] "unsafe" (fun s -> (if s = "true" then S[A"-ppopt";A "-unsafe"] else N));
 
+
+    | After_rules ->
+         rule "Java compilation"
+        ~prod:"%.class"
+        ~dep:"%.java"
+        begin fun env _build ->
+          let java = env "%.java" in
+          let tags = tags_of_pathname java ++ "compile" in
+          Cmd( S[ A"javac" ; P java; T tags ])
+        end
     | _ -> ()
 end