Skip to content

Commit

Permalink
Improve generated dune-project template
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed Apr 5, 2019
1 parent 4297f27 commit 6b5788a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dune_project.ml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ module Project_file_edit = struct
else begin
let ver = !default_dune_language_version in
let lines =
[sprintf "(lang dune %s)" (Syntax.Version.to_string ver)]
[ sprintf "(lang dune %s)" (Syntax.Version.to_string ver)
; sprintf ";; (explicit_js_mode) ;; uncomment to only enable js \
targets with (modes js)"
; sprintf ";; (implicit_transitive_deps false) ;; uncomment to \
disallow transitive deps"
]
in
let lines =
match t.project_name with
Expand Down
8 changes: 8 additions & 0 deletions test/blackbox-tests/test-cases/dune-init/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Can build the public library
$ cd _test_lib_dir && touch test_lib.opam && dune build
Info: creating file dune-project with this contents:
| (lang dune 1.9)
| ;; (explicit_js_mode) ;; uncomment to only enable js targets with (modes js)
| ;; (implicit_transitive_deps false) ;; uncomment to disallow transitive deps
| (name test_lib)

$ cat ./_test_lib_dir/dune
Expand Down Expand Up @@ -63,6 +65,8 @@ Can build an executable
$ cd _test_bin_dir && touch test_bin.opam && dune build
Info: creating file dune-project with this contents:
| (lang dune 1.9)
| ;; (explicit_js_mode) ;; uncomment to only enable js targets with (modes js)
| ;; (implicit_transitive_deps false) ;; uncomment to disallow transitive deps
| (name test_bin)


Expand Down Expand Up @@ -144,6 +148,8 @@ Can build the combo project
$ cd _test_lib_exe_dir && touch test_bin.opam && dune build
Info: creating file dune-project with this contents:
| (lang dune 1.9)
| ;; (explicit_js_mode) ;; uncomment to only enable js targets with (modes js)
| ;; (implicit_transitive_deps false) ;; uncomment to disallow transitive deps
| (name test_bin)


Expand Down Expand Up @@ -179,6 +185,8 @@ Can build the multiple library project
$ cd _test_lib && touch test_lib1.opam && dune build
Info: creating file dune-project with this contents:
| (lang dune 1.9)
| ;; (explicit_js_mode) ;; uncomment to only enable js targets with (modes js)
| ;; (implicit_transitive_deps false) ;; uncomment to disallow transitive deps
| (name test_lib1)


Expand Down
6 changes: 6 additions & 0 deletions test/blackbox-tests/test-cases/dune-project-edition/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
$ dune build
Info: creating file dune-project with this contents:
| (lang dune 1.9)
| ;; (explicit_js_mode) ;; uncomment to only enable js targets with (modes js)
| ;; (implicit_transitive_deps false) ;; uncomment to disallow transitive deps

$ cat dune-project
(lang dune 1.9)
;; (explicit_js_mode) ;; uncomment to only enable js targets with (modes js)
;; (implicit_transitive_deps false) ;; uncomment to disallow transitive deps

Test that using menhir automatically update the dune-project file

Expand All @@ -16,4 +20,6 @@ Test that using menhir automatically update the dune-project file
Info: appending this line to dune-project: (using menhir 2.0)
$ cat dune-project
(lang dune 1.9)
;; (explicit_js_mode) ;; uncomment to only enable js targets with (modes js)
;; (implicit_transitive_deps false) ;; uncomment to disallow transitive deps
(using menhir 2.0)
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/github1529/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ file is present.
$ dune build
Info: creating file dune-project with this contents:
| (lang dune 1.9)
| ;; (explicit_js_mode) ;; uncomment to only enable js targets with (modes js)
| ;; (implicit_transitive_deps false) ;; uncomment to disallow transitive deps

Info: appending this line to dune-project: (using menhir 2.0)
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/upgrader/run.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
$ dune upgrade
Info: creating file dune-project with this contents:
| (lang dune 1.0)
| ;; (explicit_js_mode) ;; uncomment to only enable js targets with (modes js)
| ;; (implicit_transitive_deps false) ;; uncomment to disallow transitive deps
| (name foo)

Upgrading foo.opam...
Expand Down

0 comments on commit 6b5788a

Please sign in to comment.