learn-ocaml
learn-ocaml copied to clipboard
[build] Generate `given_exo.{cmi,cmo,cmt}` files
-
Kind: feature
-
Address #414 first (disabling broken option
learn-ocaml build --jobs=2)
Description
- Add option
learn-ocaml build --enable-cmo-build - This new experimental option is on by default (implicit mode) and generates
given_exo.{cmi,cmo,cmt}in the www folder for eachprelude ^ " ;;\n" ^ prepare. - This is a key feature for learn-ocaml.el (the Tuareg/Merlin frontend for Learn-OCaml); it can be disabled using the flag:
$ learn-ocaml build --disable-cmo-build - If the www/exo.json file is up-to-date, the
exo.cm*are not built. - But we can force the
exo.cm*build (explicit mode) even for un-changed exercises using the flag:$ learn-ocaml build --enable-cmo-build - This option may later become mandatory if/when the js_of_ocaml front-end also fetches similar
*.cmofiles. - Regarding the
ocamlcnaming convention:
require that the input exercise id basenameexo-namematches[0-9A-Za-z_-]+, otherwise raise a warning,
then bijectively replace_→_0and-→_1inexo, then yield the output filenamedir/given_exo_1name.cmo.
Checklist
- [x] Read the CONTRIBUTING.md guide.
- [x] Add/update tests
- [ ] Implement the
learn-ocaml-clientcounterpart of this feature within this PR
Note to maintainers
- Read this wiki page
- Make sure the PR has a milestone
- Assign yourself before merging (using a regular
Mergefor this one)