Skip to content

Commit

Permalink
Merge pull request #1104 from rgrinberg/fix-1103
Browse files Browse the repository at this point in the history
Fix 1103
  • Loading branch information
rgrinberg authored Aug 7, 2018
2 parents 58d0ccb + f74a064 commit b616c7e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
next
----

- Fix `$ jbuilder --dev` (#1104, fixes #1103, @rgrinberg)


1.1.0 (06/08/2018)
------------------

Expand Down
7 changes: 4 additions & 3 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,10 @@ let common =
& info ["dev"] ~docs
~doc:{|Same as $(b,--profile dev)|})
in
match dev with
| false -> `Ok false
| true ->
match dev, Which_program.t with
| false, (Dune | Jbuilder) -> `Ok false
| true, Jbuilder -> `Ok true
| true, Dune ->
`Error
(true, "--dev is no longer accepted as it is now the default.")
and profile =
Expand Down
10 changes: 10 additions & 0 deletions test/blackbox-tests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@
test-cases/depend-on-the-universe
(progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))

(alias
(name dev-flag-1103)
(deps (package dune) (source_tree test-cases/dev-flag-1103))
(action
(chdir
test-cases/dev-flag-1103
(progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))

(alias
(name dune-jbuild-var-case)
(deps (package dune) (source_tree test-cases/dune-jbuild-var-case))
Expand Down Expand Up @@ -755,6 +763,7 @@
(alias custom-build-dir)
(alias dep-vars)
(alias depend-on-the-universe)
(alias dev-flag-1103)
(alias dune-jbuild-var-case)
(alias dune-ppx-driver-system)
(alias dune-project-edition)
Expand Down Expand Up @@ -848,6 +857,7 @@
(alias custom-build-dir)
(alias dep-vars)
(alias depend-on-the-universe)
(alias dev-flag-1103)
(alias dune-jbuild-var-case)
(alias dune-ppx-driver-system)
(alias dune-project-edition)
Expand Down
11 changes: 11 additions & 0 deletions test/blackbox-tests/test-cases/dev-flag-1103/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
jbuilder --dev flag is accepted

$ jbuilder build --dev

dune --dev flag is rejected

$ dune build --dev
dune: --dev is no longer accepted as it is now the default.
Usage: dune build [OPTION]... [TARGET]...
Try `dune build --help' or `dune --help' for more information.
[1]

0 comments on commit b616c7e

Please sign in to comment.