| Copyright | Isaac Jones 2003-2005 Ross Paterson 2006 Duncan Coutts 2007-2008 2012 |
|---|---|
| License | BSD3 |
| Maintainer | cabal-devel@haskell.org |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Distribution.Simple.Build
Description
This is the entry point to actually building the modules in a package. It doesn't actually do much itself, most of the work is delegated to compiler-specific actions. It does do some non-compiler specific bits like running pre-processors.
Synopsis
- build :: PackageDescription -> LocalBuildInfo -> BuildFlags -> [PPSuffixHandler] -> IO ()
- build_setupHooks :: BuildHooks -> PackageDescription -> LocalBuildInfo -> BuildFlags -> [PPSuffixHandler] -> IO ()
- repl :: PackageDescription -> LocalBuildInfo -> ReplFlags -> [PPSuffixHandler] -> [String] -> IO ()
- repl_setupHooks :: BuildHooks -> PackageDescription -> LocalBuildInfo -> ReplFlags -> [PPSuffixHandler] -> [String] -> IO ()
- startInterpreter :: Verbosity -> ProgramDb -> Compiler -> Platform -> PackageDBStack -> IO ()
- preBuildComponent :: (LocalBuildInfo -> TargetInfo -> IO ()) -> Verbosity -> LocalBuildInfo -> TargetInfo -> IO ()
- data AutogenFile
- type AutogenFileContents = ByteString
- writeBuiltinAutogenFiles :: Verbosity -> PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> IO ()
- writeAutogenFiles :: Verbosity -> LocalBuildInfo -> ComponentLocalBuildInfo -> Map AutogenFile AutogenFileContents -> IO ()
- componentInitialBuildSteps :: FilePath -> PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> Verbosity -> IO ()
- initialBuildSteps :: FilePath -> PackageDescription -> LocalBuildInfo -> Verbosity -> IO ()
- createInternalPackageDB :: Verbosity -> LocalBuildInfo -> SymbolicPath Pkg (Dir Dist) -> IO PackageDB
- addInternalBuildTools :: PackageDescription -> LocalBuildInfo -> BuildInfo -> ProgramDb -> ProgramDb
Build
Arguments
| :: PackageDescription | Mostly information from the .cabal file |
| -> LocalBuildInfo | Configuration information |
| -> BuildFlags | Flags that the user passed to build |
| -> [PPSuffixHandler] | preprocessors to run before compiling |
| -> IO () |
Build the libraries and executables in this package.
Arguments
| :: BuildHooks | |
| -> PackageDescription | Mostly information from the .cabal file |
| -> LocalBuildInfo | Configuration information |
| -> BuildFlags | Flags that the user passed to build |
| -> [PPSuffixHandler] | preprocessors to run before compiling |
| -> IO () |
Repl
Arguments
| :: PackageDescription | Mostly information from the .cabal file |
| -> LocalBuildInfo | Configuration information |
| -> ReplFlags | Flags that the user passed to build |
| -> [PPSuffixHandler] | preprocessors to run before compiling |
| -> [String] | |
| -> IO () |
Arguments
| :: BuildHooks | build hook |
| -> PackageDescription | Mostly information from the .cabal file |
| -> LocalBuildInfo | Configuration information |
| -> ReplFlags | Flags that the user passed to build |
| -> [PPSuffixHandler] | preprocessors to run before compiling |
| -> [String] | |
| -> IO () |
startInterpreter :: Verbosity -> ProgramDb -> Compiler -> Platform -> PackageDBStack -> IO () Source #
Start an interpreter without loading any package files.
Build preparation
Arguments
| :: (LocalBuildInfo -> TargetInfo -> IO ()) | pre-build hook |
| -> Verbosity | |
| -> LocalBuildInfo | Configuration information |
| -> TargetInfo | |
| -> IO () |
Creates the autogenerated files for a particular configured component, and runs the pre-build hook.
data AutogenFile Source #
Constructors
| AutogenModule !ModuleName !Suffix | |
| AutogenFile !ShortText |
Instances
| Show AutogenFile Source # | |
Defined in Distribution.Simple.Build Methods showsPrec :: Int -> AutogenFile -> ShowS # show :: AutogenFile -> String # showList :: [AutogenFile] -> ShowS # | |
| Eq AutogenFile Source # | |
Defined in Distribution.Simple.Build | |
| Ord AutogenFile Source # | |
Defined in Distribution.Simple.Build Methods compare :: AutogenFile -> AutogenFile -> Ordering # (<) :: AutogenFile -> AutogenFile -> Bool # (<=) :: AutogenFile -> AutogenFile -> Bool # (>) :: AutogenFile -> AutogenFile -> Bool # (>=) :: AutogenFile -> AutogenFile -> Bool # max :: AutogenFile -> AutogenFile -> AutogenFile # min :: AutogenFile -> AutogenFile -> AutogenFile # | |
type AutogenFileContents = ByteString Source #
A representation of the contents of an autogenerated file.
writeBuiltinAutogenFiles :: Verbosity -> PackageDescription -> LocalBuildInfo -> ComponentLocalBuildInfo -> IO () Source #
Generate and write to disk all built-in autogenerated files
for the specified component. These files will be put in the
autogenerated module directory for this component
(see autogenComponentsModuleDir).
This includes:
writeAutogenFiles :: Verbosity -> LocalBuildInfo -> ComponentLocalBuildInfo -> Map AutogenFile AutogenFileContents -> IO () Source #
Write the given autogenerated files in the autogenerated modules directory for the component.
Legacy functions
componentInitialBuildSteps Source #
Arguments
| :: FilePath | "dist" prefix |
| -> PackageDescription | mostly information from the .cabal file |
| -> LocalBuildInfo | Configuration information |
| -> ComponentLocalBuildInfo | Build info about the component |
| -> Verbosity | The verbosity to use |
| -> IO () |
Deprecated: This function does not prepare all source files for a component. Suggestion: use 'Setup repl compName --repl-multi-file=fn'.
Creates the autogenerated files for a particular configured component.
Legacy function: does not run pre-build hooks or pre-processors. This function is insufficient on its own to prepare the build for a component.
Consumers wanting to prepare the sources of a component, e.g. in order to
launch a REPL session, are advised to run
Setup repl compName --repl-multi-file=fn instead.
Arguments
| :: FilePath | "dist" prefix |
| -> PackageDescription | mostly information from the .cabal file |
| -> LocalBuildInfo | Configuration information |
| -> Verbosity | The verbosity to use |
| -> IO () |
Deprecated: This function does not prepare all source files for a package. Suggestion: use 'Setup repl --repl-multi-file=fn'.
Runs componentInitialBuildSteps on every configured component.
Legacy function: does not run pre-build hooks or pre-processors. This function is insufficient on its own to prepare the build for a package.
Consumers wanting to prepare the sources of a package, e.g. in order to
launch a REPL session, are advised to run Setup repl --repl-multi-file=fn
instead.
Internal package database creation
createInternalPackageDB :: Verbosity -> LocalBuildInfo -> SymbolicPath Pkg (Dir Dist) -> IO PackageDB Source #
Initialize a new package db file for libraries defined internally to the package.
Handling of internal build tools
addInternalBuildTools :: PackageDescription -> LocalBuildInfo -> BuildInfo -> ProgramDb -> ProgramDb Source #
Update the program database to include any build-tool-depends specified
in the given BuildInfo on build tools internal to the current package.
This function:
- adds these internal build tools to the
ProgramDb, including paths to their respective data directories, - adds their paths to the current
progSearchPath, and adds the data directory environment variable for the current package to the currentprogOverrideEnv, so that any programs configured from now on will be able to invoke these build tools.