name:              stackage-server
version:           0.0.0
cabal-version:     >= 1.8
build-type:        Simple

Flag dev
    Description:   Turn on development settings, like auto-reload templates.
    Default:       False

Flag library-only
    Description:   Build for use with "yesod devel"
    Default:       False

library
    exposed-modules: Application
                     Foundation
                     Import
                     Settings
                     Settings.StaticFiles
                     Data.GhcLinks
                     Data.WebsiteContent
                     Distribution.Package.ModuleForest
                     Types

                     -- once stabilized, will likely move into its own package
                     Stackage.Database
                     Stackage.Database.Haddock
                     Stackage.Database.Types
                     Stackage.Database.Cron
                     Stackage.Snapshot.Diff

                     Handler.Home
                     Handler.Snapshots
                     Handler.StackageHome
                     Handler.StackageIndex
                     Handler.StackageSdist
                     Handler.System
                     Handler.Haddock
                     Handler.Hoogle
                     Handler.Package
                     Handler.PackageList
                     Handler.BuildVersion
                     Handler.Sitemap
                     Handler.BuildPlan
                     Handler.Download
                     Handler.OldLinks
                     Handler.Feed
                     Handler.DownloadStack

    if flag(dev) || flag(library-only)
        cpp-options:   -DDEVELOPMENT
        ghc-options:   -Wall -O0
    else
        ghc-options:   -Wall -O2

    extensions: TemplateHaskell
                QuasiQuotes
                OverloadedStrings
                NoImplicitPrelude
                CPP
                MultiParamTypeClasses
                TypeFamilies
                GADTs
                GeneralizedNewtypeDeriving
                FlexibleContexts
                EmptyDataDecls
                NoMonomorphismRestriction
                DeriveDataTypeable
                ViewPatterns
                TypeSynonymInstances
                FlexibleInstances
                RankNTypes
                FunctionalDependencies
                PatternGuards
                StandaloneDeriving
                UndecidableInstances
                RecordWildCards
                ScopedTypeVariables
                BangPatterns
                TupleSections
                DeriveGeneric
                DeriveFunctor
                DeriveFoldable
                DeriveTraversable
                LambdaCase

    build-depends:
                    base                          >= 4.8         &&   < 4.9
                  , aeson                         >= 0.9         &&   < 0.10
                  , aeson-extra                   >= 0.3         &&   < 0.4
                  , aws                           >= 0.13        &&   < 0.14
                  , barrier                       >= 0.1         &&   < 0.2
                  , base16-bytestring             >= 0.1         &&   < 0.2
                  , blaze-markup                  >= 0.7         &&   < 0.8
                  , byteable                      >= 0.1         &&   < 0.2
                  , bytestring                    >= 0.10        &&   < 0.11
                  , classy-prelude                >= 0.12        &&   < 0.13
                  , classy-prelude-yesod          >= 0.12        &&   < 0.13
                  , conduit                       >= 1.2         &&   < 1.3
                  , conduit-extra                 >= 1.1         &&   < 1.2
                  , cryptohash                    >= 0.11        &&   < 0.12
                  , cryptohash-conduit            >= 0.1.1       &&   < 0.2
                  , data-default                  >= 0.5         &&   < 0.6
                  , directory                     >= 1.2         &&   < 1.3
                  , email-validate                >= 2.2         &&   < 2.3
                  , esqueleto                     >= 2.4         &&   < 2.5
                  , exceptions                    >= 0.8         &&   < 0.9
                  , fast-logger                   >= 2.4         &&   < 2.5
                  , foreign-store                 >= 0.2         &&   < 0.3
                  , ghc-prim                      >= 0.4         &&   < 0.5
                  , hjsmin                        >= 0.1         &&   < 0.2
                  , html-conduit                  >= 1.2         &&   < 1.3
                  , http-conduit                  >= 2.1.8       &&   < 2.2
                  , monad-control                 >= 1.0         &&   < 1.1
                  , monad-logger                  >= 0.3.13      &&   < 0.4
                  , mtl                           >= 2.2         &&   < 2.3
                  , mwc-random                    >= 0.13        &&   < 0.14
                  , prometheus-client
                  , prometheus-metrics-ghc
                  , persistent                    >= 2.2         &&   < 2.3
                  , persistent-template           >= 2.1         &&   < 2.2
                  , resourcet                     >= 1.1.6       &&   < 1.2
                  , shakespeare                   >= 2.0         &&   < 2.1
                  , system-fileio                 >= 0.3         &&   < 0.4
                  , system-filepath               >= 0.4         &&   < 0.5
                  , tagstream-conduit
                  , tar                           >= 0.5         &&   < 0.6
                  , template-haskell              >= 2.10        &&   < 2.11
                  , temporary-rc                  >= 1.2         &&   < 1.3
                  , text                          >= 1.2         &&   < 1.3
                  , these                         >= 0.6         &&   < 0.7
                  , wai                           >= 3.2         &&   < 3.3
                  , wai-extra                     >= 3.0         &&   < 3.1
                  , wai-logger                    >= 2.2         &&   < 2.3
                  , wai-middleware-prometheus
                  , warp                          >= 3.2         &&   < 3.3
                  , xml-conduit                   >= 1.3         &&   < 1.4
                  , xml-types
                  , yaml                          >= 0.8         &&   < 0.9
                  , yesod                         >= 1.4         &&   < 1.5
                  , yesod-auth                    >= 1.4         &&   < 1.5
                  , yesod-core                    >= 1.4         &&   < 1.5
                  , yesod-form                    >= 1.4         &&   < 1.5
                  , yesod-newsfeed
                  , yesod-static                  >= 1.5         &&   < 1.6
                  , zlib                          >= 0.6         &&   < 0.7
                  , unordered-containers          >= 0.2         &&   < 0.3
                  , hashable                      >= 1.2         &&   < 1.3
                  , Cabal                         >= 1.22        &&   < 1.23
                  , lifted-base                   >= 0.2         &&   < 0.3
                  , mono-traversable              >= 0.10        &&   < 0.11
                  , time                          >= 1.5         &&   < 1.6
                  , process                       >= 1.2         &&   < 1.3
                  , old-locale                    >= 1.0         &&   < 1.1
                  , th-lift                       >= 0.7         &&   < 0.8
                  , mime-types                    >= 0.1         &&   < 0.2
                  , unix                          >= 2.7         &&   < 2.8
                  , markdown                      >= 0.1.13      &&   < 0.2
                  , formatting                    >= 6.2         &&   < 6.3
                  , blaze-html                    >= 0.8         &&   < 0.9
                  , haddock-library               >= 1.2.0       &&   < 1.3
                  , async                         >= 2.1         &&   < 2.2
                  , yesod-gitrepo                 >= 0.2         &&   < 0.3
                  , hoogle
                  , spoon                         >= 0.3         &&   < 0.4
                  , deepseq                       >= 1.4         &&   < 1.5
                  , deepseq-generics              >= 0.1         &&   < 0.2
                  , auto-update                   >= 0.1         &&   < 0.2
                  , stackage-types                >= 1.2         &&   < 1.3
                  , stackage-build-plan           >= 0.1.1       &&   < 0.2
                  , yesod-sitemap                 >= 1.4         &&   < 1.5
                  , streaming-commons             >= 0.1         &&   < 0.2
                  , classy-prelude-conduit        >= 0.12        &&   < 0.13
                  , path-pieces                   >= 0.2         &&   < 0.3
                  , persistent-sqlite             >= 2.2         &&   < 2.3
                  , stackage-metadata             >= 0.3         &&   < 0.4
                  , filepath                      >= 1.4         &&   < 1.5
                  , http-client                   >= 0.4         &&   < 0.5
                  , http-types                    >= 0.9         &&   < 0.10
                  , amazonka                      >= 1.3         &&   < 1.4
                  , amazonka-core                 >= 1.3         &&   < 1.4
                  , amazonka-s3                   >= 1.3         &&   < 1.4
                  , lens                          >= 4.13        &&   < 4.14
                  , file-embed

