cabal-version:       3.0
name:                ghc-tags-plugin
version:             0.6.1.1
synopsis:            A compiler plugin which generates tags file from GHC parsed syntax tree.
description:
  __etags__ format.  For a standalone `ghc-tags` command look for or
  [ghc-tags](https://hackage.haskell.org/package/ghc-tags) or its
  [fork](https://github.com/coot/ghc-tags) (the fork is using
  [ghc-tags-core](https://hackage.haskell.org/package/ghc-tags-core),
  the same library which `ghc-tags-plugin` is using).
license:             MPL-2.0
license-file:        LICENSE
author:              Marcin Szamotulski
maintainer:          coot@coot.me
copyright:           (c) 2020-2024, Marcin Szamotulski
category:            Development
stability:           alpha
extra-source-files:  CHANGELOG.md
                     README.md
homepage:            https://github.com/coot/ghc-tags-plugin#readme
bug-reports:         https://github.com/coot/ghc-tags-plugin/issues
tested-with:         GHC == { 9.6, 9.8, 9.10 }

-- Don't build gtp-check command by default; it's a development tool.
flag gtp-check
  default: False
  manual:  False

source-repository head
  type:     git
  location: https://github.com/coot/ghc-tags-plugin

common warnings
  ghc-options:         -Wall
                       -Wno-unticked-promoted-constructors
                       -Wcompat
                       -- the following three warnings are enabled by -Wall in
                       -- ghc-9.2
                       -Wno-incomplete-uni-patterns
                       -Wno-incomplete-record-updates
                       -Wpartial-fields
                       -Widentities
                       -Wredundant-constraints
  if impl(ghc >= 9)
    ghc-options:       -Wunused-packages

library
  import:              warnings
  hs-source-dirs:      lib
  exposed-modules:     Plugin.GhcTags
                       Plugin.GhcTags.Options
                       Plugin.GhcTags.FileLock
  other-modules:       Plugin.GhcTags.CTag
                       Paths_ghc_tags_plugin
  autogen-modules:     Paths_ghc_tags_plugin
  build-depends:       base              >=4.12.0.0 && <4.21,
                       bytestring        >=0.10 && < 0.13,
                       directory        ^>=1.3,
                       filepath         ^>=1.4 || ^>= 1.5,
                       ghc               >=8.4 && <10,
                       lukko            ^>=0.1,
                       mtl               >=2.2 && <2.4,
                       optparse-applicative
                                         >=0.15.1 && < 0.19,
                       pipes            ^>=4.3,
                       pipes-bytestring ^>=2.1,
                       pipes-safe       ^>=2.3,
                       text              >=1.2 && <2.2,

                       ghc-tags-core   ^>=0.6,
                       ghc-tags-pipes  ^>=0.1.1
  default-language:    Haskell2010


executable gtp-check
  if flag(gtp-check)
    buildable:         True
  else
    buildable:         False
  hs-source-dirs:      app
  main-is:             check.hs
  default-language:    Haskell2010
  build-depends:       base
                     , bytestring
                     , directory
                     , filepath

                     , ghc-tags-plugin