Maintainer | duncan@community.haskell.org |
---|---|
Safe Haskell | None |
Distribution.Simple.BuildTarget
Description
Handling for user-specified build targets
- data BuildTarget
- readBuildTargets :: PackageDescription -> [String] -> IO [BuildTarget]
- showBuildTarget :: QualLevel -> PackageId -> BuildTarget -> String
- data QualLevel
- buildTargetComponentName :: BuildTarget -> ComponentName
- data UserBuildTarget
- readUserBuildTargets :: [String] -> ([UserBuildTargetProblem], [UserBuildTarget])
- showUserBuildTarget :: UserBuildTarget -> String
- data UserBuildTargetProblem = UserBuildTargetUnrecognised String
- reportUserBuildTargetProblems :: [UserBuildTargetProblem] -> IO ()
- resolveBuildTargets :: PackageDescription -> [(UserBuildTarget, Bool)] -> ([BuildTargetProblem], [BuildTarget])
- data BuildTargetProblem
- = BuildTargetExpected UserBuildTarget [String] String
- | BuildTargetNoSuch UserBuildTarget [(String, String)]
- | BuildTargetAmbiguous UserBuildTarget [(UserBuildTarget, BuildTarget)]
- reportBuildTargetProblems :: [BuildTargetProblem] -> IO ()
Build targets
data BuildTarget
A fully resolved build target.
Constructors
BuildTargetComponent ComponentName | A specific component |
BuildTargetModule ComponentName ModuleName | A specific module within a specific component. |
BuildTargetFile ComponentName FilePath | A specific file within a specific component. |
Instances
Eq BuildTarget | |
Show BuildTarget | |
Generic BuildTarget | |
Binary BuildTarget |
readBuildTargets :: PackageDescription -> [String] -> IO [BuildTarget]
Read a list of user-supplied build target strings and resolve them to
BuildTarget
s according to a PackageDescription
. If there are problems
with any of the targets e.g. they don't exist or are misformatted, throw an
IOException
.
showBuildTarget :: QualLevel -> PackageId -> BuildTarget -> String
Parsing user build targets
data UserBuildTarget
Various ways that a user may specify a build target.
Instances
Eq UserBuildTarget | |
Ord UserBuildTarget | |
Show UserBuildTarget |
readUserBuildTargets :: [String] -> ([UserBuildTargetProblem], [UserBuildTarget])
showUserBuildTarget :: UserBuildTarget -> String
Constructors
UserBuildTargetUnrecognised String |
Instances
reportUserBuildTargetProblems :: [UserBuildTargetProblem] -> IO ()
Resolving build targets
resolveBuildTargets :: PackageDescription -> [(UserBuildTarget, Bool)] -> ([BuildTargetProblem], [BuildTarget])
Given a bunch of user-specified targets, try to resolve what it is they refer to.
data BuildTargetProblem
Constructors
BuildTargetExpected UserBuildTarget [String] String |
|
BuildTargetNoSuch UserBuildTarget [(String, String)] |
|
BuildTargetAmbiguous UserBuildTarget [(UserBuildTarget, BuildTarget)] |
Instances
Show BuildTargetProblem |
reportBuildTargetProblems :: [BuildTargetProblem] -> IO ()