fromCabal -> fromCabalFile.
This commit is contained in:
parent
ca229c3be1
commit
aa0b1d709c
16
CabalApi.hs
16
CabalApi.hs
@ -1,7 +1,7 @@
|
|||||||
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
|
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
|
||||||
|
|
||||||
module CabalApi (
|
module CabalApi (
|
||||||
fromCabal
|
fromCabalFile
|
||||||
, cabalParseFile
|
, cabalParseFile
|
||||||
, cabalBuildInfo
|
, cabalBuildInfo
|
||||||
, cabalAllDependPackages
|
, cabalAllDependPackages
|
||||||
@ -22,13 +22,13 @@ import Types
|
|||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
fromCabal :: [GHCOption]
|
fromCabalFile :: [GHCOption]
|
||||||
-> Cradle
|
-> Cradle
|
||||||
-> IO ([GHCOption]
|
-> IO ([GHCOption]
|
||||||
,[IncludeDir]
|
,[IncludeDir]
|
||||||
,[Package]
|
,[Package]
|
||||||
,[LangExt])
|
,[LangExt])
|
||||||
fromCabal ghcOptions cradle = do
|
fromCabalFile ghcOptions cradle = do
|
||||||
cabal <- cabalParseFile cfile
|
cabal <- cabalParseFile cfile
|
||||||
let binfo@BuildInfo{..} = cabalBuildInfo cabal
|
let binfo@BuildInfo{..} = cabalBuildInfo cabal
|
||||||
let exts = map (("-X" ++) . display) $ usedExtensions binfo
|
let exts = map (("-X" ++) . display) $ usedExtensions binfo
|
||||||
|
@ -47,7 +47,7 @@ initializeGHC opt cradle fileName ghcOptions logging
|
|||||||
| cabal =
|
| cabal =
|
||||||
initSession opt ghcOptions importDirs Nothing Nothing logging fileName
|
initSession opt ghcOptions importDirs Nothing Nothing logging fileName
|
||||||
| otherwise = do
|
| otherwise = do
|
||||||
(gopts,idirs,depPkgs,hdrExts) <- liftIO $ fromCabal ghcOptions cradle
|
(gopts,idirs,depPkgs,hdrExts) <- liftIO $ fromCabalFile ghcOptions cradle
|
||||||
initSession opt gopts idirs (Just depPkgs) (Just hdrExts) logging fileName
|
initSession opt gopts idirs (Just depPkgs) (Just hdrExts) logging fileName
|
||||||
where
|
where
|
||||||
cabal = isJust $ cradleCabalFile cradle
|
cabal = isJust $ cradleCabalFile cradle
|
||||||
|
Loading…
Reference in New Issue
Block a user