From 799d51be304e219ef889621cb9425b2d50a590b1 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Tue, 21 Mar 2017 14:06:02 +0000 Subject: [PATCH] Setup examples --- example/jbuild | 27 +++++++++++++++++++++++++++ example/jbuild-ignore | 1 + 2 files changed, 28 insertions(+) create mode 100644 example/jbuild create mode 100644 example/jbuild-ignore diff --git a/example/jbuild b/example/jbuild new file mode 100644 index 00000000..a1fd8a54 --- /dev/null +++ b/example/jbuild @@ -0,0 +1,27 @@ +(* -*- tuareg -*- *) + +module J = Jbuild_plugin.V1 + +let example_dir = "sample-projects" + +let buf = Buffer.create 1024 +let () = Buffer.add_string buf "(jbuild_version 1)\n" + +let gen_example example = + let dir = Printf.sprintf "%s/%s" example_dir example in + Printf.bprintf buf {| +(alias + ((name runtest) + (deps ((files_recursively_in %s))) + (action + (chdir %s + (run ${exe:../test/run.exe} -- ${bin:jbuilder} build -j1 --root . @install))))) +|} + dir dir + +let () = + Array.iter gen_example (Sys.readdir "sample-projects") + +let () = J.send (Buffer.contents buf) + + diff --git a/example/jbuild-ignore b/example/jbuild-ignore new file mode 100644 index 00000000..9741c984 --- /dev/null +++ b/example/jbuild-ignore @@ -0,0 +1 @@ +sample-projects