Cabal-1.22.5.0: A framework for packaging Haskell software

Copyright | (c) Duncan Coutts 2012
License | BSD-like
Maintainer | duncan@community.haskell.org
Safe Haskell | None
Language | Haskell98

Distribution.Simple.BuildTarget

Contents

- Build targets
- Parsing user build targets
- Resolving build targets

Description

Handling for user-specified build targets

Synopsis

- data BuildTarget
  - = BuildTargetComponent ComponentName
  - | BuildTargetModule ComponentName ModuleName
  - | BuildTargetFile ComponentName FilePath
- readBuildTargets :: PackageDescription -> [String] -> IO [BuildTarget]
- data UserBuildTarget
- readUserBuildTargets :: [String] -> ([UserBuildTargetProblem], [UserBuildTarget])
- data UserBuildTargetProblem = UserBuildTargetUnrecognised String
- reportUserBuildTargetProblems :: [UserBuildTargetProblem] -> IO ()
- resolveBuildTargets :: PackageDescription -> [(UserBuildTarget, Bool)] -> ([BuildTargetProblem], [BuildTarget])
- data BuildTargetProblem
  - = BuildTargetExpected UserBuildTarget [String] String
  - | BuildTargetNoSuch UserBuildTarget [(String, String)]
  - | BuildTargetAmbigious UserBuildTarget [(UserBuildTarget, BuildTarget)]
- reportBuildTargetProblems :: [BuildTargetProblem] -> IO ()

# Build targets

data BuildTarget Source

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 Source |
Show BuildTarget Source |

readBuildTargets :: PackageDescription -> [String] -> IO [BuildTarget] Source

# Parsing user build targets

data UserBuildTarget Source

Various ways that a user may specify a build target.

Instances

Eq UserBuildTarget Source |
Ord UserBuildTarget Source |
Show UserBuildTarget Source |

readUserBuildTargets :: [String] -> ([UserBuildTargetProblem], [UserBuildTarget]) Source

data UserBuildTargetProblem Source

Constructors

UserBuildTargetUnrecognised String |

Instances

Show UserBuildTargetProblem Source |

reportUserBuildTargetProblems :: [UserBuildTargetProblem] -> IO () Source

# Resolving build targets

resolveBuildTargets :: PackageDescription -> [(UserBuildTarget, Bool)] -> ([BuildTargetProblem], [BuildTarget]) Source

Given a bunch of user-specified targets, try to resolve what it is they refer to.

data BuildTargetProblem Source

Constructors

BuildTargetExpected UserBuildTarget [String] String

expected thing
  (actually got)

BuildTargetNoSuch UserBuildTarget [(String, String)]

(no such thing, actually got)

BuildTargetAmbigious UserBuildTarget [(UserBuildTarget, BuildTarget)] |

Instances

Show BuildTargetProblem Source |

reportBuildTargetProblems :: [BuildTargetProblem] -> IO () Source