Copyright | (c) JP Moresmau 2011 |
---|---|
License | BSD3 |
Maintainer | jpmoresmau@gmail.com |
Stability | beta |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
Cabal operations: configure, build, retrieve information from build info, parse errors and warnings
- getCabalLibraryVersion :: String
- getFilesToCopy :: BuildWrapper (OpResult [FilePath])
- cabalV :: BuildWrapper Verbosity
- cabalBuild :: Bool -> WhichCabal -> BuildWrapper (OpResult BuildResult)
- cabalBuild' :: Bool -> Bool -> WhichCabal -> BuildWrapper (OpResult BuildResult)
- targetFile :: String
- cabalConfigure :: WhichCabal -> BuildWrapper (OpResult (Maybe [Target]))
- getCabalFile :: WhichCabal -> BuildWrapper FilePath
- getPackageName :: BuildWrapper String
- cabalInit :: WhichCabal -> BuildWrapper (OpResult (Maybe [Target]))
- withCabal :: WhichCabal -> ([Target] -> BuildWrapper a) -> BuildWrapper (OpResult (Maybe a))
- parseCabalMessages :: FilePath -> FilePath -> String -> [BWNote]
- setupExe :: FilePath -> FilePath
- fromCabalDevExe :: FilePath -> FilePath
- dropPrefixes :: [String] -> String -> Maybe String
- stripPrefixIfNeeded :: String -> String -> Maybe String -> Maybe String
- addCurrent :: Maybe (BWNote, [String]) -> [BWNote] -> [BWNote]
- cabalErrorLine :: FilePath -> FilePath -> String -> Bool -> Maybe (BWNote, [String])
- parseBuildMessages :: FilePath -> FilePath -> FilePath -> String -> [BWNote]
- validLoc :: FilePath -> FilePath -> FilePath -> FilePath
- readInt :: String -> Int -> Int
- tryReadList :: Read a => String -> [a]
- makeNote :: BWNote -> [String] -> BWNote
- getBuiltPath :: String -> Maybe FilePath
- data CabalBuildInfo = CabalBuildInfo {}
- canonicalizeBuildInfo :: CabalBuildInfo -> BuildWrapper CabalBuildInfo
- onModulePathsM :: Monad a => ([(Maybe ModuleName, FilePath)] -> a [(Maybe ModuleName, FilePath)]) -> CabalBuildInfo -> a CabalBuildInfo
- onModulePaths :: ([(Maybe ModuleName, FilePath)] -> [(Maybe ModuleName, FilePath)]) -> CabalBuildInfo -> CabalBuildInfo
- getBuildInfo :: FilePath -> Maybe String -> BuildWrapper (OpResult (Maybe ([Target], CabalBuildInfo)))
- setOptions :: FilePath -> Maybe FilePath -> [Target] -> IO [Target]
- fileGhcOptions :: CabalBuildInfo -> BuildWrapper [String]
- fileCppOptions :: CabalBuildInfo -> [String]
- cabalExtensions :: CabalBuildInfo -> (ModuleName, [String])
- getSourceDirs :: Target -> [FilePath]
- getAllFiles :: [Target] -> BuildWrapper [CabalBuildInfo]
- getBuildDir :: FilePath -> Target -> FilePath
- getReferencedFiles :: [Target] -> BuildWrapper [CabalBuildInfo]
- stringToModuleName :: String -> Maybe ModuleName
- moduleToString :: ModuleName -> String
- cabalComponents :: BuildWrapper (OpResult [CabalComponent])
- cabalDependencies :: Maybe FilePath -> BuildWrapper (OpResult [(FilePath, [CabalPackage])])
- dependencies :: [Target] -> [(FilePath, [InstalledPackageInfo])] -> [(FilePath, [CabalPackage])]
- cabalComponentsFromDescription :: [Target] -> [CabalComponent]
- cabalComponentsDependencies :: [Target] -> Map CabalComponent [(String, Maybe Version)]
- cabalComponentFromTarget :: Target -> CabalComponent
- cabalComponentFromLibrary :: Target -> CabalComponent
- cabalComponentFromExecutable :: Target -> CabalComponent
- cabalComponentFromTestSuite :: Target -> CabalComponent
- cabalComponentFromBenchmark :: Target -> CabalComponent
Documentation
getCabalLibraryVersion :: String Source
get the version of the cabal library
getFilesToCopy :: BuildWrapper (OpResult [FilePath]) Source
get all files to copy to temp folder
cabalV :: BuildWrapper Verbosity Source
get cabal verbose level
:: Bool | do we want output (True) or just compilation without linking? |
-> WhichCabal | use original cabal or temp cabal file |
-> BuildWrapper (OpResult BuildResult) |
run cabal build
:: Bool | can we rerun configure again |
-> Bool | do we want output (True) or just compilation without linking? |
-> WhichCabal | use original cabal or temp cabal file |
-> BuildWrapper (OpResult BuildResult) |
run cabal build
the file where we save the targets
:: WhichCabal | use original cabal or temp cabal file |
-> BuildWrapper (OpResult (Maybe [Target])) | return the build info on success, or Nothing on failure |
run cabal configure
:: WhichCabal | use original cabal or temp cabal file |
-> BuildWrapper FilePath |
get the full path to the cabal file
getPackageName :: BuildWrapper String Source
get package name from cabal file
:: WhichCabal | use original cabal or temp cabal file |
-> BuildWrapper (OpResult (Maybe [Target])) |
get Cabal build info, running configure if needed
:: WhichCabal | use original cabal or temp cabal file |
-> ([Target] -> BuildWrapper a) | action to run if we get a build info |
-> BuildWrapper (OpResult (Maybe a)) | the result of the action, or Nothing if we could get Cabal info |
run a action with the cabal build info
parse cabal error messages and transform them in notre
get cabal executable from cabal-dev
dropPrefixes :: [String] -> String -> Maybe String Source
drop all potential prefixes from the given string
stripPrefixIfNeeded :: String -> String -> Maybe String -> Maybe String Source
stop prefix if the given string starts by it
addCurrent :: Maybe (BWNote, [String]) -> [BWNote] -> [BWNote] Source
add a note with a potential additional message
:: FilePath | cabal file |
-> FilePath | path to cabal executable |
-> String | line |
-> Bool | first error? |
-> Maybe (BWNote, [String]) |
parse a Cabal error line
:: FilePath | cabal file |
-> FilePath | path to cabal executable |
-> FilePath | the dist directory |
-> String | the build output |
-> [BWNote] |
parse messages from build
get a valid path
tryReadList :: Read a => String -> [a] Source
read a list and return the empty list if not readable
get the path of a file getting compiled
data CabalBuildInfo Source
the cabal build info for a specific component
CabalBuildInfo | |
|
canonicalizeBuildInfo :: CabalBuildInfo -> BuildWrapper CabalBuildInfo Source
canonicalize the paths in the build info
:: Monad a | |
=> ([(Maybe ModuleName, FilePath)] -> a [(Maybe ModuleName, FilePath)]) | the function to apply |
-> CabalBuildInfo | the original build info |
-> a CabalBuildInfo | the result |
apply a function on the build info modules and paths, in a monad
:: ([(Maybe ModuleName, FilePath)] -> [(Maybe ModuleName, FilePath)]) | the function to apply |
-> CabalBuildInfo | the original build info |
-> CabalBuildInfo | the result |
apply a function on the build info modules and paths
:: FilePath | the source file |
-> Maybe String | the cabal component to use, or Nothing if not specified |
-> BuildWrapper (OpResult (Maybe ([Target], CabalBuildInfo))) |
get the build info for a given source file if a source file is in several component, get the first one
:: FilePath | dist directory |
-> Maybe FilePath | path to GHC if explicitely specified |
-> [Target] | targets to set options onto |
-> IO [Target] |
set the GHC options on targets
:: CabalBuildInfo | the cabal info |
-> BuildWrapper [String] | the module name and the options to pass GHC |
get GHC options for a file
:: CabalBuildInfo | the cabal info |
-> [String] | the list of CPP options |
get CPP options for a file
:: CabalBuildInfo | the cabal info |
-> (ModuleName, [String]) | the module name and cabal extensions |
get the cabal extensions
get the source directory from a build info
:: [Target] | the build info |
-> BuildWrapper [CabalBuildInfo] |
get all components, referencing all the files found in the source folders
getBuildDir :: FilePath -> Target -> FilePath Source
get build dir for a target
getReferencedFiles :: [Target] -> BuildWrapper [CabalBuildInfo] Source
get all components, referencing only the files explicitely indicated in the cabal file
stringToModuleName :: String -> Maybe ModuleName Source
parse a string into a module name
moduleToString :: ModuleName -> String Source
convert a ModuleName to a String
cabalComponents :: BuildWrapper (OpResult [CabalComponent]) Source
get all components in the Cabal file
:: Maybe FilePath | the path to the cabal-dev sandbox if any |
-> BuildWrapper (OpResult [(FilePath, [CabalPackage])]) | the result is an array of tuples: the path to the package database, the list of packages in that db that the Cabal file references |
get all the dependencies in the cabal file
:: [Target] | the cabal description |
-> [(FilePath, [InstalledPackageInfo])] | the installed packages, by package database location |
-> [(FilePath, [CabalPackage])] | the referenced packages, by package database location |
get all dependencies from the package description and the list of installed packages
cabalComponentsFromDescription Source
:: [Target] | the package description |
-> [CabalComponent] |
get all components from the package description
cabalComponentsDependencies Source
get dependencies for all stanzas
cabalComponentFromTarget :: Target -> CabalComponent Source
convert a dynamic cabla target into a CabalComponent
cabalComponentFromLibrary :: Target -> CabalComponent Source
transform a library target into a CabalComponent
cabalComponentFromExecutable :: Target -> CabalComponent Source
transform an executable target into a CabalComponent
cabalComponentFromTestSuite :: Target -> CabalComponent Source
transform a test suite target into a CabalComponent
cabalComponentFromBenchmark :: Target -> CabalComponent Source
transform a benchmark target into a CabalComponent