cabal-version:      2.0
name:               jacinda
version:            0.3.0.0
license:            AGPL-3
license-file:       COPYING
maintainer:         vamchale@gmail.com
author:             Vanessa McHale
bug-reports:        https://github.com/vmchale/jacinda/issues
synopsis:           Functional, expression-oriented data processing language
description:
    APL meets AWK. A command-line tool for summarizing and reporting, powered by Rust's [regex](https://docs.rs/regex/regex/) library.

category:           Language, Interpreters, Text, Data
build-type:         Simple
extra-source-files:
    CHANGELOG.md
    README.md
    man/ja.1
    doc/guide.pdf
    test/examples/*.jac
    examples/*.jac

data-files:
    lib/*.jac
    prelude/*.jac

source-repository head
    type:     git
    location: https://github.com/vmchale/jacinda

flag cross
    description: Enable to ease cross-compiling
    default:     False
    manual:      True

library jacinda-lib
    exposed-modules:
        Jacinda.Parser
        Jacinda.Parser.Rewrite
        Jacinda.AST
        Jacinda.Ty
        Jacinda.Ty.Const
        Jacinda.Regex
        Jacinda.File

    hs-source-dirs:   src
    other-modules:
        Jacinda.Lexer
        Intern.Name
        Intern.Unique
        Jacinda.Rename
        Jacinda.Backend.Normalize
        Jacinda.Backend.TreeWalk
        Jacinda.Backend.Printf
        Jacinda.Include
        Data.List.Ext
        Data.Vector.Ext
        Paths_jacinda
    autogen-modules:  Paths_jacinda

    default-language: Haskell2010
    ghc-options:      -Wall -O2
    build-depends:
        base >=4.10.0.0 && <5,
        bytestring >=0.11.0.0,
        text,
        prettyprinter >=1.7.0,
        containers >=0.6.0.1,
        array,
        mtl,
        transformers,
        regex-rure >=0.1.2.0,
        microlens,
        directory,
        filepath,
        microlens-mtl,
        vector,
        recursion >=1.0.0.0,
        split

    if !flag(cross)
        build-tool-depends: alex:alex, happy:happy

    if impl(ghc >=8.0)
        ghc-options:
            -Wincomplete-uni-patterns -Wincomplete-record-updates
            -Wredundant-constraints -Widentities

    if impl(ghc >=8.4)
        ghc-options: -Wmissing-export-lists

    if impl(ghc >=8.2)
        ghc-options: -Wcpp-undef

    if impl(ghc >=8.10)
        ghc-options: -Wunused-packages

executable ja
    main-is:          Main.hs
    hs-source-dirs:   app
    other-modules:    Paths_jacinda
    autogen-modules:  Paths_jacinda
    default-language: Haskell2010
    ghc-options:      -Wall -rtsopts -with-rtsopts=-A200k
    build-depends:
        base,
        jacinda-lib,
        optparse-applicative,
        bytestring

    if impl(ghc >=8.0)
        ghc-options:
            -Wincomplete-uni-patterns -Wincomplete-record-updates
            -Wredundant-constraints -Widentities

    if impl(ghc >=8.4)
        ghc-options: -Wmissing-export-lists

    if impl(ghc >=8.2)
        ghc-options: -Wcpp-undef

    if impl(ghc >=8.10)
        ghc-options: -Wunused-packages

test-suite jacinda-test
    type:             exitcode-stdio-1.0
    main-is:          Spec.hs
    hs-source-dirs:   test
    default-language: Haskell2010
    ghc-options:      -Wall -threaded -rtsopts "-with-rtsopts=-N -K1K" -Wall
    build-depends:
        base,
        jacinda-lib,
        tasty,
        tasty-hunit,
        bytestring

    if impl(ghc >=8.0)
        ghc-options:
            -Wincomplete-uni-patterns -Wincomplete-record-updates
            -Wredundant-constraints -Widentities

    if impl(ghc >=8.4)
        ghc-options: -Wmissing-export-lists

    if impl(ghc >=8.2)
        ghc-options: -Wcpp-undef

    if impl(ghc >=8.10)
        ghc-options: -Wunused-packages


benchmark jacinda-bench
    type:             exitcode-stdio-1.0
    main-is:          Bench.hs
    hs-source-dirs:   bench
    default-language: Haskell2010
    ghc-options:      -Wall
    build-depends:
        base,
        criterion,
        jacinda-lib,
        deepseq

    if impl(ghc >=8.0)
        ghc-options:
            -Wincomplete-uni-patterns -Wincomplete-record-updates
            -Wredundant-constraints -Widentities

    if impl(ghc >=8.4)
        ghc-options: -Wmissing-export-lists

    if impl(ghc >=8.2)
        ghc-options: -Wcpp-undef

    if impl(ghc >=8.10)
        ghc-options: -Wunused-packages