Copyright | (c) Duncan Coutts 2012 |
---|---|
License | BSD-like |
Maintainer | duncan@community.haskell.org |
Safe Haskell | None |
Language | Haskell2010 |
Handling for user-specified build targets
Synopsis
- readTargetInfos :: Verbosity -> PackageDescription -> LocalBuildInfo -> [String] -> IO [TargetInfo]
- readBuildTargets :: Verbosity -> PackageDescription -> [String] -> IO [BuildTarget]
- data BuildTarget
- showBuildTarget :: PackageId -> BuildTarget -> String
- data QualLevel
- buildTargetComponentName :: BuildTarget -> ComponentName
- data UserBuildTarget
- readUserBuildTargets :: [String] -> ([UserBuildTargetProblem], [UserBuildTarget])
- showUserBuildTarget :: UserBuildTarget -> String
- data UserBuildTargetProblem = UserBuildTargetUnrecognised String
- reportUserBuildTargetProblems :: Verbosity -> [UserBuildTargetProblem] -> IO ()
- resolveBuildTargets :: PackageDescription -> [(UserBuildTarget, Bool)] -> ([BuildTargetProblem], [BuildTarget])
- data BuildTargetProblem
- reportBuildTargetProblems :: Verbosity -> [BuildTargetProblem] -> IO ()
Main interface
readTargetInfos :: Verbosity -> PackageDescription -> LocalBuildInfo -> [String] -> IO [TargetInfo] #
Take a list of String
build targets, and parse and validate them
into actual TargetInfo
s to be builtregisteredwhatever.
readBuildTargets :: Verbosity -> 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
.
Build targets
data BuildTarget #
A fully resolved build target.
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
showBuildTarget :: PackageId -> BuildTarget -> String #
Unambiguously render a BuildTarget
, so that it can
be parsed in all situations.
Instances
Enum QualLevel # | |
succ :: QualLevel -> QualLevel # pred :: QualLevel -> QualLevel # fromEnum :: QualLevel -> Int # enumFrom :: QualLevel -> [QualLevel] # enumFromThen :: QualLevel -> QualLevel -> [QualLevel] # enumFromTo :: QualLevel -> QualLevel -> [QualLevel] # enumFromThenTo :: QualLevel -> QualLevel -> QualLevel -> [QualLevel] # | |
Show QualLevel # | |
Parsing user build targets
data UserBuildTarget #
Various ways that a user may specify a build target.
Instances
Eq UserBuildTarget # | |
(==) :: UserBuildTarget -> UserBuildTarget -> Bool # (/=) :: UserBuildTarget -> UserBuildTarget -> Bool # | |
Ord UserBuildTarget # | |
compare :: UserBuildTarget -> UserBuildTarget -> Ordering # (<) :: UserBuildTarget -> UserBuildTarget -> Bool # (<=) :: UserBuildTarget -> UserBuildTarget -> Bool # (>) :: UserBuildTarget -> UserBuildTarget -> Bool # (>=) :: UserBuildTarget -> UserBuildTarget -> Bool # max :: UserBuildTarget -> UserBuildTarget -> UserBuildTarget # min :: UserBuildTarget -> UserBuildTarget -> UserBuildTarget # | |
Show UserBuildTarget # | |
showsPrec :: Int -> UserBuildTarget -> ShowS # show :: UserBuildTarget -> String # showList :: [UserBuildTarget] -> ShowS # |
readUserBuildTargets :: [String] -> ([UserBuildTargetProblem], [UserBuildTarget]) #
data UserBuildTargetProblem #
Instances
Show UserBuildTargetProblem # | |
showsPrec :: Int -> UserBuildTargetProblem -> ShowS # show :: UserBuildTargetProblem -> String # showList :: [UserBuildTargetProblem] -> ShowS # |
reportUserBuildTargetProblems :: Verbosity -> [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 #
BuildTargetExpected UserBuildTarget [String] String |
|
BuildTargetNoSuch UserBuildTarget [(String, String)] |
|
BuildTargetAmbiguous UserBuildTarget [(UserBuildTarget, BuildTarget)] |
Instances
Show BuildTargetProblem # | |
showsPrec :: Int -> BuildTargetProblem -> ShowS # show :: BuildTargetProblem -> String # showList :: [BuildTargetProblem] -> ShowS # |
reportBuildTargetProblems :: Verbosity -> [BuildTargetProblem] -> IO () #