; Generate app_config.ml + app_config.mli from app_config.atd using atdml.
; --mode jsonlike ensures jsonlike readers are generated,
; since main.ml uses app_config_of_jsonlike.
(rule
 (targets app_config.ml app_config.mli)
 (deps    app_config.atd)
 (action  (run %{bin:atdml} --mode jsonlike %{deps})))

; This has more dependencies than the bare atd-yamlx library.
; It's fine because this executable is not declared as part of the atd-yamlx
; package and it's not public (no public_name).
(executable
 (name main)
 (libraries atd-yamlx atd-jsonlike yamlx yojson))

; Run the example as part of 'dune runtest atd-yamlx'.
(rule
 (alias runtest)
 (deps config.yaml)
 (action (run %{exe:main.exe})))
