-
Notifications
You must be signed in to change notification settings - Fork 16
/
dune
32 lines (27 loc) · 831 Bytes
/
dune
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(* -*- tuareg -*- *)
open Jbuild_plugin.V1
let git_version = "no-git-version-"
(* Disable git version checking because it can cause problems when
being used as a "pin" - where there is a .git directory due to
a shallow checkout, but it isn't an actual git repository. *)
(* if not (try Sys.is_directory ".git" with _ -> false)
then ""
else
match run_and_read_lines "git log -n1 --pretty=format:%h" with
| version :: _ -> version
| [] -> "" *)
let version =
let ic = open_in "VERSION" in
let version = input_line ic in
close_in ic;
version
let () = send @@ Printf.sprintf {|
(env
(dev
(flags
(:standard -w +a-4-40-41-42-44-48-58))))
(rule
(targets version.ml.in)
(action (with-stdout-to %%{targets}
(echo "let s = \"%s\"\nlet git_version = \"%s\""))))
|} version git_version