catala/french_law/ocaml/law_source/dune
Louis Gesbert 0600501ec6 Generate french_law artifacts through dune
The files where manually generated through Makefile rules, and
versionned (with an outdated version).

The issue was that we had:
- `dune` building Catala
- Makefiles calling `catala` to build and copy the `french_law/ocaml/law_source`
  files
- then `dune` again to build `french_law`

The result was that `dune build` (without running `make` first) would
return a weird error.

The proposed solution adds ad-hoc dune rules to call the catala
binary, so that it can handle the whole pipeline correctly. If OCaml
is purely a backend, though, a simpler solution that makes us less
dependent on dune would be to handle the compilation of `french_law`
manually.

The dune rules are set to 'promote' the files so that it preserves the
fact that they are versionned (but with no confusion of the build system
about where they should come from anymore)
2022-08-03 18:55:42 +02:00

31 lines
714 B
Plaintext

(library
(name law_source)
(public_name french_law.law_source)
(preprocess
(pps js_of_ocaml-ppx))
(libraries catala.runtime_ocaml catala.runtime_jsoo js_of_ocaml))
(rule
(target allocations_familiales.ml)
(mode promote)
(action
(copy ../../../examples/allocations_familiales/%{target} %{target})))
(rule
(target allocations_familiales_api_web.ml)
(mode promote)
(action
(copy ../../../examples/allocations_familiales/%{target} %{target})))
(rule
(target aides_logement.ml)
(mode promote)
(action
(copy ../../../examples/aides_logement/%{target} %{target})))
(rule
(target aides_logement_api_web.ml)
(mode promote)
(action
(copy ../../../examples/aides_logement/%{target} %{target})))