| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Stack.Package
Description
Dealing with Cabal.
- readPackage :: (MonadLogger m, MonadIO m, MonadThrow m, MonadCatch m) => PackageConfig -> Path Abs File -> m Package
- readPackageBS :: MonadThrow m => PackageConfig -> ByteString -> m Package
- readPackageDir :: (MonadLogger m, MonadIO m, MonadThrow m, MonadCatch m) => PackageConfig -> Path Abs Dir -> m (Path Abs File, Package)
- readPackageUnresolved :: (MonadIO m, MonadThrow m) => Path Abs File -> m GenericPackageDescription
- readPackageUnresolvedBS :: MonadThrow m => Maybe (Path Abs File) -> ByteString -> m GenericPackageDescription
- resolvePackage :: PackageConfig -> GenericPackageDescription -> Package
- getCabalFileName :: (MonadThrow m, MonadIO m) => Path Abs Dir -> m (Path Abs File)
- data Package = Package {
- packageName :: !PackageName
- packageVersion :: !Version
- packageFiles :: !GetPackageFiles
- packageDeps :: !(Map PackageName VersionRange)
- packageTools :: ![Dependency]
- packageAllDeps :: !(Set PackageName)
- packageFlags :: !(Map FlagName Bool)
- packageHasLibrary :: !Bool
- packageTests :: !(Set Text)
- packageBenchmarks :: !(Set Text)
- packageExes :: !(Set Text)
- packageOpts :: !GetPackageOpts
- packageHasExposedModules :: !Bool
- packageSimpleType :: !Bool
- newtype GetPackageFiles = GetPackageFiles {
- getPackageFiles :: forall m. (MonadIO m, MonadLogger m, MonadThrow m, MonadCatch m) => CabalFileType -> Path Abs File -> m (Set (Path Abs File))
- newtype GetPackageOpts = GetPackageOpts {
- getPackageOpts :: forall env m. (MonadIO m, HasEnvConfig env, HasPlatform env, MonadThrow m, MonadReader env m) => Path Abs File -> m [String]
- data PackageConfig = PackageConfig {
- packageConfigEnableTests :: !Bool
- packageConfigEnableBenchmarks :: !Bool
- packageConfigFlags :: !(Map FlagName Bool)
- packageConfigGhcVersion :: !Version
- packageConfigPlatform :: !Platform
- buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> m (Path Abs File)
- data PackageException
- = PackageInvalidCabalFile (Maybe (Path Abs File)) PError
- | PackageNoCabalFileFound (Path Abs Dir)
- | PackageMultipleCabalFilesFound (Path Abs Dir) [Path Abs File]
- | MismatchedCabalName (Path Abs File) PackageName
- resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescription
- packageToolDependencies :: PackageDescription -> Map ByteString VersionRange
- packageDependencies :: PackageDescription -> Map PackageName VersionRange
- packageIdentifier :: Package -> PackageIdentifier
- data CabalFileType
- autogenDir :: Path Abs Dir -> Path Abs Dir
Documentation
readPackage :: (MonadLogger m, MonadIO m, MonadThrow m, MonadCatch m) => PackageConfig -> Path Abs File -> m Package Source
Reads and exposes the package information
readPackageBS :: MonadThrow m => PackageConfig -> ByteString -> m Package Source
Reads and exposes the package information, from a ByteString
readPackageDir :: (MonadLogger m, MonadIO m, MonadThrow m, MonadCatch m) => PackageConfig -> Path Abs Dir -> m (Path Abs File, Package) Source
Convenience wrapper around readPackage that first finds the cabal file
in the given directory.
readPackageUnresolved :: (MonadIO m, MonadThrow m) => Path Abs File -> m GenericPackageDescription Source
Read the raw, unresolved package information.
readPackageUnresolvedBS :: MonadThrow m => Maybe (Path Abs File) -> ByteString -> m GenericPackageDescription Source
Read the raw, unresolved package information from a ByteString.
resolvePackage :: PackageConfig -> GenericPackageDescription -> Package Source
Resolve a parsed cabal file into a Package.
Arguments
| :: (MonadThrow m, MonadIO 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.
Some package info.
Constructors
| Package | |
Fields
| |
newtype GetPackageFiles Source
Files that the package depends on, relative to package directory. Argument is the location of the .cabal file
Constructors
| GetPackageFiles | |
Fields
| |
Instances
newtype GetPackageOpts Source
Files that the package depends on, relative to package directory. Argument is the location of the .cabal file
Constructors
| GetPackageOpts | |
Fields
| |
Instances
data PackageConfig Source
Package build configuration
Constructors
| PackageConfig | |
Fields
| |
Instances
buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> m (Path Abs File) Source
Path for the package's build log.
data PackageException Source
All exceptions thrown by the library.
Constructors
| PackageInvalidCabalFile (Maybe (Path Abs File)) PError | |
| PackageNoCabalFileFound (Path Abs Dir) | |
| PackageMultipleCabalFilesFound (Path Abs Dir) [Path Abs File] | |
| MismatchedCabalName (Path Abs File) PackageName |
resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescription Source
Get all dependencies of a package, including library, executables, tests, benchmarks.
packageToolDependencies :: PackageDescription -> Map ByteString VersionRange Source
Get all build tool dependencies of the package (buildable targets only).
packageDependencies :: PackageDescription -> Map PackageName VersionRange Source
Get all dependencies of the package (buildable targets only).
packageIdentifier :: Package -> PackageIdentifier Source
Get the identifier of the package.
autogenDir :: Path Abs Dir -> Path Abs Dir Source
Make the autogen dir.