Skip to content

Commit

Permalink
Reformat dune files
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Nov 29, 2024
1 parent ad1676f commit a0b5b8c
Show file tree
Hide file tree
Showing 29 changed files with 471 additions and 95 deletions.
49 changes: 42 additions & 7 deletions benchmarks/sources/ml/dune
Original file line number Diff line number Diff line change
@@ -1,14 +1,49 @@
(executables
(names almabench bdd binary_trees boyer boyer_no_exc fannkuch_redux_2
fannkuch_redux fft fib hamming kb kb_no_exc loop nucleic quicksort raytrace
soli splay takc taku))
(names
almabench
bdd
binary_trees
boyer
boyer_no_exc
fannkuch_redux_2
fannkuch_redux
fft
fib
hamming
kb
kb_no_exc
loop
nucleic
quicksort
raytrace
soli
splay
takc
taku))

(alias
(name benchmark)
(deps almabench.exe bdd.exe binary_trees.exe boyer.exe boyer_no_exc.exe
fannkuch_redux_2.exe fannkuch_redux.exe fft.exe fib.exe hamming.exe kb.exe
kb_no_exc.exe loop.exe nucleic.exe quicksort.exe raytrace.exe soli.exe
splay.exe takc.exe taku.exe))
(deps
almabench.exe
bdd.exe
binary_trees.exe
boyer.exe
boyer_no_exc.exe
fannkuch_redux_2.exe
fannkuch_redux.exe
fft.exe
fib.exe
hamming.exe
kb.exe
kb_no_exc.exe
loop.exe
nucleic.exe
quicksort.exe
raytrace.exe
soli.exe
splay.exe
takc.exe
taku.exe))

(env
(_
Expand Down
5 changes: 4 additions & 1 deletion compiler/bin-js_of_ocaml/dune
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
(install
(section man)
(package js_of_ocaml-compiler)
(files js_of_ocaml.1 js_of_ocaml-link.1 js_of_ocaml-build-fs.1
(files
js_of_ocaml.1
js_of_ocaml-link.1
js_of_ocaml-build-fs.1
js_of_ocaml-build-runtime.1))

;; Generate and install runtime.js for compatibility reasons
Expand Down
7 changes: 5 additions & 2 deletions compiler/bin-wasm_of_ocaml/dune
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@

(rule
(target wa_runtime.ml)
(deps gen/gen.exe ../../runtime/wasm/runtime.wasm
../../runtime/wasm/runtime.js ../../runtime/wasm/deps.json)
(deps
gen/gen.exe
../../runtime/wasm/runtime.wasm
../../runtime/wasm/runtime.js
../../runtime/wasm/deps.json)
(action
(with-stdout-to
%{target}
Expand Down
4 changes: 3 additions & 1 deletion compiler/lib-dynlink/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
(foreign_stubs
(language c)
(names stubs))
(libraries js_of_ocaml-compiler js_of_ocaml-compiler.runtime
(libraries
js_of_ocaml-compiler
js_of_ocaml-compiler.runtime
compiler-libs.bytecomp))
24 changes: 20 additions & 4 deletions compiler/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
(name js_of_ocaml_compiler)
(public_name js_of_ocaml-compiler)
(synopsis "Js_of_ocaml compiler library")
(libraries compiler-libs.common compiler-libs.bytecomp menhirLib sedlex
(libraries
compiler-libs.common
compiler-libs.bytecomp
menhirLib
sedlex
yojson)
(flags
(:standard -w -7-37 -safe-string))
Expand All @@ -13,9 +17,21 @@

(menhir
(modules js_parser)
(flags --table --external-tokens Js_token --explain --unused-token TAnnot
--unused-token TComment --unused-token TCommentLineDirective --unused-token
T_ERROR --unused-token T_AT))
(flags
--table
--external-tokens
Js_token
--explain
--unused-token
TAnnot
--unused-token
TComment
--unused-token
TCommentLineDirective
--unused-token
T_ERROR
--unused-token
T_AT))

(menhir
(modules annot_parser)
Expand Down
36 changes: 30 additions & 6 deletions compiler/tests-check-prim/dune
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:main.bc}))))

(rule
Expand All @@ -37,7 +41,11 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:unix.bc}))))

(rule
Expand All @@ -51,7 +59,11 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:unix.bc}))))

(rule
Expand All @@ -63,7 +75,11 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:main.bc}))))

(rule
Expand All @@ -77,7 +93,11 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:unix.bc}))))

(rule
Expand All @@ -91,5 +111,9 @@
(action
(with-stdout-to
%{targets}
(run %{bin:js_of_ocaml} check-runtime +dynlink.js +toplevel.js
(run
%{bin:js_of_ocaml}
check-runtime
+dynlink.js
+toplevel.js
%{dep:unix.bc}))))
24 changes: 19 additions & 5 deletions compiler/tests-dynlink-js/dune
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@
(target main.js)
(enabled_if %{env:js-enabled=})
(action
(run %{bin:js_of_ocaml} --linkall %{read-strings:effects_flags.txt} -o
%{target} %{dep:main.bc})))
(run
%{bin:js_of_ocaml}
--linkall
%{read-strings:effects_flags.txt}
-o
%{target}
%{dep:main.bc})))

