buildwrapper-0.6.4: A library and an executable that provide an easy API for a Haskell IDE

Safe HaskellNone

Language.Haskell.BuildWrapper.Cabal

Synopsis

Documentation

cabalBuildSource

Arguments

:: 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

cabalBuild'Source

Arguments

:: 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

cabalConfigureSource

Arguments

:: WhichCabal

use original cabal or temp cabal file

-> BuildWrapper (OpResult (Maybe LocalBuildInfo))

return the build info on success, or Nothing on failure

run cabal configure

getCabalFileSource

Arguments

:: WhichCabal

use original cabal or temp cabal file

-> BuildWrapper FilePath 

get the full path to the cabal file

cabalInitSource

Arguments

:: WhichCabal

use original cabal or temp cabal file

-> BuildWrapper (OpResult (Maybe LocalBuildInfo)) 

get Cabal build info, running configure if needed

withCabalSource

Arguments

:: WhichCabal

use original cabal or temp cabal file

-> (LocalBuildInfo -> 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

parseCabalMessagesSource

Arguments

:: FilePath

cabal file

-> FilePath

path to cabal executable

-> String

error output

-> [BWNote] 

parse cabal error messages and transform them in notre

setupExeSource

Arguments

:: FilePath

path to cabal executable

-> FilePath 

cabalErrorLineSource

Arguments

:: FilePath

cabal file

-> FilePath

path to cabal executable

-> String

line

-> Maybe (BWNote, [String]) 

parseBuildMessagesSource

Arguments

:: FilePath

cabal file

-> FilePath

path to cabal executable

-> FilePath

the dist directory

-> String

the build output

-> [BWNote] 

parse messages from build

validLocSource

Arguments

:: FilePath

the cabal file

-> FilePath

the dist dir

-> FilePath 
-> FilePath 

makeNoteSource

Arguments

:: BWNote

original note

-> [String]

message lines

-> BWNote 

add a message to the note

getBuiltPathSource

Arguments

:: String

the message line

-> Maybe FilePath

the path if we could parse it

get the path of a file getting compiled

data CabalBuildInfo Source

the cabal build info for a specific component

Constructors

CabalBuildInfo 

Fields

cbiBuildInfo :: BuildInfo

the build info

cbiComponentBuildInfo :: ComponentLocalBuildInfo

the component local build info

cbiBuildFolder :: FilePath

the folder to build that component into

cbiIsLibrary :: Bool

is the component the library

cbiModulePaths :: [(Maybe ModuleName, FilePath)]

the module name and corresponding source file for each contained Haskell module

cbiComponent :: CabalComponent

the component handle

canonicalizeBuildInfo :: CabalBuildInfo -> BuildWrapper CabalBuildInfoSource

canonicalize the paths in the build info

onModulePathsMSource

Arguments

:: 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

onModulePathsSource

Arguments

:: ([(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

getBuildInfoSource

Arguments

:: FilePath

the source file

-> Maybe String

the cabal component to use, or Nothing if not specified

-> BuildWrapper (OpResult (Maybe (LocalBuildInfo, CabalBuildInfo))) 

get the build info for a given source file if a source file is in several component, get the first one

fileGhcOptionsSource

Arguments

:: (LocalBuildInfo, CabalBuildInfo)

the cabal info

-> BuildWrapper [String]

the module name and the options to pass GHC

get GHC options for a file

fileCppOptionsSource

Arguments

:: CabalBuildInfo

the cabal info

-> [String]

the list of CPP options

get CPP options for a file

cabalExtensionsSource

Arguments

:: CabalBuildInfo

the cabal info

-> (ModuleName, [String])

the module name and cabal extensions

get the cabal extensions

getSourceDirsSource

Arguments

:: BuildInfo

the build info

-> [FilePath]

the source paths, guaranteed non null

get the source directory from a build info

getAllFilesSource

Arguments

:: LocalBuildInfo

the build info

-> BuildWrapper [CabalBuildInfo] 

get all components, referencing all the files found in the source folders

getReferencedFiles :: LocalBuildInfo -> BuildWrapper [CabalBuildInfo]Source

get all components, referencing only the files explicitely indicated in the cabal file

moduleToString :: ModuleName -> StringSource

convert a ModuleName to a String

cabalComponents :: BuildWrapper (OpResult [CabalComponent])Source

get all components in the Cabal file

cabalDependenciesSource

Arguments

:: 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

dependenciesSource

Arguments

:: PackageDescription

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

cabalComponentsFromDescriptionSource

Arguments

:: PackageDescription

the package description

-> [CabalComponent] 

get all components from the package description