executable         stackage-server
    if flag(library-only)
        Buildable: False

    main-is:           main.hs
    hs-source-dirs:    app
    build-depends:     base                          >= 4.8         &&   < 4.9
                     , stackage-server
                     , yesod                         >= 1.4         &&   < 1.5

    ghc-options:       -threaded -O2 -rtsopts -with-rtsopts=-N

    extensions: TemplateHaskell
                QuasiQuotes
                OverloadedStrings
                NoImplicitPrelude
                CPP
                MultiParamTypeClasses
                TypeFamilies
                GADTs
                GeneralizedNewtypeDeriving
                FlexibleContexts
                EmptyDataDecls
                NoMonomorphismRestriction
                DeriveDataTypeable
                ViewPatterns
                TypeSynonymInstances
                FlexibleInstances
                RankNTypes
                FunctionalDependencies
                PatternGuards
                StandaloneDeriving
                UndecidableInstances
                RecordWildCards
                ScopedTypeVariables
                BangPatterns
                TupleSections
                DeriveGeneric
                DeriveFunctor
                DeriveFoldable
                DeriveTraversable
                LambdaCase

executable         stackage-server-cron
    if flag(library-only)
        Buildable: False

    main-is:           stackage-server-cron.hs
    hs-source-dirs:    app
    build-depends:     base, stackage-server

    ghc-options:       -threaded -O2 -rtsopts -with-rtsopts=-N

    extensions: TemplateHaskell
                QuasiQuotes
                OverloadedStrings
                NoImplicitPrelude
                CPP
                MultiParamTypeClasses
                TypeFamilies
                GADTs
                GeneralizedNewtypeDeriving
                FlexibleContexts
                EmptyDataDecls
                NoMonomorphismRestriction
                DeriveDataTypeable
                ViewPatterns
                TypeSynonymInstances
                FlexibleInstances
                RankNTypes
                FunctionalDependencies
                PatternGuards
                StandaloneDeriving
                UndecidableInstances
                RecordWildCards
                ScopedTypeVariables
                BangPatterns
                TupleSections
                DeriveGeneric
                DeriveFunctor
                DeriveFoldable
                DeriveTraversable
                LambdaCase

