name:                   lock-file
version:                0.7.0.0
synopsis:               Provide exclusive access to a resource using lock file.
description:
  Provide exclusive access to a resource using lock file, which are files whose
  purpose is to signal by their presence that some resource is locked.
  .
  Code example can be found in "System.IO.LockFile" module.

homepage:               https://github.com/trskop/lock-file#readme
bug-reports:            https://github.com/trskop/lock-file/issues
license:                BSD3
license-file:           LICENSE
author:                 Peter Trsko
maintainer:             peter.trsko@gmail.com
copyright:              (c) 2013-2016, 2018 Peter Trško
category:               System
build-type:             Simple
cabal-version:          >=1.10

extra-source-files:
    ChangeLog.md
  , README.md
  , example/*.hs

flag pedantic
  description:          Pass additional warning flags to GHC.
  default:              False
  manual:               True

library
  hs-source-dirs:       src

  exposed-modules:
      System.IO.LockFile
    , System.IO.LockFile.Internal

  build-depends:
      base >=4.9 && <5
    , data-default-class >=0.0 && <0.2
    , directory >=1.1 && <1.4
    , exceptions >0.6 && <0.11

  if impl(ghc <8)
    build-depends:
        transformers >=0.3 && <0.6
        -- ^ GHC 8.0 is bundled with base 4.9.0.0, which contains
        -- Control.Monad.IO.Class, therefore, transformers package is necessary
        -- only for older versions of GHC.

  default-language:     Haskell2010
  other-extensions:
      CPP
    , DeriveDataTypeable
    , DeriveGeneric
    , NoImplicitPrelude

  ghc-options:          -Wall
  if flag(pedantic)
    ghc-options:
      -Werror
    if impl(ghc >=8)
      ghc-options:
        -Wimplicit-prelude
        -Wmissing-import-lists
    else
      ghc-options:
        -fwarn-tabs
        -fwarn-implicit-prelude
        -fwarn-missing-import-lists

test-suite lock-file-unit-tests
  hs-source-dirs:       src, test
  type:                 exitcode-stdio-1.0
  main-is:              unit-tests-main.hs

  other-modules:
    -- {{{ Modules from lock-file library -------------------------------------
      System.IO.LockFile
    , System.IO.LockFile.Internal
    -- }}} Modules from lock-file library -------------------------------------
    , TestCase
    , TestCase.System.IO.LockFile

  build-depends:
    -- {{{ Dependencies of lock-file library ----------------------------------
      base >=4.5 && <5
    , data-default-class >=0.0 && <0.2
    , directory >=1.1 && <1.4
    , exceptions >0.6 && <0.11
    -- }}} Dependencies of lock-file library ----------------------------------

    -- {{{ Test-suite dependencies --------------------------------------------
    , filepath ==1.3.* || ==1.4.*
    , HUnit >=1.2 && <2
      -- ^ Same constraints as test-framework-hunit
    , test-framework >=0.8 && <1
      -- ^ Same constraint as test-framework-skip, other packages that
      -- depend on it have less restrictive bounds.
    , test-framework-hunit >=0.2.6 && <1
      -- ^ Lower versions have more restrictive bounds on test-framework.
    , test-framework-quickcheck2 >=0.3 && <1
      -- ^ There were changes in QuickCheck bounds in 0.2 branch and last one
      -- on it had a compilation failure on Hackage.

      -- Not required right now:
 -- , test-framework-skip ==1.*
      -- ^ Currently there is only version 1.0.
    -- }}} Test-suite dependencies --------------------------------------------

  if impl(ghc <8)
    build-depends:
        transformers >=0.3 && <0.6
        -- ^ GHC 8.0 is bundled with base 4.9.0.0, which contains
        -- Control.Monad.IO.Class, therefore, transformers package is necessary
        -- only for older versions of GHC.

  default-language:     Haskell2010
  other-extensions:
      CPP
    , DeriveDataTypeable
    , DeriveGeneric
    , NoImplicitPrelude

  ghc-options:          -Wall
  if flag(pedantic)
    ghc-options:
      -Werror
    if impl(ghc >=8)
      ghc-options:
        -Wimplicit-prelude
        -Wmissing-import-lists
    else
      ghc-options:
        -fwarn-tabs
        -fwarn-implicit-prelude
        -fwarn-missing-import-lists

source-repository head
  type:                 git
  location:             git://github.com/trskop/lock-file.git

source-repository this
  type:                 git
  location:             git://github.com/trskop/lock-file.git
  tag:                  0.7.0.0