From bb1e08cf62a6102184e45199b23c737488344c98 Mon Sep 17 00:00:00 2001 From: Matthieu Dubuget Date: Sun, 27 Aug 2017 14:59:39 +0200 Subject: [PATCH] =?UTF-8?q?Passage=20=C3=A0=20jbuilder=20+=20opam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .merlin | 6 +++--- META | 3 --- Makefile | 19 ------------------- README.org | 5 +++++ _tags | 4 ---- jbuild | 13 +++++++++++++ jbuild-workspace.here | 0 myocamlbuild.ml | 32 -------------------------------- ocaml-google-apps.opam | 14 ++++++++++++++ opam | 7 ------- 10 files changed, 35 insertions(+), 68 deletions(-) delete mode 100644 META delete mode 100644 Makefile create mode 100644 README.org delete mode 100644 _tags create mode 100644 jbuild create mode 100644 jbuild-workspace.here delete mode 100644 myocamlbuild.ml create mode 100644 ocaml-google-apps.opam delete mode 100644 opam diff --git a/.merlin b/.merlin index ee8e1e8..0ab9e39 100644 --- a/.merlin +++ b/.merlin @@ -1,3 +1,3 @@ -S . -B _build -PKG js_of_ocaml gen_js_api +B _build/default +FLG -w -40 +PKG gen_js_api diff --git a/META b/META deleted file mode 100644 index 637c944..0000000 --- a/META +++ /dev/null @@ -1,3 +0,0 @@ -description="OCaml binding to Google Apps" -archive(byte)="googleApps.cma" - diff --git a/Makefile b/Makefile deleted file mode 100644 index 32ef8ee..0000000 --- a/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -.PHONY: install uninstall - -install: META googleApps.mli _build/googleApps.cmo _build/googleApps.cmi _build/googleApps.cma - ocamlfind install ocaml-google-apps $^ - -uninstall: - ocamlfind remove ocaml-google-apps - -googleApps.ml: googleApps.mli - ocamlbuild googleApps.ml - -_build/googleApps.cmi: googleApps.mli - ocamlbuild googleApps.cmi - -_build/googleApps.cmo: googleApps.mli googleApps.ml - ocamlbuild googleApps.cmo - -_build/googleApps.cma: googleApps.mli googleApps.ml - ocamlbuild googleApps.cma diff --git a/README.org b/README.org new file mode 100644 index 0000000..4e34166 --- /dev/null +++ b/README.org @@ -0,0 +1,5 @@ +#+TITLE: Utilisation avec opam + +#+BEGIN_SRC +opam install . -y +#+END_SRC diff --git a/_tags b/_tags deleted file mode 100644 index 53d7f68..0000000 --- a/_tags +++ /dev/null @@ -1,4 +0,0 @@ -: package(gen_js_api.ppx) -: package(js_of_ocaml) -: package(gen_js_api), package(js_of_ocaml), linkpkg, no_check_prims,prettyjs - diff --git a/jbuild b/jbuild new file mode 100644 index 0000000..b41bed7 --- /dev/null +++ b/jbuild @@ -0,0 +1,13 @@ +(jbuild_version 1) + +(library( + (name googleApps) + (public_name ocaml-google-apps) + (libraries (gen_js_api)) +)) + +(rule( + (targets (googleApps.ml)) + (deps (googleApps.mli)) + (action (run ${bin:ocamlfind} gen_js_api/gen_js_api ${<})) +)) \ No newline at end of file diff --git a/jbuild-workspace.here b/jbuild-workspace.here new file mode 100644 index 0000000..e69de29 diff --git a/myocamlbuild.ml b/myocamlbuild.ml deleted file mode 100644 index eab8271..0000000 --- a/myocamlbuild.ml +++ /dev/null @@ -1,32 +0,0 @@ -open Ocamlbuild_plugin - -module MyProject = struct - flag ["js_of_ocaml";"prettyjs"](A"--pretty"); - flag ["link";"byte";"ocaml";"program";"no_check_prims"](A"-no-check-prims"); - rule "%.byte -> %js" - ~dep:"%.byte" - ~prod:"%.js" - ( - fun env _ -> - let input = env "%.byte" in - let tags = tags_of_pathname input ++ "js_of_ocaml" in - Cmd(S[A"js_of_ocaml"; T tags; A"+gen_js_api/ojs_runtime.js"; A input]) - ); - rule "%.mli -> %.ml" - ~dep:"%.mli" - ~prod:"%.ml" - ( - fun env _ -> - let input = env "%.mli" in - Cmd(S[A"ocamlfind"; A"gen_js_api/gen_js_api"; A input]) - ) -end - -let () = dispatch ( - function - | Before_options -> - Options.use_ocamlfind := true; - | After_rules -> - () - | _ -> () - ) diff --git a/ocaml-google-apps.opam b/ocaml-google-apps.opam new file mode 100644 index 0000000..6a83a8b --- /dev/null +++ b/ocaml-google-apps.opam @@ -0,0 +1,14 @@ +opam-version: "2.0" +name: "ocaml-google-apps" +version: "0.1" +synopsis: "OCaml binding to Google Apps" +description: """ +Binding to Google Apps using gen_js_api (https://github.com/LexiFi/gen_js_api): +to be used with js_of_ocaml. + +Functions are added/adapted when I need it. +""" +maintainer: "Matthieu Dubuget " +authors: ["Matthieu Dubuget "] +build: [["jbuilder" "build" "-p" name "-j" jobs]] +depends: ["jbuilder" "gen_js_api"] diff --git a/opam b/opam deleted file mode 100644 index 6621a8b..0000000 --- a/opam +++ /dev/null @@ -1,7 +0,0 @@ -opam-version: "1.2" -name: "ocaml-google-apps" -version: "0.1" -maintainer: "Matthieu Dubuget " -install: [make "install"] -remove: [make "uninstall"] -depends: "ocamlfind"