test-suite test
    type:              exitcode-stdio-1.0
    main-is:           Spec.hs
    other-modules:     TestImport
    hs-source-dirs:    test
    ghc-options:       -Wall

    build-depends: base                          >= 4.8         &&   < 4.9
                 , stackage-server
                 , yesod-test                    >= 1.5         &&   < 1.6
                 , yesod-core                    >= 1.4         &&   < 1.5
                 , yesod                         >= 1.4         &&   < 1.5
                 , persistent                    >= 2.2         &&   < 2.3
                 , resourcet                     >= 1.1.6       &&   < 1.2
                 , monad-logger                  >= 0.3.13      &&   < 0.4
                 , transformers                  >= 0.4         &&   < 0.5
                 , hspec                         >= 2.2         &&   < 2.3
                 , classy-prelude-yesod          >= 0.12        &&   < 0.13
                 , mtl                           >= 2.2         &&   < 2.3
                 , mwc-random                    >= 0.13        &&   < 0.14

    extensions: TemplateHaskell
                QuasiQuotes
                OverloadedStrings
                NoImplicitPrelude
                CPP
                MultiParamTypeClasses
                TypeFamilies
                GADTs
                GeneralizedNewtypeDeriving
                FlexibleContexts
                EmptyDataDecls
                NoMonomorphismRestriction
                DeriveDataTypeable
                ViewPatterns
                TypeSynonymInstances
                FlexibleInstances
                RankNTypes
                FunctionalDependencies
                PatternGuards
                StandaloneDeriving
                UndecidableInstances
                RecordWildCards
                ScopedTypeVariables
                BangPatterns
                TupleSections
                DeriveGeneric
                DeriveFunctor
                DeriveFoldable
                DeriveTraversable
                LambdaCase
