Custom cradle support

This commit is contained in:
Daniel Vigovszky
2015-03-03 12:18:54 +01:00
parent 247e4e0e76
commit 5d9d6f5630
8 changed files with 79 additions and 5 deletions

View File

@@ -193,7 +193,6 @@ cabalBuildPlatform = unsafePerformIO $ buildPlatform
packageCache :: String
packageCache = "package.cache"
-- | Filename of the symbol table cache file.
symbolCache :: Cradle -> FilePath
symbolCache crdl = cradleTempDir crdl </> symbolCacheFile
@@ -206,3 +205,13 @@ resolvedComponentsCacheFile = setupConfigPath <.> "ghc-mod.resolved-components"
cabalHelperCacheFile :: String
cabalHelperCacheFile = setupConfigPath <.> "ghc-mod.cabal-helper"
-- | @findCradleFile dir@. Searches for a @.ghc-mod.cradle@ file in @dir@.
-- If it exists in the given directory it is returned otherwise @findCradleFile@ returns @Nothing@
findCradleFile :: FilePath -> IO (Maybe FilePath)
findCradleFile directory = do
let path = directory </> "ghc-mod.cradle"
exists <- doesFileExist $ path
case exists of
True -> return $ Just path
False -> return Nothing