name:          apigen
version:       0.0.2
synopsis:      FFI API generator for several languages
description:   Supports a specific way of defining C APIs and generates bindings for various languages for them.
homepage:      https://toktok.github.io/apigen
license:       GPL-3
license-file:  LICENSE
author:        iphydf
maintainer:    iphydf@users.noreply.github.com
category:      Development
build-type:    Simple
cabal-version: >=1.10

source-repository head
  type:     git
  location: https://github.com/TokTok/apigen

library
  default-language: Haskell2010
  exposed-modules:
    Apigen.Language.Apidsl
    Apigen.Language.Haskell
    Apigen.Language.PyDsl
    Apigen.Parser
    Apigen.Parser.InferClasses
    Apigen.Parser.InferGenerated
    Apigen.Parser.InferNamespace
    Apigen.Parser.InferProperties
    Apigen.Parser.InferSections
    Apigen.Parser.InferSizedGet
    Apigen.Parser.InferSizedParam
    Apigen.Parser.Query
    Apigen.Parser.SymbolNumbers
    Apigen.Parser.SymbolTable
    Apigen.Patterns
    Apigen.Types

  ghc-options:      -Wall
  hs-source-dirs:   src
  build-depends:
      base            >=4       && <5
    , aeson
    , casing          <0.2
    , cimple          >=0.0.19
    , data-fix        <0.4
    , extra
    , insert-ordered-containers
    , mtl             <3
    , prettyprinter
    , prettyprinter-ansi-terminal
    , text            <3
    , unordered-containers

executable apigen
  default-language: Haskell2010
  hs-source-dirs:   tools
  ghc-options:      -Wall
  main-is:          apigen.hs
  build-depends:
      base      <5
    , apigen
    , cimple
    , text

executable dump-model
  default-language: Haskell2010
  hs-source-dirs:   tools
  ghc-options:      -Wall
  main-is:          dump-model.hs
  build-depends:
      base      <5
    , aeson
    , apigen
    , bytestring
    , cimple
    , text

test-suite testsuite
  type:               exitcode-stdio-1.0
  default-language:   Haskell2010
  hs-source-dirs:     test
  main-is:            testsuite.hs
  other-modules:
    Apigen.Language.HaskellSpec

  ghc-options:        -Wall -Wno-unused-imports
  build-tool-depends: hspec-discover:hspec-discover
  build-depends:
      base      <5
    , apigen
    , cimple
    , hspec     <3
    , text