2017-03-21 14:06:02 +00:00
|
|
|
(* -*- 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
|
2017-08-11 09:51:26 +00:00
|
|
|
(ignore-outputs (run ${bin:jbuilder} build -j1 --root . @install @runtest))))))
|
2017-03-21 14:06:02 +00:00
|
|
|
|}
|
|
|
|
dir dir
|
|
|
|
|
|
|
|
let () =
|
|
|
|
Array.iter gen_example (Sys.readdir "sample-projects")
|
|
|
|
|
|
|
|
let () = J.send (Buffer.contents buf)
|
|
|
|
|
|
|
|
|