(lang dune 2.8)
(using menhir 2.0)
(implicit_transitive_deps false)

(name atd)
(license MIT)

(maintainers
  "Louis Roché <louis@louisroche.net>"
  "Martin Jambon <martin@mjambon.com>"
  "Rudi Grinberg <me@rgrinberg.com>"
)

(authors
; All authors according to git log, sorted by decreasing number of commits.
; Re-generate with:
; git shortlog -s -e -n --all | cut -f2 | sed -e 's/^\(.*\)$/ "\1"/'

 "Martin Jambon <martin@mjambon.com>"
 "Rudi Grinberg <rudi.grinberg@gmail.com>"
 "Martin Jambon <martin@r2c.dev>"
 "Martin Jambon <github@mjambon.com>"
 "Ivan Jager <aij+git@mrph.org>"
 "oleksiy <oleksiy.golovko@ahrefs.com>"
 "David Sheets <sheets@alum.mit.edu>"
 "Rudi Grinberg <me@rgrinberg.com>"
 "Martin Jambon <martin@esper.com>"
 "Jeff Meister <nanaki@gmail.com>"
 "Caio Wakamatsu <caio.wakamatsu@ahrefs.com>"
 "Carmelo Piccione <carmelo.piccione@gmail.com>"
 "Daniel Weil <danweil68@gmail.com>"
 "Egor Chemokhonenko <egor.chemohonenko@ahrefs.com>"
 "Gabriel Scherer <gabriel.scherer@gmail.com>"
 "Raman Varabets <roman.vorobets@gmail.com>"
 "tzm <frank@boldsolutions.de>"
 "Mathieu Baudet <mathieubaudet@fb.com>"
 "Oleksiy Golovko <alexei.golovko@gmail.com>"
 "Rauan Mayemir <rauan@mayemir.io>"
 "Carmelo Piccione <cep1@solvuu.com>"
 "John Billings <john@monkeynut.org>"
 "Louis Roché <louis@louisroche.net>"
 "Brendan Long <self@brendanlong.com>"
 "Chris Yocum <cyocum@gmail.com>"
 "Louis Roché (Ahrefs) <louis.roche@ahrefs.com>"
 "Louis Roché <louis.roche@ahrefs.com>"
 "Pavel Antoshkin <pavel.antoshkin@ahrefs.com>"
 "Pierre Boutillier <pierre.boutillier@laposte.net>"
 "Shon Feder <shon.feder@key.me>"
 "Anurag Soni <anuragsoni.13@gmail.com>"
 "Arjun Ravi Narayan <arjunravinarayan@gmail.com>"
 "Asya-kawai <kawai-toshiki@aintek.xyz>"
 "Christophe Troestler <christophe.Troestler@umons.ac.be>"
 "Damien Doligez <ddoligez@janestreet.com>"
 "Daniel M <dan.mntg@gmail.com>"
 "Ding Xiang Fei <dingxiangfei2009@protonmail.ch>"
 "François Pottier <francois.pottier@inria.fr>"
 "Javier Chavarri <javier.chavarri@gmail.com>"
 "Kate <kit.ty.kate@disroot.org>"
 "Louis <louis.roche@ahrefs.com>"
 "Louis Roché <louis@cryptosense.com>"
 "Raman Varabets <raman+git@ahrefs.com>"
 "Stephane Legrand <slegrand45@gmail.com>"
 "Vincent Bernardoff <vb@luminar.eu.org>"
 "haoyang <haoyang@esper.co>"
 "pmundkur <prashanth.mundkur@gmail.com>"
 "ygrek <ygrek@autistici.org>"
)

(source (github ahrefs/atd))

(generate_opam_files true)

