name:                mattermost-api
version:             40400.0.0
synopsis:            Client API for Mattermost chat system
description:         Client API for Mattermost chat system
license:             BSD3
license-file:        LICENSE
author:              Jason Dagit
maintainer:          dagitj@gmail.com
copyright:           2016-2017 Jason Dagit, Getty Ritter, Jonathan Daugherty
category:            Web
build-type:          Simple
extra-doc-files:     README.md,
                     CHANGELOG.md
cabal-version:       >=1.18
tested-with:         GHC == 7.10.3, GHC == 8.0.1
source-repository    head
  type: git
  location: https://github.com/matterhorn-chat/mattermost-api.git

flag build-examples
  description: Build example applications
  default:     False

library
  exposed-modules:     Network.Mattermost
                       Network.Mattermost.Exceptions
                       Network.Mattermost.Lenses
                       Network.Mattermost.Logging
                       Network.Mattermost.Util
                       Network.Mattermost.WebSocket
                       Network.Mattermost.WebSocket.Types
                       Network.Mattermost.Version
                       Network.Mattermost.Types
                       Network.Mattermost.Types.Base
                       Network.Mattermost.Types.Internal
  other-modules:       Network.Mattermost.TH
                       Paths_mattermost_api
  -- other-extensions:
  build-depends:       base >=4.4 && <5
                     , websockets >= 0.11.0.0
                     , stm
                     , aeson >= 1.0.0.0
                     , connection
                     , memory <0.14.3
                     -- To prevent broken websockets versions from using
                     -- incompatible versions of binary (for details, see
                     -- https://github.com/matterhorn-chat/mattermost-api/issues/36):
                     , binary >= 0.8.1
                     , bytestring
                     , process
                     , HTTP
                     , network-uri
                     , text
                     , time
                     , unordered-containers
                     , hashable
                     , containers
                     , gitrev
                     , template-haskell
                     , microlens
                     , microlens-th
                     -- Only here to make debugging easier
                     , pretty-show
  hs-source-dirs:      src
  default-language:    Haskell2010
  ghc-options:       -Wall

executable mm-get-teams
  if !flag(build-examples)
    buildable: False
  default-language: Haskell2010
  main-is:          GetTeams.hs
  other-modules:    Config
                    LocalConfig
  hs-source-dirs:   examples
  build-depends:    base
                  , mattermost-api
                  , aeson
                  , text
                  , connection
                  , process
                  , unordered-containers
                  , pretty-show

executable mm-get-channels
  if !flag(build-examples)
    buildable:        False
  default-language: Haskell2010
  main-is:          GetChannels.hs
  other-modules:    Config
                    LocalConfig
  hs-source-dirs:   examples
  build-depends:    base
                  , mattermost-api
                  , aeson
                  , text
                  , connection
                  , process
                  , unordered-containers
                  , pretty-show

executable mm-get-posts
  if !flag(build-examples)
    buildable:        False
  default-language: Haskell2010
  main-is:          GetPosts.hs
  other-modules:    Config
                    LocalConfig
  hs-source-dirs:   examples
  build-depends:    base
                  , mattermost-api
                  , aeson
                  , text
                  , connection
                  , process
                  , unordered-containers
                  , pretty-show

executable mm-make-post
  if !flag(build-examples)
    buildable:        False
  default-language: Haskell2010
  main-is:          MakePost.hs
  other-modules:    Config
                    LocalConfig
  hs-source-dirs:   examples
  build-depends:    base
                  , mattermost-api
                  , aeson
                  , text
                  , connection
                  , process
                  , unordered-containers
                  , pretty-show

executable mm-get-websocket-connection
  if !flag(build-examples)
    buildable:        False
  default-language: Haskell2010
  main-is:          GetWebsocketConnection.hs
  other-modules:    Config
                    LocalConfig
  hs-source-dirs:   examples
  build-depends:    base
                  , mattermost-api
                  , aeson
                  , text
                  , connection
                  , process
                  , unordered-containers
                  , pretty-show

executable mm-show-raw-events
  if !flag(build-examples)
    buildable:        False
  default-language: Haskell2010
  main-is:          ShowRawEvents.hs
  other-modules:    Config
                    LocalConfig
  hs-source-dirs:   examples
  build-depends:    base
                  , mattermost-api
                  , aeson
                  , text
                  , connection
                  , process
                  , unordered-containers
                  , pretty-show

test-suite test-mm-api
  type:             exitcode-stdio-1.0
  ghc-options:      -Wall
  default-language: Haskell2010
  hs-source-dirs:   test
  main-is:          Main.hs
  other-modules:    Tests.Util
                    Tests.Types
  build-depends:    base
                  , mtl
                  , stm
                  , mattermost-api
                  , tasty
                  , tasty-hunit
                  , HUnit
                  , text
                  , pretty-show
                  , unordered-containers
                  , containers
                  , aeson