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

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 |

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

# 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])

data UserBuildTargetProblem

Constructors

UserBuildTargetUnrecognised String |

Instances

Show UserBuildTargetProblem |

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 | expected thing (actually got)
BuildTargetNoSuch UserBuildTarget [(String, String)] | (no such thing, actually got)
BuildTargetAmbigious UserBuildTarget [(UserBuildTarget, BuildTarget)] |

Instances

Show BuildTargetProblem |

reportBuildTargetProblems :: [BuildTargetProblem] -> IO ()