Hack to get propper dune dependencies for Version.ml

This commit is contained in:
Your Name 2019-03-01 17:59:58 +01:00
parent 0909650814
commit 15d5f2485d
4 changed files with 10 additions and 8 deletions

1
.gitHEAD Symbolic link
View File

@ -0,0 +1 @@
.git/HEAD

3
.gitignore vendored
View File

@ -3,4 +3,5 @@ _build/*
*~ *~
.merlin .merlin
*/.merlin */.merlin
*.install *.install
/Version.ml

View File

@ -1 +0,0 @@
let version = "7445e9c0"

13
dune
View File

@ -41,13 +41,14 @@
) )
(rule (rule
(targets vera) (targets Version.gitHEAD)
(deps hd) (deps .gitHEAD)
(action (run "sh" "-c" "if git symbolic-ref HEAD; then ln -s ../../.git/\"$(git symbolic-ref HEAD)\" vera; else ln -s hd vera; fi")) (action (run "sh" "-c" "if git symbolic-ref HEAD; then ln -s ../../.git/\"$(git symbolic-ref HEAD)\" Version.gitHEAD; else ln -s hd Version.gitHEAD; fi"))
) )
(rule (rule
(targets verb) (targets Version.ml)
(deps vera) (deps Version.gitHEAD)
(action (run "sh" "-c" "cat vera > verb")) (action (run "sh" "-c" "printf 'let version = \"%s\"'\\\\n \"$(cat Version.gitHEAD)\" > Version.ml"))
(mode promote-until-clean)
) )