production flag for disabling wai-handler-devel dependency
This commit is contained in:
parent
b2fbdb4f65
commit
4ee1a95a1f
6
Yesod.hs
6
Yesod.hs
@ -15,7 +15,9 @@ module Yesod
|
|||||||
-- * Running your application
|
-- * Running your application
|
||||||
, warp
|
, warp
|
||||||
, warpDebug
|
, warpDebug
|
||||||
|
#if !PRODUCTION
|
||||||
, develServer
|
, develServer
|
||||||
|
#endif
|
||||||
-- * Commonly referenced functions/datatypes
|
-- * Commonly referenced functions/datatypes
|
||||||
, Application
|
, Application
|
||||||
, lift
|
, lift
|
||||||
@ -60,7 +62,7 @@ import Yesod.Json
|
|||||||
import Yesod.Persist
|
import Yesod.Persist
|
||||||
import Network.Wai (Application)
|
import Network.Wai (Application)
|
||||||
import Network.Wai.Middleware.Debug
|
import Network.Wai.Middleware.Debug
|
||||||
#if !GHC7
|
#if !GHC7 && !PRODUCTION
|
||||||
import Network.Wai.Handler.DevelServer (runQuit)
|
import Network.Wai.Handler.DevelServer (runQuit)
|
||||||
#endif
|
#endif
|
||||||
import Control.Monad.Trans.Class (lift)
|
import Control.Monad.Trans.Class (lift)
|
||||||
@ -97,6 +99,7 @@ warpDebug port a = do
|
|||||||
hPutStrLn stderr $ "Application launched, listening on port " ++ show port
|
hPutStrLn stderr $ "Application launched, listening on port " ++ show port
|
||||||
toWaiApp a >>= run port . debug
|
toWaiApp a >>= run port . debug
|
||||||
|
|
||||||
|
#if !PRODUCTION
|
||||||
-- | Run a development server, where your code changes are automatically
|
-- | Run a development server, where your code changes are automatically
|
||||||
-- reloaded.
|
-- reloaded.
|
||||||
develServer :: Int -- ^ port number
|
develServer :: Int -- ^ port number
|
||||||
@ -115,6 +118,7 @@ develServer port modu func = do
|
|||||||
]
|
]
|
||||||
runQuit port modu func determineHamletDeps
|
runQuit port modu func determineHamletDeps
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
data TempType = Hamlet | Cassius | Julius | Widget
|
data TempType = Hamlet | Cassius | Julius | Widget
|
||||||
deriving Show
|
deriving Show
|
||||||
|
|||||||
11
yesod.cabal
11
yesod.cabal
@ -1,5 +1,5 @@
|
|||||||
name: yesod
|
name: yesod
|
||||||
version: 0.7.0
|
version: 0.7.0.1
|
||||||
license: BSD3
|
license: BSD3
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
@ -18,13 +18,20 @@ extra-source-files: scaffold/*.cg
|
|||||||
|
|
||||||
flag ghc7
|
flag ghc7
|
||||||
|
|
||||||
|
flag production
|
||||||
|
Description: Skip the wai-handler-devel and hint dependencies.
|
||||||
|
Default: False
|
||||||
|
|
||||||
library
|
library
|
||||||
if flag(ghc7)
|
if flag(ghc7)
|
||||||
build-depends: base >= 4.3 && < 5
|
build-depends: base >= 4.3 && < 5
|
||||||
cpp-options: -DGHC7
|
cpp-options: -DGHC7
|
||||||
else
|
else
|
||||||
build-depends: base >= 4 && < 4.3
|
build-depends: base >= 4 && < 4.3
|
||||||
, wai-handler-devel >= 0.2 && < 0.3
|
if flag(production)
|
||||||
|
cpp-options: -DPRODUCTION
|
||||||
|
else
|
||||||
|
build-depends: wai-handler-devel >= 0.2 && < 0.3
|
||||||
build-depends: yesod-core >= 0.7 && < 0.8
|
build-depends: yesod-core >= 0.7 && < 0.8
|
||||||
, yesod-auth >= 0.3 && < 0.4
|
, yesod-auth >= 0.3 && < 0.4
|
||||||
, yesod-json >= 0.0 && < 0.1
|
, yesod-json >= 0.0 && < 0.1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user