Improved scaffolded cabal file
This commit is contained in:
parent
f99fe1983f
commit
a4052b2784
@ -5,7 +5,6 @@ module Scaffolding.Scaffolder (scaffold) where
|
||||
import Scaffolding.CodeGen
|
||||
|
||||
import Language.Haskell.TH.Syntax
|
||||
import Control.Monad (when)
|
||||
import qualified Data.Text.Lazy as LT
|
||||
import qualified Data.Text.Lazy.Encoding as LT
|
||||
import qualified Data.ByteString.Lazy as L
|
||||
@ -72,9 +71,6 @@ scaffold = do
|
||||
uncapitalize s = toLower (head s) : tail s
|
||||
backendLower = uncapitalize $ show backend
|
||||
upper = show backend
|
||||
|
||||
let useTests = True
|
||||
let testsDep = if useTests then ", yesod-test" else ""
|
||||
|
||||
let runMigration =
|
||||
case backend of
|
||||
@ -149,8 +145,6 @@ scaffold = do
|
||||
writeFile' "main.hs" $(codegen "main.hs")
|
||||
writeFile' "devel.hs" $(codegen "devel.hs")
|
||||
writeFile' (project ++ ".cabal") $(codegen "project.cabal")
|
||||
when useTests $
|
||||
appendFile' (project ++ ".cabal") $(codegen "cabal_test_suite")
|
||||
|
||||
writeFile' ".ghci" $(codegen ".ghci")
|
||||
writeFile' "LICENSE" $(codegen "LICENSE")
|
||||
@ -179,10 +173,9 @@ scaffold = do
|
||||
writeFile' "config/models" $(codegen "config/models")
|
||||
writeFile' "messages/en.msg" $(codegen "messages/en.msg")
|
||||
|
||||
when useTests $ do
|
||||
mkDir "tests"
|
||||
writeFile' "tests/main.hs" $(codegen "tests/main.hs")
|
||||
writeFile' "tests/HomeTest.hs" $(codegen "tests/HomeTest.hs")
|
||||
mkDir "tests"
|
||||
writeFile' "tests/main.hs" $(codegen "tests/main.hs")
|
||||
writeFile' "tests/HomeTest.hs" $(codegen "tests/HomeTest.hs")
|
||||
|
||||
S.writeFile (dir ++ "/config/favicon.ico")
|
||||
$(runIO (S.readFile "scaffold/config/favicon.ico.cg") >>= \bs -> do
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
test-suite integration-tests
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: main.hs
|
||||
hs-source-dirs: tests .
|
||||
ghc-options: -Wall
|
||||
extensions: TemplateHaskell
|
||||
QuasiQuotes
|
||||
OverloadedStrings
|
||||
NoImplicitPrelude
|
||||
CPP
|
||||
OverloadedStrings
|
||||
MultiParamTypeClasses
|
||||
TypeFamilies
|
||||
GADTs
|
||||
GeneralizedNewtypeDeriving
|
||||
FlexibleContexts
|
||||
|
||||
build-depends: base >= 4 && < 5
|
||||
, yesod-test
|
||||
@ -8,7 +8,7 @@ synopsis: The greatest Yesod web application ever.
|
||||
description: I'm sure you can say something clever here if you try.
|
||||
category: Web
|
||||
stability: Experimental
|
||||
cabal-version: >= 1.6
|
||||
cabal-version: >= 1.8
|
||||
build-type: Simple
|
||||
homepage: http://~project~.yesodweb.com/
|
||||
|
||||
@ -21,53 +21,25 @@ Flag library-only
|
||||
Default: False
|
||||
|
||||
library
|
||||
if flag(library-only)
|
||||
Buildable: True
|
||||
else
|
||||
Buildable: False
|
||||
|
||||
exposed-modules: Application
|
||||
other-modules: Foundation
|
||||
Foundation
|
||||
Import
|
||||
Model
|
||||
Settings
|
||||
Settings.StaticFiles
|
||||
Handler.Home
|
||||
|
||||
ghc-options: -Wall -threaded -O0
|
||||
cpp-options: -DDEVELOPMENT
|
||||
|
||||
extensions: TemplateHaskell
|
||||
QuasiQuotes
|
||||
OverloadedStrings
|
||||
NoImplicitPrelude
|
||||
CPP
|
||||
MultiParamTypeClasses
|
||||
TypeFamilies
|
||||
GADTs
|
||||
GeneralizedNewtypeDeriving
|
||||
FlexibleContexts
|
||||
EmptyDataDecls
|
||||
NoMonomorphismRestriction
|
||||
|
||||
executable ~project~
|
||||
if flag(library-only)
|
||||
Buildable: False
|
||||
|
||||
if flag(dev)
|
||||
if flag(dev) || flag(library-only)
|
||||
cpp-options: -DDEVELOPMENT
|
||||
ghc-options: -Wall -threaded -O0
|
||||
else
|
||||
ghc-options: -Wall -threaded -O2
|
||||
|
||||
main-is: main.hs
|
||||
|
||||
extensions: TemplateHaskell
|
||||
QuasiQuotes
|
||||
OverloadedStrings
|
||||
NoImplicitPrelude
|
||||
CPP
|
||||
OverloadedStrings
|
||||
MultiParamTypeClasses
|
||||
TypeFamilies
|
||||
GADTs
|
||||
@ -103,4 +75,35 @@ executable ~project~
|
||||
, directory >= 1.1 && < 1.2
|
||||
, warp >= 1.2 && < 1.3
|
||||
|
||||
~testsDep~
|
||||
executable ~project~
|
||||
if flag(library-only)
|
||||
Buildable: False
|
||||
|
||||
main-is: ../main.hs
|
||||
hs-source-dirs: dist
|
||||
build-depends: base
|
||||
, ~project~
|
||||
, yesod-default
|
||||
|
||||
test-suite test
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: main.hs
|
||||
hs-source-dirs: tests
|
||||
ghc-options: -Wall
|
||||
extensions: TemplateHaskell
|
||||
QuasiQuotes
|
||||
OverloadedStrings
|
||||
NoImplicitPrelude
|
||||
CPP
|
||||
OverloadedStrings
|
||||
MultiParamTypeClasses
|
||||
TypeFamilies
|
||||
GADTs
|
||||
GeneralizedNewtypeDeriving
|
||||
FlexibleContexts
|
||||
|
||||
build-depends: base
|
||||
, ~project~
|
||||
, yesod-test
|
||||
, yesod-default
|
||||
, yesod-core
|
||||
|
||||
Loading…
Reference in New Issue
Block a user