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)
- 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
- 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
- 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
- packageSimpleType :: !Bool
- newtype GetPackageFiles = GetPackageFiles {
- getPackageFiles :: forall m env. (MonadIO m, MonadLogger m, MonadThrow m, MonadCatch m, MonadReader env m, HasPlatform env, 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. (MonadIO m, HasEnvConfig env, HasPlatform env, MonadThrow m, MonadReader env m, MonadLogger m, MonadCatch m) => 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.
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.
resolvePackage :: PackageConfig -> GenericPackageDescription -> Package Source
Resolve a parsed cabal file into a Package
.
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
Get all dependencies of a package, including library, executables, tests, benchmarks.
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.