Safe Haskell | None |
---|---|
Language | Haskell2010 |
Dealing with Cabal.
- readPackage :: (MonadLogger m, MonadIO m, MonadCatch m) => PackageConfig -> Path Abs File -> m ([PWarning], Package)
- readPackageBS :: MonadThrow m => PackageConfig -> ByteString -> m ([PWarning], Package)
- readPackageDescriptionDir :: (MonadLogger m, MonadIO m, MonadCatch m) => PackageConfig -> Path Abs Dir -> m (GenericPackageDescription, PackageDescription)
- readDotBuildinfo :: MonadIO m => Path Abs File -> m HookedBuildInfo
- readPackageUnresolved :: (MonadIO m, MonadThrow m) => Path Abs File -> m ([PWarning], GenericPackageDescription)
- readPackageUnresolvedBS :: MonadThrow m => Maybe (Path Abs File) -> ByteString -> m ([PWarning], GenericPackageDescription)
- resolvePackage :: PackageConfig -> GenericPackageDescription -> Package
- packageFromPackageDescription :: PackageConfig -> [Flag] -> PackageDescription -> Package
- findOrGenerateCabalFile :: forall m. (MonadThrow m, MonadIO m, MonadLogger m) => Path Abs Dir -> m (Path Abs File)
- hpack :: (MonadIO m, MonadLogger m) => Path Abs Dir -> m ()
- data Package = Package {
- packageName :: !PackageName
- packageVersion :: !Version
- packageLicense :: !License
- packageFiles :: !GetPackageFiles
- packageDeps :: !(Map PackageName VersionRange)
- packageTools :: ![Dependency]
- packageAllDeps :: !(Set PackageName)
- packageGhcOptions :: ![Text]
- packageFlags :: !(Map FlagName Bool)
- packageDefaultFlags :: !(Map FlagName Bool)
- packageHasLibrary :: !Bool
- packageTests :: !(Map Text TestSuiteInterface)
- packageBenchmarks :: !(Set Text)
- packageExes :: !(Set Text)
- packageOpts :: !GetPackageOpts
- packageHasExposedModules :: !Bool
- packageBuildType :: !(Maybe BuildType)
- packageSetupDeps :: !(Maybe (Map PackageName VersionRange))
- newtype GetPackageFiles = GetPackageFiles {
- getPackageFiles :: forall m env. (StackM env m, HasEnvConfig env) => Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Set (Path Abs File), [PackageWarning])
- newtype GetPackageOpts = GetPackageOpts {
- getPackageOpts :: forall env m. (StackM env m, HasEnvConfig env) => SourceMap -> InstalledMap -> [PackageName] -> [PackageName] -> Path Abs File -> m (Map NamedComponent (Set ModuleName), Map NamedComponent (Set DotCabalPath), Map NamedComponent BuildInfoOpts)
- data PackageConfig = PackageConfig {}
- buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> Maybe String -> m (Path Abs File)
- data PackageException
- resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescription
- packageToolDependencies :: PackageDescription -> Map Text VersionRange
- packageDependencies :: PackageDescription -> Map PackageName VersionRange
- autogenDir :: Path Abs Dir -> Path Abs Dir
- checkCabalFileName :: MonadThrow m => PackageName -> Path Abs File -> m ()
- printCabalFileWarning :: MonadLogger m => Path Abs File -> PWarning -> m ()
- cabalFilePackageId :: (MonadIO m, MonadThrow m) => Path Abs File -> m PackageIdentifier
Documentation
readPackage :: (MonadLogger m, MonadIO m, MonadCatch m) => PackageConfig -> Path Abs File -> m ([PWarning], Package) Source #
Reads and exposes the package information
readPackageBS :: MonadThrow m => PackageConfig -> ByteString -> m ([PWarning], Package) Source #
Reads and exposes the package information, from a ByteString
readPackageDescriptionDir :: (MonadLogger m, MonadIO m, MonadCatch m) => PackageConfig -> Path Abs Dir -> m (GenericPackageDescription, PackageDescription) Source #
Get GenericPackageDescription
and PackageDescription
reading info
from given directory.
readDotBuildinfo :: MonadIO m => Path Abs File -> m HookedBuildInfo Source #
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) Source #
Read the raw, unresolved package information.
readPackageUnresolvedBS :: MonadThrow m => Maybe (Path Abs File) -> ByteString -> m ([PWarning], GenericPackageDescription) Source #
Read the raw, unresolved package information from a ByteString.
packageFromPackageDescription :: PackageConfig -> [Flag] -> PackageDescription -> Package Source #
findOrGenerateCabalFile Source #
:: (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 () Source #
Generate .cabal file from package.yaml, if necessary.
Some package info.
Package | |
|
newtype GetPackageFiles Source #
Files that the package depends on, relative to package directory. Argument is the location of the .cabal file
GetPackageFiles | |
|
newtype GetPackageOpts Source #
Files that the package depends on, relative to package directory. Argument is the location of the .cabal file
GetPackageOpts | |
|
data PackageConfig Source #
Package build configuration
PackageConfig | |
|
buildLogPath :: (MonadReader env m, HasBuildConfig env, MonadThrow m) => Package -> Maybe String -> m (Path Abs File) Source #
Path for the package's build log.
data PackageException Source #
All exceptions thrown by the library.
resolvePackageDescription :: PackageConfig -> GenericPackageDescription -> PackageDescription Source #
Evaluates the conditions of a GenericPackageDescription
, yielding
a resolved PackageDescription
.
packageToolDependencies :: PackageDescription -> Map Text 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).
checkCabalFileName :: MonadThrow m => PackageName -> Path Abs File -> m () Source #
Check if the given name in the Package
matches the name of the .cabal file
printCabalFileWarning :: MonadLogger m => Path Abs File -> PWarning -> m () Source #
Print cabal file warnings.
cabalFilePackageId :: (MonadIO m, MonadThrow m) => Path Abs File -> m PackageIdentifier Source #
Extract the PackageIdentifier
given an exploded haskell package
path.