diff --git a/bin/main.ml b/bin/main.ml index 719b5333..da770d25 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -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 diff --git a/jbuilder.opam b/jbuilder.opam index d8e25cfb..92fed522 100644 --- a/jbuilder.opam +++ b/jbuilder.opam @@ -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: [ diff --git a/src/main.ml b/src/main.ml index 2e9f8fa3..b682bfa6 100644 --- a/src/main.ml +++ b/src/main.ml @@ -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