diff --git a/.drom b/.drom index 5737b87e3..14355d301 100644 --- a/.drom +++ b/.drom @@ -80,7 +80,7 @@ c8281f46ba9a11d0b61bc8ef67eaa357:docs/style.css # begin context for dune-project # file dune-project -a33543a542d085c18dea22a9be3de426:dune-project +decae26f4ebc3309c4a1f4d5baa89850:dune-project # end context for dune-project # begin context for opam/cobol_ast.opam diff --git a/Makefile.drom-tpl b/Makefile.drom-tpl new file mode 100644 index 000000000..cda36d312 --- /dev/null +++ b/Makefile.drom-tpl @@ -0,0 +1,88 @@ +# Generated by "drom project" +.PHONY: all build build-deps fmt fmt-check install dev-deps test +.PHONY: clean distclean + +DEV_DEPS := merlin ocamlformat odoc![if:gen:test] ppx_expect ppx_inline_test![fi] + +![if:gen:docs]![if:gen:sphinx] +SPHINX_TARGET:=_drom/docs/!{sphinx-target} +![fi] +ODOC_TARGET:=_drom/docs/!{odoc-target}/. +![fi] + +# Use these non-generated files to include more rules here (and +# Makefile.trailer at the end) +-include Makefile.header +-include Makefile.config + +all: build + +build: + ./scripts/before.sh build + opam exec -- dune build!{build-profile} @install + ./scripts/copy-bin.sh !{packages} + ./scripts/after.sh build + +build-deps: + if ! [ -e _opam ]; then \ + opam switch create . !{edition} --no-install ; \ + fi + opam install ./opam/*.opam --deps-only + +![if:gen:docs] +.PHONY: doc-common odoc view![if:gen:sphinx] sphinx![fi] +doc-common: build + mkdir -p _drom/docs + rsync -auv docs/. _drom/docs/. +![if:gen:sphinx] +sphinx: doc-common + ./scripts/before.sh sphinx ${SPHINX_TARGET} + sphinx-build sphinx ${SPHINX_TARGET} + ./scripts/after.sh sphinx ${SPHINX_TARGET} +![fi] +odoc: doc-common + mkdir -p ${ODOC_TARGET} + ./scripts/before.sh odoc ${ODOC_TARGET} + opam exec -- dune build @doc + rsync -auv --delete _build/default/_doc/_html/. ${ODOC_TARGET} + ./scripts/after.sh odoc ${ODOC_TARGET} + +doc: doc-common odoc![if:gen:sphinx] sphinx![fi] + +view: + xdg-open file://$$(pwd)/_drom/docs/index.html +![fi] +fmt: + opam exec -- dune build @fmt --auto-promote + +fmt-check: + opam exec -- dune build @fmt + +install: + opam pin -y --no-action -k path . + opam install -y . + +opam: + opam pin -k path . + +uninstall: + opam uninstall . + +dev-deps: + opam install ./opam/*.opam --deps-only --with-doc --with-test + +test: + ./scripts/before.sh test + opam exec -- dune build @runtest + ./scripts/after.sh test + +clean: + rm -rf _build + ./scripts/after.sh clean + +distclean: clean + rm -rf _opam _drom + ./scripts/after.sh distclean + +-include Makefile.trailer +!(makefile-trailer) diff --git a/dune-project b/dune-project index 23d086203..fe3187210 100644 --- a/dune-project +++ b/dune-project @@ -3,7 +3,6 @@ (cram enable) (name superbol-vscode-platform) -(allow_approximate_merlin) (generate_opam_files false) (version 0.1.0) (formatting (enabled_for ocaml reason)) diff --git a/dune-project.drom-tpl b/dune-project.drom-tpl new file mode 100644 index 000000000..fb75b9b8e --- /dev/null +++ b/dune-project.drom-tpl @@ -0,0 +1,10 @@ +(lang dune !{dune-lang}) +; This file was generated by drom, using drom.toml +!(dune-project-header) +!{dune-cram} +(name !{name}) +(generate_opam_files false) +(version !{version}) +(formatting (enabled_for ocaml reason)) +!{dune-packages} +!(dune-project-trailer)