dynamic-cabal-0.1: dynamic-cabal

Safe HaskellNone

Distribution.Client.Dynamic.PackageDescription

Description

This module contains queries that operate on a PackageDescription. It provides a function to extract all targets along with their dependencies.

Synopsis

Documentation

data Target Source

A target is a single Library, an Excutable, a TestSuite or a Benchmark.

Constructors

Target 

Fields

name :: TargetName

The name of the target

dependencies :: [(String, Maybe Version)]

All dependencies of the target, with their versions. If the version is not resolved yet, it'll be Nothing. That only happens when the target is not enabled, though.

sourceDirs :: [FilePath]

Directories where to look for source files.

includeDirs :: [FilePath]

Directories where to look for header files.

ghcOptions :: [String]

Additional options to pass to GHC when compiling source files.

extensions :: [String]

The extensions to enable/disable. The elements are like GHC's -X flags, a disabled extension is represented as the extension name prefixed by No. Example value: extensions = [ScopedTypeVariables, NoMultiParamTypeClasses]

buildable :: Bool

The buildable field in the package description.

enabled :: Bool

Whether this target was enabled or not. This only matters for Benchmarks or Tests, Executables and Libraries are always enabled.

data TargetName Source

The name of a target. Libraries don't have a name, they are always named after the package.

data PackageDescription Source

A package description type. This type has no constructors, and is only used for type-safety purposes.

targets :: Query PackageDescription [Target]Source

Query the available targets. This will return all targets, even disabled ones. If a package is disabled or not buildable, it's possible that not all dependencies have versions, some can be Nothing.