cabal-version:       2.4
name:                xml-prettify-text
version:             1.0.0.2
synopsis:            XML pretty printer
description:         XML pretty printer based on xml-prettify by David M. Rosenberg. Modified to work with Text instead of String and tuned for improved performance.
homepage:            https://github.com/MrcJkb/xml-prettify-text
bug-reports:         https://github.com/MrcJkb/xml-prettify-text/issues
license:             GPL-2.0-only
license-file:        LICENSE
author:              Marc Jakobi
maintainer:          Marc Jakobi <mrcjkb89@outlook.com>
copyright:           2021 Marc Jakobi
category:            Efficient XML pretty-printer
build-type:          Simple
extra-doc-files:     README.md
                     CHANGELOG.md
tested-with:         GHC == 8.8.3
data-files:
    data/tests/prettyPrintTest.out.golden
    data/tests/prettyPrintTest.xml

source-repository head
  type:                git
  location:            https://github.com/MrcJkb/xml-prettify-text.git
common common-options
  build-depends:       base >= 4.14.3 && < 4.15
                     , protolude >= 0.3.0 && < 0.4
  
  mixins:              base hiding (Prelude)
                     , protolude (Protolude as Prelude)
  ghc-options:         -Wall
                        -Wcompat
                        -Widentities
                        -Wincomplete-uni-patterns
                        -Wincomplete-record-updates
  if impl(ghc >= 8.0)
    ghc-options:       -Wredundant-constraints
  if impl(ghc >= 8.2)
    ghc-options:       -fhide-source-paths
  if impl(ghc >= 8.4)
    ghc-options:       -Wmissing-export-lists
                       -Wpartial-fields
  if impl(ghc >= 8.8)
    ghc-options:       -Wmissing-deriving-strategies

  default-language:    Haskell2010
library
  import:              common-options
  hs-source-dirs:      src
  exposed-modules:     Text.XML.Prettify
                     , Text.XML.Prettify.Options
  build-depends:       base >= 4.14.3 && < 4.15
                     , text >= 1.2.4 && < 1.3
                     , text-show >= 3.9.2 && < 3.10
                     , mtl >= 2.2.2 && < 2.3
executable xml-prettify
  import:              common-options
  hs-source-dirs:      app
  main-is:             Main.hs
  build-depends:       xml-prettify-text
                     , text >= 1.2.4 && < 1.3
                     , optparse-applicative >= 0.16.1 && < 0.17
                     , with-utf8 >= 1.0.2 && < 1.1
  ghc-options:         -threaded
                         -rtsopts
                         -with-rtsopts=-N

test-suite xml-prettify-text-test
  import:              common-options
  type:                exitcode-stdio-1.0
  hs-source-dirs:      test
  main-is:             Spec.hs
  other-modules:       
                       PrettyPrintGoldenTest
  build-depends:       xml-prettify-text
                     , tasty
                     , tasty-golden
                     , text >= 1.2.4 && < 1.3
                     , filepath
  ghc-options:         -threaded
                        -rtsopts
                        -with-rtsopts=-N

benchmark xml-prettify-text-benchmark
  import:              common-options
  type:                exitcode-stdio-1.0
  hs-source-dirs:      benchmark
  main-is:             Main.hs
  build-depends:       gauge
                     , xml-prettify-text
  ghc-options:         -threaded
                         -rtsopts
                         -with-rtsopts=-N