From 28f0a7ccc57d9848b7bd3150e9b3ab8e028edc93 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 19 Dec 2014 13:40:16 +0100 Subject: [PATCH] doc/build_deps.ml to display the dependency graph in dot --- _oasis | 1 - doc/build_deps.ml | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 doc/build_deps.ml diff --git a/_oasis b/_oasis index b6123d99..106138fc 100644 --- a/_oasis +++ b/_oasis @@ -151,7 +151,6 @@ Document containers containers.advanced, containers.io, containers.sexp, containers.lwt - Executable run_benchs Path: benchs/ Install: false diff --git a/doc/build_deps.ml b/doc/build_deps.ml new file mode 100755 index 00000000..5386c641 --- /dev/null +++ b/doc/build_deps.ml @@ -0,0 +1,26 @@ +#!/usr/bin/env ocaml + +#use "topfind";; +#require "containers";; +#require "containers.io";; +#require "gen";; +#require "unix";; + +let odoc_files = + CCIO.File.walk "_build" + |> Gen.filter_map + (function + | `File, f when CCString.suffix ~suf:".odoc" f -> Some f + | _ -> None + ) + |> Gen.flat_map + (fun f -> Gen.of_list ["-load"; f]) + |> Gen.to_list +;; + +let cmd = + "ocamldoc -dot -o deps.dot " ^ String.concat " " odoc_files +;; + +print_endline ("run: " ^ cmd);; +Unix.system cmd;;