(rule
(target plugin.cmo)
Expand All @@ -50,19 +55,28 @@
(rule
(target plugin.js)
(action
(run %{bin:js_of_ocaml} %{read-strings:effects_flags.txt}
(run
%{bin:js_of_ocaml}
%{read-strings:effects_flags.txt}
%{dep:./plugin.cmo})))

(rule
(target plugin2.cma)
(action
(run %{bin:ocamlc} -a %{dep:./plugin2a.ml} %{dep:./plugin2b.ml} -o
(run
%{bin:ocamlc}
-a
%{dep:./plugin2a.ml}
%{dep:./plugin2b.ml}
-o
plugin2.cma)))

(rule
(target plugin2.js)
(action
(run %{bin:js_of_ocaml} %{read-strings:effects_flags.txt}
(run
%{bin:js_of_ocaml}
%{read-strings:effects_flags.txt}
%{dep:./plugin2.cma})))

(rule
Expand Down
9 changes: 8 additions & 1 deletion compiler/tests-dynlink/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
(enabled_if %{env:js-enabled=})
(deps plugin.cmo export)
(action
(run %{bin:js_of_ocaml} --dynlink --export export --pretty -o %{target}
(run
%{bin:js_of_ocaml}
--dynlink
--export
export
--pretty
-o
%{target}
%{dep:main.bc})))

(rule
Expand Down
14 changes: 12 additions & 2 deletions compiler/tests-full/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
(enabled_if
(= %{ocaml_version} "5.2.0"))
(action
(run %{bin:js_of_ocaml} --pretty --debuginfo %{lib:stdlib:stdlib.cma} -o
(run
%{bin:js_of_ocaml}
--pretty
--debuginfo
%{lib:stdlib:stdlib.cma}
-o
%{targets})))

(rule
Expand All @@ -26,7 +31,12 @@
(targets fs.output.js)
(deps file1 file2)
(action
(run %{bin:js_of_ocaml} build-fs -o %{targets} file1:/static/file1
(run
%{bin:js_of_ocaml}
build-fs
-o
%{targets}
file1:/static/file1
file2:/static/dir/file2)))

(rule
Expand Down
10 changes: 8 additions & 2 deletions compiler/tests-jsoo/dune
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@
(library
(name jsoo_testsuite)
(modules
(:standard \ test_io test_floats test_marshal_compressed test_parsing
calc_parser calc_lexer))
(:standard
\
test_io
test_floats
test_marshal_compressed
test_parsing
calc_parser
calc_lexer))
(libraries unix compiler-libs.common js_of_ocaml-compiler)
(foreign_stubs
(language c)
Expand Down
25 changes: 22 additions & 3 deletions compiler/tests-ocaml/lib-effects/dune
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,28 @@
(tests
(build_if
(>= %{ocaml_version} 5))
(names cmphash marshal effects evenodd manylive overflow partial reperform
sched shallow_state_io shallow_state test10 test11 test1 test2 test3 test4
test5 test6 test_lazy used_cont)
(names
cmphash
marshal
effects
evenodd
manylive
overflow
partial
reperform
sched
shallow_state_io
shallow_state
test10
test11
test1
test2
test3
test4
test5
test6
test_lazy
used_cont)
(modules
(:standard \ unhandled_unlinked))
(modes js wasm))
Expand Down
4 changes: 3 additions & 1 deletion dune
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
(action
(with-stdout-to
%{targets}
(run %{dep:tools/version/gen/gen.exe} %{dep:VERSION}
(run
%{dep:tools/version/gen/gen.exe}
%{dep:VERSION}
%{dep:tools/version/GIT-VERSION}))))

(data_only_dirs _wikidoc doc-dev)
13 changes: 11 additions & 2 deletions examples/boulderdash/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@
(deps
(glob_files maps/*.map))
(action
(run %{bin:js_of_ocaml} --source-map %{dep:boulderdash.bc} -o %{targets}
--pretty --file %{dep:maps.txt} --file maps)))
(run
%{bin:js_of_ocaml}
--source-map
%{dep:boulderdash.bc}
-o
%{targets}
--pretty
--file
%{dep:maps.txt}
--file
maps)))

(alias
(name default)
Expand Down
7 changes: 6 additions & 1 deletion examples/cubes/dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
(rule
(targets cubes.js)
(action
(run %{bin:js_of_ocaml} --source-map %{dep:cubes.bc} -o %{targets}
(run
%{bin:js_of_ocaml}
--source-map
%{dep:cubes.bc}
-o
%{targets}
--pretty)))

(alias
Expand Down
Loading

0 comments on commit a0b5b8c

Please sign in to comment.