(* -*- tuareg -*- *)
#require "unix"

let version =
  let ic = open_in "../VERSION" in
  let version = input_line ic in
  close_in ic;
  version

let () = Printf.ksprintf Jbuild_plugin.V1.send {|
(jbuild_version 1)

(ocamllex (atd_lexer atd_doc_lexer))
(menhir ((modules (atd_parser))))

(rule
 ((targets (atd_version.ml))
  (action
   (with-stdout-to ${@}
    (echo "let version = \"%s\"")))))

(library
 ((name atd)
  (public_name atd)
  (wrapped false)
  (libraries (easy-format unix str))))
|} version
