stack-1.2.0: The Haskell Tool Stack

Safe HaskellNone
LanguageHaskell2010

Stack.Package

Description

Dealing with Cabal.

Synopsis

Documentation

readPackage :: (MonadLogger m, MonadIO m, MonadCatch m) => PackageConfig -> Path Abs File -> m ([PWarning], Package) #

Reads and exposes the package information

readPackageBS :: MonadThrow m => PackageConfig -> ByteString -> m ([PWarning], Package) #

Reads and exposes the package information, from a ByteString

readDotBuildinfo :: MonadIO m => Path Abs File -> m HookedBuildInfo #

Read package.buildinfo ancillary files produced by some Setup.hs hooks. The file includes Cabal file syntax to be merged into the package description derived from the package's .cabal file.

NOTE: not to be confused with BuildInfo, an Stack-internal datatype.

readPackageUnresolved :: (MonadIO m, MonadThrow m) => Path Abs File -> m ([PWarning], GenericPackageDescription) #

Read the raw, unresolved package information.

readPackageUnresolvedBS :: MonadThrow m => Maybe (Path Abs File) -> ByteString -> m ([PWarning], GenericPackageDescription) #

Read the raw, unresolved package information from a ByteString.

resolvePackage :: PackageConfig -> GenericPackageDescription -> Package #

Resolve a parsed cabal file into a Package.

findOrGenerateCabalFile #

Arguments

:: (MonadThrow m, MonadIO m, MonadLogger m) 
=> Path Abs Dir

package directory

-> m (Path Abs File) 

Get the filename for the cabal file in the given directory.

If no .cabal file is present, or more than one is present, an exception is thrown via throwM.

If the directory contains a file named package.yaml, hpack is used to generate a .cabal file from it.

hpack :: (MonadIO m, MonadLogger m) => Path Abs Dir -> m () #

Generate .cabal file from package.yaml, if necessary.

data Package #

Some package info.

Constructors

Package 

Fields

Instances

Eq Package #

Compares the package name.

Methods

(==) :: Package -> Package -> Bool #

(/=) :: Package -> Package -> Bool #

Ord Package #

Compares the package name.

Show Package # 

newtype GetPackageFiles #

Files that the package depends on, relative to package directory. Argument is the location of the .cabal file

newtype GetPackageOpts #

Files that the package depends on, relative to package directory. Argument is the location of the .cabal file

data PackageConfig #

Package build configuration

Constructors

PackageConfig 

Fields

buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> Maybe String -> m (Path Abs File) #

Path for the package's build log.

resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescription #

Get all dependencies of a package, including library, executables, tests, benchmarks.

packageToolDependencies :: PackageDescription -> Map Text VersionRange #

Get all build tool dependencies of the package (buildable targets only).

packageDependencies :: PackageDescription -> Map PackageName VersionRange #

Get all dependencies of the package (buildable targets only).

autogenDir :: Path Abs Dir -> Path Abs Dir #

Make the autogen dir.

checkCabalFileName :: MonadThrow m => PackageName -> Path Abs File -> m () #

Check if the given name in the Package matches the name of the .cabal file

printCabalFileWarning :: MonadLogger m => Path Abs File -> PWarning -> m () #

Print cabal file warnings.

cabalFilePackageId :: (MonadIO m, MonadThrow m) => Path Abs File -> m PackageIdentifier #

Extract the PackageIdentifier given an exploded haskell package path.