DEV -> DEVELOPMENT
This commit is contained in:
parent
0f72117e53
commit
157d098da2
@ -29,7 +29,7 @@ mkYesodDispatch "~sitearg~" resources~sitearg~
|
|||||||
-- migrations handled by Yesod.
|
-- migrations handled by Yesod.
|
||||||
with~sitearg~ :: AppConfig DefaultEnv () -> Logger -> (Application -> IO ()) -> IO ()
|
with~sitearg~ :: AppConfig DefaultEnv () -> Logger -> (Application -> IO ()) -> IO ()
|
||||||
with~sitearg~ conf logger f = do
|
with~sitearg~ conf logger f = do
|
||||||
#ifdef DEV
|
#ifdef DEVELOPMENT
|
||||||
s <- staticDevel Settings.staticDir
|
s <- staticDevel Settings.staticDir
|
||||||
#else
|
#else
|
||||||
s <- static Settings.staticDir
|
s <- static Settings.staticDir
|
||||||
|
|||||||
@ -33,7 +33,7 @@ import Model
|
|||||||
import Text.Jasmine (minifym)
|
import Text.Jasmine (minifym)
|
||||||
import Web.ClientSession (getKey)
|
import Web.ClientSession (getKey)
|
||||||
import Text.Hamlet (hamletFile)
|
import Text.Hamlet (hamletFile)
|
||||||
#if DEV
|
#if DEVELOPMENT
|
||||||
import qualified Data.Text.Lazy.Encoding
|
import qualified Data.Text.Lazy.Encoding
|
||||||
#else
|
#else
|
||||||
import Network.Mail.Mime (sendmail)
|
import Network.Mail.Mime (sendmail)
|
||||||
@ -145,7 +145,7 @@ instance YesodAuth ~sitearg~ where
|
|||||||
|
|
||||||
-- Sends off your mail. Requires sendmail in production!
|
-- Sends off your mail. Requires sendmail in production!
|
||||||
deliver :: ~sitearg~ -> L.ByteString -> IO ()
|
deliver :: ~sitearg~ -> L.ByteString -> IO ()
|
||||||
#ifdef DEV
|
#ifdef DEVELOPMENT
|
||||||
deliver y = logLazyText (getLogger y) . Data.Text.Lazy.Encoding.decodeUtf8
|
deliver y = logLazyText (getLogger y) . Data.Text.Lazy.Encoding.decodeUtf8
|
||||||
#else
|
#else
|
||||||
deliver _ = sendmail
|
deliver _ = sendmail
|
||||||
|
|||||||
@ -49,7 +49,7 @@ staticRoot conf = [~qq~st|#{appRoot conf}/static|]
|
|||||||
-- user.
|
-- user.
|
||||||
|
|
||||||
widgetFile :: String -> Q Exp
|
widgetFile :: String -> Q Exp
|
||||||
#if DEV
|
#if DEVELOPMENT
|
||||||
widgetFile = Yesod.Default.Util.widgetFileReload
|
widgetFile = Yesod.Default.Util.widgetFileReload
|
||||||
#else
|
#else
|
||||||
widgetFile = Yesod.Default.Util.widgetFileNoReload
|
widgetFile = Yesod.Default.Util.widgetFileNoReload
|
||||||
|
|||||||
@ -27,12 +27,12 @@
|
|||||||
#
|
#
|
||||||
# * add code in Settings.hs to turn that url into connection parameters. The below works for Postgresql.
|
# * add code in Settings.hs to turn that url into connection parameters. The below works for Postgresql.
|
||||||
#
|
#
|
||||||
# #ifdef !DEV
|
# #ifdef !DEVELOPMENT
|
||||||
# import qualified Web.Heroku
|
# import qualified Web.Heroku
|
||||||
# #endif
|
# #endif
|
||||||
#
|
#
|
||||||
# dbConnParams :: AppEnvironment -> IO [(Text, Text)]
|
# dbConnParams :: AppEnvironment -> IO [(Text, Text)]
|
||||||
# #ifdef !DEV
|
# #ifdef !DEVELOPMENT
|
||||||
# dbConnParams _ = Web.Heroku.dbConnParams
|
# dbConnParams _ = Web.Heroku.dbConnParams
|
||||||
# #else
|
# #else
|
||||||
# dbConnParams env = do
|
# dbConnParams env = do
|
||||||
|
|||||||
@ -35,7 +35,7 @@ library
|
|||||||
Handler.Root
|
Handler.Root
|
||||||
|
|
||||||
ghc-options: -Wall -threaded -O0
|
ghc-options: -Wall -threaded -O0
|
||||||
cpp-options: -DDEV
|
cpp-options: -DDEVELOPMENT
|
||||||
|
|
||||||
extensions: TemplateHaskell
|
extensions: TemplateHaskell
|
||||||
QuasiQuotes
|
QuasiQuotes
|
||||||
@ -54,7 +54,7 @@ executable ~project~
|
|||||||
Buildable: False
|
Buildable: False
|
||||||
|
|
||||||
if flag(dev)
|
if flag(dev)
|
||||||
cpp-options: -DDEV
|
cpp-options: -DDEVELOPMENT
|
||||||
ghc-options: -Wall -threaded -O0
|
ghc-options: -Wall -threaded -O0
|
||||||
else
|
else
|
||||||
ghc-options: -Wall -threaded
|
ghc-options: -Wall -threaded
|
||||||
|
|||||||
@ -28,7 +28,7 @@ mkYesodDispatch "~sitearg~" resources~sitearg~
|
|||||||
-- migrations handled by Yesod.
|
-- migrations handled by Yesod.
|
||||||
with~sitearg~ :: AppConfig DefaultEnv () -> Logger -> (Application -> IO ()) -> IO ()
|
with~sitearg~ :: AppConfig DefaultEnv () -> Logger -> (Application -> IO ()) -> IO ()
|
||||||
with~sitearg~ conf logger f = do
|
with~sitearg~ conf logger f = do
|
||||||
#ifdef DEV
|
#ifdef DEVELOPMENT
|
||||||
s <- staticDevel Settings.staticDir
|
s <- staticDevel Settings.staticDir
|
||||||
#else
|
#else
|
||||||
s <- static Settings.staticDir
|
s <- static Settings.staticDir
|
||||||
|
|||||||
@ -38,7 +38,7 @@ staticRoot :: AppConfig DefaultEnv a -> Text
|
|||||||
staticRoot conf = [~qq~st|#{appRoot conf}/static|]
|
staticRoot conf = [~qq~st|#{appRoot conf}/static|]
|
||||||
|
|
||||||
widgetFile :: String -> Q Exp
|
widgetFile :: String -> Q Exp
|
||||||
#if DEV
|
#if DEVELOPMENT
|
||||||
widgetFile = Yesod.Default.Util.widgetFileReload
|
widgetFile = Yesod.Default.Util.widgetFileReload
|
||||||
#else
|
#else
|
||||||
widgetFile = Yesod.Default.Util.widgetFileNoReload
|
widgetFile = Yesod.Default.Util.widgetFileNoReload
|
||||||
|
|||||||
@ -33,7 +33,7 @@ library
|
|||||||
Handler.Root
|
Handler.Root
|
||||||
|
|
||||||
ghc-options: -Wall -threaded -O0
|
ghc-options: -Wall -threaded -O0
|
||||||
cpp-options: -DDEV
|
cpp-options: -DDEVELOPMENT
|
||||||
|
|
||||||
extensions: TemplateHaskell
|
extensions: TemplateHaskell
|
||||||
QuasiQuotes
|
QuasiQuotes
|
||||||
@ -49,7 +49,7 @@ executable ~project~
|
|||||||
Buildable: False
|
Buildable: False
|
||||||
|
|
||||||
if flag(dev)
|
if flag(dev)
|
||||||
cpp-options: -DDEV
|
cpp-options: -DDEVELOPMENT
|
||||||
ghc-options: -Wall -threaded -O0
|
ghc-options: -Wall -threaded -O0
|
||||||
else
|
else
|
||||||
ghc-options: -Wall -threaded
|
ghc-options: -Wall -threaded
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user