cabal-version:       3.6

-- Copyright (c) Facebook, Inc. and its affiliates.

name:                thrift-compiler
version:             0.1.0.1
synopsis: A compiler from the Thrift Interface Definition Language (IDL) to Haskell
homepage:            https://github.com/facebookincubator/hsthrift
bug-reports:         https://github.com/facebookincubator/hsthrift/issues
license:             BSD-3-Clause
license-file:        LICENSE
author:              Facebook, Inc.
maintainer:          hsthrift-team@fb.com
copyright:           (c) Facebook, All Rights Reserved
category:            Thrift
build-type:          Simple
extra-source-files:  CHANGELOG.md,
                     test/fixtures/**/*.ast,
                     test/fixtures/gen-hs2/**/*.hs,
                     test/if/*.thrift,
                     tests/if/*.thrift,
                     tests/if/*.hs

description:
    A compiler from the Thrift Interface Definition Language (IDL) to Haskell.

    NOTE: for build instructions and documentation, see
    <https://github.com/facebookincubator/hsthrift>

source-repository head
    type: git
    location: https://github.com/facebookincubator/hsthrift.git

common fb-haskell
    default-language: Haskell2010
    default-extensions:
        BangPatterns
        BinaryLiterals
        DataKinds
        DeriveDataTypeable
        DeriveGeneric
        EmptyCase
        ExistentialQuantification
        FlexibleContexts
        FlexibleInstances
        GADTs
        GeneralizedNewtypeDeriving
        LambdaCase
        MultiParamTypeClasses
        MultiWayIf
        NoMonomorphismRestriction
        OverloadedStrings
        PatternSynonyms
        RankNTypes
        RecordWildCards
        ScopedTypeVariables
        StandaloneDeriving
        TupleSections
        TypeFamilies
        TypeSynonymInstances
        NondecreasingIndentation

library
    import: fb-haskell
    hs-source-dirs: . plugins
    exposed-modules:
        Thrift.Compiler
        Thrift.Compiler.GenClient
        Thrift.Compiler.GenConst
        Thrift.Compiler.GenEnum
        Thrift.Compiler.GenFunction
        Thrift.Compiler.GenHaskell
        Thrift.Compiler.GenJSON
        Thrift.Compiler.GenJSONLoc
        Thrift.Compiler.GenService
        Thrift.Compiler.GenStruct
        Thrift.Compiler.GenTypedef
        Thrift.Compiler.GenUnion
        Thrift.Compiler.GenUtils
        Thrift.Compiler.OptParse
        Thrift.Compiler.Options
        Thrift.Compiler.Lexer
        Thrift.Compiler.Parser
        Thrift.Compiler.Plugin
        Thrift.Compiler.Pretty
        Thrift.Compiler.Typechecker
        Thrift.Compiler.Typechecker.Monad
        Thrift.Compiler.Types
        Thrift.Compiler.Plugins.Haskell
        Thrift.Compiler.Plugins.Linter

    build-depends:
        aeson >= 2.0.3 && < 2.3,
        array >= 0.5.3 && < 0.6,
        mtl >= 2.2.2 && < 2.4,
        optparse-applicative >= 0.17 && < 0.19,
        aeson-pretty >= 0.8.10 && < 0.9,
        either >= 5.0.2 && < 5.1,
        extra >= 1.8 && < 1.9,
        fb-util >= 0.1.0 && < 0.2,
        some >= 1.0.6 && < 1.1,
        text-show >= 3.10.5 && < 3.11,
        haskell-src-exts >=1.20.3 && <1.24,
        haskell-names < 0.10,
        base >=4.11.1 && <4.20,
        async ^>=2.2.1,
        filepath ^>=1.4.2,
        containers >=0.5.11 && <0.7,
        text ^>=1.2.3.0,
        transformers >= 0.5.6 && < 0.7,
        bytestring >=0.10.8.2 && <0.13,
        unordered-containers ^>=0.2.9.0,
        directory ^>=1.3.1.5,
        pretty ^>=1.1.3.6
    build-tool-depends: alex:alex, happy:happy

executable thrift-compiler
    import: fb-haskell
    hs-source-dirs: main
    main-is: Main.hs
    build-depends:
        base >=4.11.1 && <4.20,
        optparse-applicative,
        thrift-compiler

test-suite thrift-compiler-tests
  import: fb-haskell
  type: exitcode-stdio-1.0
  hs-source-dirs: test, test/github
  main-is: TestFixtures.hs
  ghc-options: -threaded -main-is TestFixtures
  other-modules: Util
  build-depends: aeson-pretty,
                 base,
                 directory,
                 extra,
                 filepath,
                 fb-stubs,
                 haskell-src-exts >=1.20.3 && <1.24,
                 hspec,
                 hspec-contrib,
                 HUnit ^>= 1.6.1,
                 process,
                 temporary,
                 text,
                 thrift-compiler