handle flag to disable GHC API recompilator
This commit is contained in:
parent
7e2fce52b5
commit
4dc5e74f02
@ -51,8 +51,8 @@ writeLock = do
|
|||||||
removeLock :: IO ()
|
removeLock :: IO ()
|
||||||
removeLock = try_ (removeFile lockFile)
|
removeLock = try_ (removeFile lockFile)
|
||||||
|
|
||||||
devel :: Bool -> [String] -> IO ()
|
devel :: Bool -> Bool -> [String] -> IO ()
|
||||||
devel isCabalDev passThroughArgs = do
|
devel isCabalDev forceCabal passThroughArgs = do
|
||||||
checkDevelFile
|
checkDevelFile
|
||||||
writeLock
|
writeLock
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ devel isCabalDev passThroughArgs = do
|
|||||||
ghcVer <- ghcVersion
|
ghcVer <- ghcVersion
|
||||||
_ <- rebuildCabal cmd
|
_ <- rebuildCabal cmd
|
||||||
pkgArgs <- ghcPackageArgs isCabalDev ghcVer
|
pkgArgs <- ghcPackageArgs isCabalDev ghcVer
|
||||||
rebuild <- mkRebuild ghcVer cabal cmd ldar
|
rebuild <- mkRebuild ghcVer cabal cmd forceCabal ldar
|
||||||
let devArgs = pkgArgs ++ ["devel.hs"] ++ passThroughArgs
|
let devArgs = pkgArgs ++ ["devel.hs"] ++ passThroughArgs
|
||||||
forever $ do
|
forever $ do
|
||||||
recompDeps hsSourceDirs
|
recompDeps hsSourceDirs
|
||||||
@ -123,8 +123,9 @@ devel isCabalDev passThroughArgs = do
|
|||||||
Ex.throwTo watchTid (userError "process finished")
|
Ex.throwTo watchTid (userError "process finished")
|
||||||
watchForChanges hsSourceDirs list
|
watchForChanges hsSourceDirs list
|
||||||
|
|
||||||
mkRebuild :: String -> FilePath -> String -> (FilePath, FilePath) -> IO (IO Bool)
|
mkRebuild :: String -> FilePath -> String -> Bool -> (FilePath, FilePath) -> IO (IO Bool)
|
||||||
mkRebuild ghcVer cabalFile cabalCmd (ldPath, arPath)
|
mkRebuild ghcVer cabalFile cabalCmd forceCabal (ldPath, arPath)
|
||||||
|
| forceCabal = return (rebuildCabal cabalCmd)
|
||||||
| GHC.cProjectVersion == ghcVer = do
|
| GHC.cProjectVersion == ghcVer = do
|
||||||
bf <- getBuildFlags
|
bf <- getBuildFlags
|
||||||
return $ do
|
return $ do
|
||||||
|
|||||||
@ -34,6 +34,7 @@ cabalCommand mopt
|
|||||||
| optCabalDev mopt = "cabal-dev"
|
| optCabalDev mopt = "cabal-dev"
|
||||||
| otherwise = "cabal"
|
| otherwise = "cabal"
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
main = runSubcommand'
|
main = runSubcommand'
|
||||||
[ subcommand "init" cmdInit
|
[ subcommand "init" cmdInit
|
||||||
, subcommand "configure" cmdConfigure
|
, subcommand "configure" cmdConfigure
|
||||||
@ -60,7 +61,7 @@ cmdTouch :: MainOptions -> TouchOptions -> [String] -> IO ()
|
|||||||
cmdTouch _ _ _ = touch
|
cmdTouch _ _ _ = touch
|
||||||
|
|
||||||
cmdDevel :: MainOptions -> DevelOptions -> [String] -> IO ()
|
cmdDevel :: MainOptions -> DevelOptions -> [String] -> IO ()
|
||||||
cmdDevel mopt opts args = devel (optCabalDev mopt) args
|
cmdDevel mopt opts args = devel (optCabalDev mopt) forceCabal args
|
||||||
where
|
where
|
||||||
forceCabal = develOptNoApi opts
|
forceCabal = develOptNoApi opts
|
||||||
|
|
||||||
@ -97,3 +98,4 @@ describeSubcommands = unlines
|
|||||||
, " devel Run project with the devel server"
|
, " devel Run project with the devel server"
|
||||||
, " version Print the version of Yesod"
|
, " version Print the version of Yesod"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user