production flag for disabling wai-handler-devel dependency

This commit is contained in:
Michael Snoyman 2011-02-07 22:40:17 +02:00
parent b2fbdb4f65
commit 4ee1a95a1f
2 changed files with 14 additions and 3 deletions

View File

@ -15,7 +15,9 @@ module Yesod
-- * Running your application
, warp
, warpDebug
#if !PRODUCTION
, develServer
#endif
-- * Commonly referenced functions/datatypes
, Application
, lift
@ -60,7 +62,7 @@ import Yesod.Json
import Yesod.Persist
import Network.Wai (Application)
import Network.Wai.Middleware.Debug
#if !GHC7
#if !GHC7 && !PRODUCTION
import Network.Wai.Handler.DevelServer (runQuit)
#endif
import Control.Monad.Trans.Class (lift)
@ -97,6 +99,7 @@ warpDebug port a = do
hPutStrLn stderr $ "Application launched, listening on port " ++ show port
toWaiApp a >>= run port . debug
#if !PRODUCTION
-- | Run a development server, where your code changes are automatically
-- reloaded.
develServer :: Int -- ^ port number
@ -115,6 +118,7 @@ develServer port modu func = do
]
runQuit port modu func determineHamletDeps
#endif
#endif
data TempType = Hamlet | Cassius | Julius | Widget
deriving Show

View File

@ -1,5 +1,5 @@
name: yesod
version: 0.7.0
version: 0.7.0.1
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
@ -18,13 +18,20 @@ extra-source-files: scaffold/*.cg
flag ghc7
flag production
Description: Skip the wai-handler-devel and hint dependencies.
Default: False
library
if flag(ghc7)
build-depends: base >= 4.3 && < 5
cpp-options: -DGHC7
else
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
, yesod-auth >= 0.3 && < 0.4
, yesod-json >= 0.0 && < 0.1