packages feed

gitrev-typed-0.1: gitrev-typed.cabal

cabal-version:      3.0
name:               gitrev-typed
version:            0.1
synopsis:           Compile git revision info into Haskell projects
homepage:           https://github.com/tbidne/gitrev-typed
license:            BSD-3-Clause
license-file:       LICENSE
author:             Adam C. Foltzer, Thomas Bidne
maintainer:         Thomas Bidne <tbidne@protonmail.com>
category:           Development
build-type:         Simple
tested-with:
  GHC ==9.0.2
   || ==9.2.8
   || ==9.4.8
   || ==9.6.6
   || ==9.8.4
   || ==9.10.1
   || ==9.12.1

extra-source-files:
  LICENSE
  README.md

extra-doc-files:    CHANGELOG.md
description:
  This is a fork of the popular
  [gitrev](https://hackage.haskell.org/package/gitrev) package, offering
  Template Haskell splices for git revision information. There are three
  interfaces:

  1. "Development.GitRev": The original @gitrev@ interface i.e. untyped splices.

  2. "Development.GitRev.Typed": Splices for typed TH, along with
  support for customization e.g. typed errors, \"out-of-tree\" workarounds
  via environment variables, and custom git actions.

  3. "Development.GitRev.Typed.OsString": @Development.GitRev.Typed@ for
  @OsString@.

source-repository head
  type:     git
  location: https://github.com/tbidne/gitrev-typed.git

common common-lang
  default-extensions:
    DataKinds
    DeriveFunctor
    DeriveLift
    DeriveTraversable
    DerivingStrategies
    DuplicateRecordFields
    ExplicitForAll
    ExplicitNamespaces
    FlexibleInstances
    GADTs
    GeneralizedNewtypeDeriving
    ImportQualifiedPost
    LambdaCase
    NamedFieldPuns
    OverloadedStrings
    ScopedTypeVariables
    TupleSections
    TypeApplications
    TypeOperators

  -- Apparently, cabal.project warnings do not apply to other-modules, hence
  -- copying them here.
  ghc-options:
    -Wall -Wcompat -Widentities -Wincomplete-record-updates
    -Wincomplete-uni-patterns -Wmissing-deriving-strategies
    -Wmissing-export-lists -Wmissing-exported-signatures
    -Wmissing-home-modules -Wmissing-import-lists -Wpartial-fields
    -Wprepositive-qualified-module -Wredundant-constraints
    -Wunused-binds -Wunused-packages -Wunused-type-patterns
    -Wno-unticked-promoted-constructors

  default-language:   Haskell2010

library
  import:          common-lang
  build-depends:
    , base              >=4.15.0.0 && <4.22
    , directory         >=1.3.8.0  && <1.4
    , exceptions        ^>=0.10.4
    , file-io           ^>=0.1.1
    , filepath          >=1.5.0.1  && <1.6
    , os-string         ^>=2.0.0
    , process           >=1.6.13.2 && <1.7
    , template-haskell  >=2.17.0.0 && <2.24
    , text              >=0.1.1    && <2.2

  hs-source-dirs:  src
  exposed-modules:
    Development.GitRev
    Development.GitRev.Typed
    Development.GitRev.Typed.OsString

  other-modules:
    Development.GitRev.Internal.Environment
    Development.GitRev.Internal.Environment.OsString
    Development.GitRev.Internal.Git
    Development.GitRev.Internal.Git.Common
    Development.GitRev.Internal.Git.OsString
    Development.GitRev.Internal.OsString
    Development.GitRev.Internal.QFirst
    Development.GitRev.Internal.Utils
    Development.GitRev.Internal.Utils.Common
    Development.GitRev.Internal.Utils.OsString

test-suite unit
  import:         common-lang
  type:           exitcode-stdio-1.0
  main-is:        Main.hs
  other-modules:
    Unit.Development.GitRev
    Unit.Development.GitRev.Typed
    Unit.Development.GitRev.Typed.OsString
    Utils

  build-depends:
    , base
    , env-guard         ^>=0.2
    , gitrev-typed
    , os-string
    , tasty             >=1.1.0.3 && <1.6
    , tasty-hunit       >=0.9     && <0.11
    , template-haskell
    , text

  hs-source-dirs: test/unit
  ghc-options:    -threaded