(package
 (name atd)
 (depends
  (ocaml (>= 4.08))
  ; 20211230 has a bug when parsing variants with a payload https://github.com/ahrefs/atd/pull/272
  ; preserve the ability to compile with older versions because recent ones create slow builds
  ; https://github.com/returntocorp/pfff/issues/512
  (menhir (and (>= 20180523) (<> 20211230)))
  easy-format
  (alcotest :with-test)
  (odoc :with-doc)
  (re (>= 1.9.0))
  (yojson (>= 1.6.0))
  (cmdliner (>= 1.1.0))
 )
 (synopsis "Parser for the ATD data format description language")
 (description "\
ATD is the OCaml library providing a parser for the ATD language and various
utilities. ATD stands for Adjustable Type Definitions in reference to its main
property of supporting annotations that allow a good fit with a variety of data
formats. This package also provides the 'atdcat' and 'atddiff' command-line
utilities."))

(package
 (name atdgen)
 (depends
  (ocaml (>= 4.08))
  (alcotest :with-test)
  (atd (>= 2.14.0))
  (atdgen-runtime (>= 2.1.0))
  (atdgen-codec-runtime :with-test)
  (biniou (>= 1.0.6))
  (yojson (>= 2.0.1))
  (odoc :with-doc)
  re
 )
 (synopsis "Generates efficient JSON serializers, deserializers and validators")
 (description "\
Atdgen is a command-line program that takes as input type definitions in the ATD
syntax and produces OCaml code suitable for data serialization and
deserialization.
Two data formats are currently supported, these are biniou and JSON.
Atdgen-biniou and Atdgen-json will refer to Atdgen used in one context or the
other.
Atdgen was designed with efficiency and durability in mind. Software authors are
encouraged to use Atdgen directly and to write tools that may reuse part of
Atdgen’s source code."))

(package
 (name atdgen-runtime)
 (synopsis "Runtime library for code generated by atdgen")
 (description "\
This package should be used only in conjunction with the atdgen code
generator")
 (depends
  (ocaml (>= 4.08))
  (yojson (>= 2.0.2))
  (biniou (>= 1.0.6))
  (odoc :with-doc)))

(package
 (name atdj)
 (synopsis "Java code generation for ATD")
 (description "\
Atdj is a program that generates a Java interface from type definitions. In
particular, given a set of ATD type definitions, this tool generates a set of
Java classes representing those types with built-in JSON serializers and
deserializers

The primary benefits of using the generated interface, over manually
manipulating JSON strings from within Java, are safety and ease of use.
Specifically, the generated interface offers the following features:

- JSON strings are automatically checked for correctness with respect to the ATD
specification.

- Details such as optional fields and their associated default values are
automatically handled")
 (depends
  (ocaml (>= 4.08))
  (atd (>= 2.7.0))
  re
  (odoc :with-doc)))

(package
 (name atds)
 (synopsis "ATD Code generator for Scala")
 (description "ATD Code generator for Scala")
 (depends
  (ocaml (>= 4.08))
  (atd (>= 2.7.0))
  (odoc :with-doc)))

(package
 (name atdpy)
 (synopsis "Python/mypy code generation for ATD APIs")
 (description "Python/mypy code generation for ATD APIs")
 (depends
  (ocaml (>= 4.08))
  (atd (>= 2.11.0))
  (cmdliner (>= 1.1.0))
  re
  (alcotest :with-test)
  (conf-python-3 :with-test)
  (odoc :with-doc)))

(package
 (name atdgen-codec-runtime)
 (synopsis "Runtime for atdgen generated bucklescript converters")
 (description "\
This library contains the types that are used by atdgen's
bucklescript backend")
 (depends
  (ocaml (>= 4.08))
  (odoc :with-doc)))

(package
 (name atdts)
 (synopsis "TypeScript code generation for ATD APIs")
 (description "TypeScript code generation for ATD APIs")
 (depends
  (ocaml (>= 4.08))
  (atd (>= 2.13.0))
  (cmdliner (>= 1.1.0))
  re
  (alcotest :with-test)
  (odoc :with-doc)))


(package
 (name atdd)
 (synopsis "DLang code generation for ATD APIs")
 (description "DLang code generation for ATD APIs")
 (depends
  (ocaml (>= 4.08))
  (atd (>= 2.11.0))
  (cmdliner (>= 1.1.0))
  re
  (odoc :with-doc)))
