(library
 (name dose_common)
 (public_name dose3.common)
 (libraries extlib cudf zip bz2 re.pcre)
 (flags (:standard)))

(ocamllex shell_lexer)

(ocamllex format822_lexer)

(ocamllex criteria_lexer)

(ocamlyacc format822_parser)

(ocamlyacc criteria_parser)

(rule
 (target versionInfo.ml)
 (action
  (with-stdout-to
   %{target}
   (echo "let version = \"%{version:dose3}\""))))

(rule
 (targets gitVersionInfo.ml)
 ; Ensures the hash update whenever a source file is modified ;
 (deps
  (source_tree %{workspace_root})
  (:script get-git-info.mlt))
 (action
  (with-stdout-to
   %{targets}
   (run %{ocaml} unix.cma %{script}))))

(rule
 (alias runtest)
 (action
  (chdir
   ../../
   (run ./src/common/tests/tests.exe))))
