$ git clone https://github.com/obazl/demo_hello.git $ cd demo_hello $ bazel run bin:greetings $ bazel run bin:greetings --tc=ocamlc (0) $ bazel test test $ bazel run @opam (1) $ bazel clean (2) $ bazel build //... (3) $ bazel test //... (4) $ bazel test //... --build_tests_only (5) $ bazel build lib/hello:Hello --config=modinfo (6) $ bazel build lib/hello:Hello --config=modinfo --tc=ocamlc $ bazel build lib/hello:Hello --config=siginfo (7) $ bazel build lib/hello:Hello --config=cmtinfo (8) $ bazel build lib/hello:Hello --config=cmtiinfo (9) $ bazel build lib/goodbye:Goodbye --config=gensig (10) $ bazel run @ocaml $ bazel run @utop $ bazel run @dbg --pgm=bin:greetings (11) $ dune build (12) $ dune run bin/main.exe (13) $ dune test
| 1 | Uses ocamlc.opt compiler. --tc=<compiler> can be used with all cmds here. |
| 2 | Runs opam; shows location of switch. |
| 3 | Forces rebuild. Rarely needed in practice. |
| 4 | Builds all targets |
| 5 | Builds all targets and runs all tests |
| 6 | Runs all tests but only builds targets required by the tests |
| 7 | Runs ocamlobjinfo against hello.cmx (see .bazelrc) |
| 8 | Runs ocamlobjinfo against hello.cmi (see .bazelrc) |
| 9 | Runs ocamlcmt against hello.cmt (see .bazelrc) |
| 10 | Runs ocamlcmt against hello.cmti (see .bazelrc) |
| 11 | Generate interface for goodbye.ml (ocamlc -i) (see .bazelrc) |
| 12 | Runs ocamldebug. See .bazelrc |
| 13 | Dune and Bazel play nice together. |
| 14 | Dune requires that the executable name match a module name. |