Substitute watermarks for jbuilder itself

This commit is contained in:
Jeremie Dimino 2017-05-07 20:48:10 +01:00 committed by Jeremie Dimino
parent 87df38d1f6
commit 6d0c8198eb
3 changed files with 6 additions and 1 deletions

View File

@ -646,7 +646,7 @@ let subst =
what topkg does in the default configuration.|}
; `P {|If you use topkg to handle the releases of your project, then you
should add this line to the $(b,build:) instructions in your opam file:|}
; `Pre {| ["jbuilder" "subst" name]|}
; `Pre {| ["jbuilder" "subst" name] {pinned}|}
; `Blocks help_secs
]
in

View File

@ -7,6 +7,7 @@ dev-repo: "git+https://github.com/janestreet/jbuilder.git"
license: "Apache-2.0"
build: [
["ocaml" "bootstrap.ml"]
["./boot.exe" "--subst"] {pinned}
["./boot.exe" "-j" jobs]
]
depends: [

View File

@ -159,11 +159,15 @@ let bootstrap () =
let pkg = "jbuilder" in
let main () =
let anon s = raise (Arg.Bad (Printf.sprintf "don't know what to do with %s\n" s)) in
let subst () =
Future.Scheduler.go (Watermarks.subst ~package:"jbuilder")
in
Arg.parse
[ "-j" , Set_int Clflags.concurrency, "JOBS concurrency"
; "--dev" , Set Clflags.dev_mode , " set development mode"
; "--debug-rules", Set Clflags.debug_rules , " print out rules"
; "--verbose" , Set Clflags.verbose , " print detailed information about commands being run"
; "--subst" , Unit subst , " substitute watermarks in source files"
]
anon "Usage: boot.exe [-j JOBS] [--dev]\nOptions are:";
let log = Log.create () in