name:                halive
version:             0.1.8
synopsis:            A live recompiler
description:
  Live recompiler for Haskell
  .
  <<http://lukexi.github.io/HaliveDemo.gif>>
  .
  /Usage:/
  .
  > halive path/to/myfile.hs [optionally any/extra include/dirs ..] [-f|--file-type additional file type] [-c|--compiled] -- [args to app]
  .
  Available options:
  .
  @-f, --file-type <file type>@ - Custom file type to watch for changes (e.g. @-f html@)
  @-c, --compiled@ - Use faster compiled code at the expense of recompilation speed
  .
  See <https://github.com/lukexi/halive/blob/master/README.md README>
homepage:            https://github.com/lukexi/halive
bug-reports:         https://github.com/lukexi/halive/issues
license:             BSD2
license-file:        LICENSE
author:              Luke Iannini
maintainer:          lukexi@me.com
-- copyright:
category:            Development
build-type:          Simple
cabal-version:       >=1.10

extra-source-files:  ChangeLog.md

source-repository head
  type: git
  location: git://github.com/lukexi/halive.git

library
  hs-source-dirs:      src
  exposed-modules:
    Halive
    Halive.Args
    Halive.Utils
    Halive.Concurrent
    Halive.FindPackageDBs
    Halive.SubHalive
    Halive.Recompiler
    Halive.FileListener
  default-language:    Haskell2010
  -- ghc-prof-options:    -Wall -fprof-auto
  ghc-options:         -Wall -optP-Wno-nonportable-include-path
  build-depends:
      base >=4.7 && <5
    , foreign-store
    , containers
    , mtl
    , ghc
    , ghc-paths
    , filepath
    , fsnotify
    , process
    , transformers
    , directory
    , stm
    , time
    , signal
    , text
  if impl(ghc >= 8)
    build-depends:
      ghc-boot

executable halive
  main-is:             HaliveMain.hs
  hs-source-dirs:      exec
  default-language:    Haskell2010
  ghc-prof-options:    -static -Wall -threaded -fprof-auto-exported
  ghc-options:         -dynamic -Wall -threaded -optP-Wno-nonportable-include-path
  -- This strangely enables "-dynamic" for all dependent libraries,
  -- so I need to comment this during profiling?!?
  -- Shouldn't ghc-prof-options override it anyway? Who knows.
  -- if !os(windows)
    -- ghc-options:         -dynamic
    -- This overrides -dynamic when building for profiling,
    -- probably breaking the executable but at least it lets us build
    -- halive as a dependency.
    -- ghc-prof-options:    -static
  -- ^ Required on Mac due to https://ghc.haskell.org/trac/ghc/ticket/9278
  -- (does GHCi use this??)
  other-modules:
    Banner
  -- other-extensions:
  build-depends:
      base
    , ghc
    , ghc-paths
    , transformers
    , directory
    , filepath
    , fsnotify
    , process
    , stm
    , halive


test-suite unit
  type: exitcode-stdio-1.0
  default-language: Haskell2010
  main-is: Spec.hs
  hs-source-dirs: test/unit
  other-modules:
      Halive.ArgsSpec
  build-depends:
      base
    , halive
    , hspec

test-suite demo
  type: exitcode-stdio-1.0
  default-language: Haskell2010
  main-is: Main.hs
  other-modules:
    Cube
    Green
    Window
    Shader
  hs-source-dirs: demo
  build-depends:
    base,
    gl,
    sdl2,
    halive,
    linear,
    foreign-store,
    random,
    text,
    bytestring,
    mtl,
    time,
    lens,
    pretty-show

test-suite subhalive
  type:                exitcode-stdio-1.0
  main-is:             TestSubhalive.hs
  hs-source-dirs:      test
  ghc-options:         -Wall -threaded -rtsopts -with-rtsopts=-N -dynamic
  build-depends:       base
                     , halive
                     , mtl
                     , random
                     , containers
                     , time
                     , filepath
                     , stm
  default-language:    Haskell2010

test-suite compileexpr
  type:                exitcode-stdio-1.0
  main-is:             TestCompileExpr.hs
  hs-source-dirs:      test
  ghc-options:         -Wall -threaded -rtsopts -with-rtsopts=-N  -dynamic
  build-depends:       base
                     , halive
                     , mtl
                     , random
                     , containers
                     , time
                     , filepath
                     , stm
  default-language:    Haskell2010


test-suite testghc
  type:                exitcode-stdio-1.0
  main-is:             TestGHC.hs
  hs-source-dirs:      test
  ghc-options:         -Wall -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base
                     , time
                     , filepath
                     , ghc
                     , ghc-paths
                     , directory
  default-language:    Haskell2010