Copyright | (c) 2021-2022 berberman |
---|---|
License | MIT |
Maintainer | berberman <berberman@yandex.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This module is about global information we use in rules.
Synopsis
- data ShakeExtras = ShakeExtras {
- config :: Config
- versionChanges :: Var [VersionChange]
- targetPackages :: Map PackageKey Package
- lastVersions :: Var (Map PackageKey LastVersion)
- initShakeExtras :: Config -> Map PackageKey Package -> Map PackageKey Version -> IO ShakeExtras
- getShakeExtras :: Action ShakeExtras
- lookupPackage :: PackageKey -> Action (Maybe Package)
- getAllPackageKeys :: Action [PackageKey]
- isPackageKeyTarget :: PackageKey -> Action Bool
- recordVersionChange :: PackageName -> Maybe Version -> Version -> Action ()
- getVersionChanges :: Action [VersionChange]
- withRetry :: Action a -> Action a
- getBuildDir :: Action FilePath
- getLastVersionOnDisk :: PackageKey -> Action (Maybe Version)
- getRecentLastVersion :: PackageKey -> Action (Maybe Version)
- updateLastVersion :: PackageKey -> Version -> Action ()
- getAllOnDiskVersions :: Action (Map PackageKey Version)
- getLastVersionUpdated :: PackageKey -> Action (Maybe Version)
- nvcheckerCacheEnabled :: Action Bool
Types
data ShakeExtras Source #
Values we use during the build. It's stored in shakeExtra
ShakeExtras | |
|
initShakeExtras :: Config -> Map PackageKey Package -> Map PackageKey Version -> IO ShakeExtras Source #
Create an empty ShakeExtras
from packages to build, times to retry for each rule,
build dir, and on disk versions
getShakeExtras :: Action ShakeExtras Source #
Get our values from shake
Packages
lookupPackage :: PackageKey -> Action (Maybe Package) Source #
Find a package given its key
getAllPackageKeys :: Action [PackageKey] Source #
Get keys of all packages to build
isPackageKeyTarget :: PackageKey -> Action Bool Source #
Check if we need build this package
Version changes
recordVersionChange :: PackageName -> Maybe Version -> Version -> Action () Source #
Record version change of a package
getVersionChanges :: Action [VersionChange] Source #
Get version changes since the last run
Retry
withRetry :: Action a -> Action a Source #
Run an action, retry at most retry
times (defined in config) if it throws an exception
Build dir
getBuildDir :: Action FilePath Source #
Get build dir
Last versions
getLastVersionOnDisk :: PackageKey -> Action (Maybe Version) Source #
Get initial version of a package
getRecentLastVersion :: PackageKey -> Action (Maybe Version) Source #
Get version of a package, no matter it was initial one or rule result
updateLastVersion :: PackageKey -> Version -> Action () Source #
Add nvchecker result of a package
getAllOnDiskVersions :: Action (Map PackageKey Version) Source #
Get all initial versions
getLastVersionUpdated :: PackageKey -> Action (Maybe Version) Source #
Get updated version of a package
Cache nvchecker
nvcheckerCacheEnabled :: Action Bool Source #
Get if cacheNvchecker
is enabled