{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StaticPointers #-}
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
module Distribution.Simple.SetupHooks
(
SetupHooks(..)
, noSetupHooks
, ConfigureHooks(..)
, noConfigureHooks
, PreConfPackageInputs(..)
, PreConfPackageOutputs(..)
, noPreConfPackageOutputs
, PreConfPackageHook
, PostConfPackageInputs(..)
, PostConfPackageHook
, PreConfComponentInputs(..)
, PreConfComponentOutputs(..)
, noPreConfComponentOutputs
, PreConfComponentHook
, ComponentDiff(..), emptyComponentDiff, buildInfoComponentDiff
, LibraryDiff, ForeignLibDiff, ExecutableDiff
, TestSuiteDiff, BenchmarkDiff
, BuildInfoDiff
, BuildHooks(..), noBuildHooks
, BuildingWhat(..), buildingWhatVerbosity, buildingWhatDistPref
, PreBuildComponentInputs(..)
, PreBuildComponentRules
, PostBuildComponentInputs(..)
, PostBuildComponentHook
, Rules
, rules
, noRules
, RulesM
, ShortText
, registerRule
, registerRule_
, Rule
, staticRule, dynamicRule
, Dependency (..)
, RuleOutput (..)
, RuleId
, Location(..)
, location
, autogenComponentModulesDir
, componentBuildDir
, RelativePath
, sameDirectory
, getSymbolicPath
, makeRelativePathEx
, moduleNameSymbolicPath
, FileLike(..)
, PathLike(..)
, Source, Build, Pkg, CWD
, findAndMonitorDirFileGlob
, findAndMonitorSourceDirsFileExts
, Glob(..)
, GlobPiece(..)
, GlobSyntaxError(..)
, parseFileGlob
, globMatches
, runDirFileGlob
, RuleCommands
, Command
, mkCommand
, Dict(..)
, Binary
, addRuleMonitors
, module Distribution.Simple.FileMonitor.Types
, InstallHooks(..), noInstallHooks
, InstallComponentInputs(..), InstallComponentHook
, ConfigFlags(..)
, BuildFlags(..), ReplFlags(..), HaddockFlags(..), HscolourFlags(..)
, CopyFlags(..)
, installFileGlob
, Program(..), ConfiguredProgram(..), ProgArg
, ProgramLocation(..)
, ProgramDb
, addKnownPrograms
, configureUnconfiguredProgram
, lookupProgram
, lookupProgramByName
, simpleProgram
, runProgramCwd
, warn
, createDirectoryIfMissingVerbose
, rewriteFileEx
, Compiler(..), Platform(..), Suffix(..)
, Verbosity, VerbosityFlags, VerbosityHandles
, mkVerbosity, defaultVerbosityHandles
, LocalBuildConfig, LocalBuildInfo, PackageBuildDescr
, PackageDescription(..)
, localPkgDescr
, mbWorkDirLBI
, withPrograms
, interpretSymbolicPathLBI
, componentBuildInfo
, Component(..), ComponentName(..), componentName
, ModuleName
, BuildInfo(..), emptyBuildInfo
, TargetInfo(..), ComponentLocalBuildInfo(..)
, Library(..), ForeignLib(..), Executable(..)
, TestSuite(..), Benchmark(..)
, LibraryName(..)
, emptyLibrary, emptyForeignLib, emptyExecutable
, emptyTestSuite, emptyBenchmark
)
where
import Distribution.Compat.Binary
( Binary )
import Distribution.ModuleName
( ModuleName )
import Distribution.PackageDescription
( PackageDescription(..)
, Library(..), ForeignLib(..)
, Executable(..), TestSuite(..), Benchmark(..)
, emptyLibrary, emptyForeignLib
, emptyExecutable, emptyBenchmark, emptyTestSuite
, BuildInfo(..), emptyBuildInfo
, ComponentName(..), LibraryName(..)
)
import Distribution.Simple.BuildPaths
( autogenComponentModulesDir )
import Distribution.Simple.Compiler
( Compiler(..) )
import Distribution.Simple.Errors
( CabalException(SetupHooksException)
)
import Distribution.Simple.FileMonitor.Types
hiding ( Glob )
import Distribution.Simple.Glob
( Glob, GlobSyntaxError(..)
, globMatches, runDirFileGlob, parseFileGlob
)
import Distribution.Simple.Glob.Internal
( Glob(..), GlobPiece(..)
)
import Distribution.Simple.Install
( installFileGlob )
import Distribution.Simple.LocalBuildInfo
( componentBuildDir, componentBuildInfo
, mbWorkDirLBI, interpretSymbolicPathLBI
)
import Distribution.Simple.PreProcess.Types
( Suffix(..) )
import Distribution.Simple.Program
( runProgramCwd )
import Distribution.Simple.Program.Db
( ProgramDb, addKnownPrograms
, configureUnconfiguredProgram
, lookupProgram, lookupProgramByName
)
import Distribution.Simple.Program.Find
( simpleProgram )
import Distribution.Simple.Program.Types
( Program(..), ConfiguredProgram(..)
, ProgArg
, ProgramLocation(..)
)
import Distribution.Simple.Setup
( BuildFlags(..)
, ConfigFlags(..)
, CopyFlags(..)
, HaddockFlags(..)
, HscolourFlags(..)
, ReplFlags(..)
)
import Distribution.Simple.SetupHooks.Errors
import Distribution.Simple.SetupHooks.Internal
import Distribution.Simple.SetupHooks.Rule as Rule
import Distribution.Simple.Utils
( createDirectoryIfMissingVerbose
, dieWithException
, rewriteFileEx
, warn
)
import Distribution.System
( Platform(..) )
import Distribution.Types.Component
( Component(..), componentName )
import Distribution.Types.ComponentLocalBuildInfo
( ComponentLocalBuildInfo(..) )
import Distribution.Types.LocalBuildInfo
( LocalBuildInfo(..), withPrograms )
import Distribution.Types.LocalBuildConfig
( LocalBuildConfig, PackageBuildDescr )
import Distribution.Types.TargetInfo
( TargetInfo(..) )
import Distribution.Utils.Path
( SymbolicPath, CWD, Pkg, FileOrDir(..)
, interpretSymbolicPath, makeRelativePathEx
, RelativePath, Source, Build
, getSymbolicPath, sameDirectory, moduleNameSymbolicPath
, FileLike(..), PathLike(..)
)
import Distribution.Utils.ShortText
( ShortText )
import Distribution.Verbosity
( Verbosity
, VerbosityFlags, VerbosityHandles
, mkVerbosity, defaultVerbosityHandles
)
import Control.Monad
( void )
import Control.Monad.IO.Class
( MonadIO(liftIO) )
import Control.Monad.Trans.Class
( lift )
import qualified Control.Monad.Trans.Reader as Reader
import qualified Control.Monad.Trans.State as State
import qualified Control.Monad.Trans.Writer.CPS as Writer
import qualified Data.List.NonEmpty as NE
import Data.Foldable
( for_ )
import Data.Traversable
( for )
import Data.Map.Strict as Map
( insertLookupWithKey )
registerRule
:: ShortText
-> Rule
-> RulesM RuleId
registerRule :: ShortText -> Rule -> RulesM RuleId
registerRule ShortText
nm !Rule
newRule = ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
RuleId
-> RulesM RuleId
forall (m :: * -> *) a.
ReaderT
RulesEnv (StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m)) a
-> RulesT m a
RulesT (ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
RuleId
-> RulesM RuleId)
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
RuleId
-> RulesM RuleId
forall a b. (a -> b) -> a -> b
$ do
RulesEnv { rulesEnvNameSpace :: RulesEnv -> RulesNameSpace
rulesEnvNameSpace = RulesNameSpace
ns
, rulesEnvVerbosity :: RulesEnv -> Verbosity
rulesEnvVerbosity = Verbosity
verbosity } <- ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
RulesEnv
forall (m :: * -> *) r. Monad m => ReaderT r m r
Reader.ask
Map RuleId Rule
oldRules <- StateT
(Map RuleId Rule) (WriterT [MonitorFilePath] IO) (Map RuleId Rule)
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
(Map RuleId Rule)
forall (m :: * -> *) a. Monad m => m a -> ReaderT RulesEnv m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift StateT
(Map RuleId Rule) (WriterT [MonitorFilePath] IO) (Map RuleId Rule)
forall (m :: * -> *) s. Monad m => StateT s m s
State.get
let rId :: RuleId
rId = RuleId { ruleNameSpace :: RulesNameSpace
ruleNameSpace = RulesNameSpace
ns, ruleName :: ShortText
ruleName = ShortText
nm }
(Maybe Rule
mbDup, Map RuleId Rule
newRules) = (RuleId -> Rule -> Rule -> Rule)
-> RuleId
-> Rule
-> Map RuleId Rule
-> (Maybe Rule, Map RuleId Rule)
forall k a.
Ord k =>
(k -> a -> a -> a) -> k -> a -> Map k a -> (Maybe a, Map k a)
Map.insertLookupWithKey (\ RuleId
_ Rule
new Rule
_old -> Rule
new) RuleId
rId Rule
newRule Map RuleId Rule
oldRules
Maybe Rule
-> (Rule
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
Any)
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
()
forall (t :: * -> *) (f :: * -> *) a b.
(Foldable t, Applicative f) =>
t a -> (a -> f b) -> f ()
for_ Maybe Rule
mbDup ((Rule
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
Any)
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
())
-> (Rule
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
Any)
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
()
forall a b. (a -> b) -> a -> b
$ \ Rule
oldRule ->
IO Any
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
Any
forall a.
IO a
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Any
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
Any)
-> IO Any
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
Any
forall a b. (a -> b) -> a -> b
$ Verbosity -> CabalException -> IO Any
forall a1 a.
(HasCallStack, Exception (VerboseException a1)) =>
Verbosity -> a1 -> IO a
dieWithException Verbosity
verbosity
(CabalException -> IO Any) -> CabalException -> IO Any
forall a b. (a -> b) -> a -> b
$ SetupHooksException -> CabalException
SetupHooksException
(SetupHooksException -> CabalException)
-> SetupHooksException -> CabalException
forall a b. (a -> b) -> a -> b
$ RulesException -> SetupHooksException
RulesException
(RulesException -> SetupHooksException)
-> RulesException -> SetupHooksException
forall a b. (a -> b) -> a -> b
$ RuleId -> Rule -> Rule -> RulesException
DuplicateRuleId RuleId
rId Rule
oldRule Rule
newRule
StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO) ()
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
()
forall (m :: * -> *) a. Monad m => m a -> ReaderT RulesEnv m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO) ()
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
())
-> StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO) ()
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
()
forall a b. (a -> b) -> a -> b
$ Map RuleId Rule
-> StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO) ()
forall (m :: * -> *) s. Monad m => s -> StateT s m ()
State.put Map RuleId Rule
newRules
RuleId
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
RuleId
forall a.
a
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] IO))
a
forall (m :: * -> *) a. Monad m => a -> m a
return RuleId
rId
registerRule_
:: ShortText
-> Rule
-> RulesT IO ()
registerRule_ :: ShortText -> Rule -> RulesT IO ()
registerRule_ ShortText
i Rule
r = RulesM RuleId -> RulesT IO ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void (RulesM RuleId -> RulesT IO ()) -> RulesM RuleId -> RulesT IO ()
forall a b. (a -> b) -> a -> b
$ ShortText -> Rule -> RulesM RuleId
registerRule ShortText
i Rule
r
addRuleMonitors :: Monad m => [MonitorFilePath] -> RulesT m ()
addRuleMonitors :: forall (m :: * -> *). Monad m => [MonitorFilePath] -> RulesT m ()
addRuleMonitors = ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m))
()
-> RulesT m ()
forall (m :: * -> *) a.
ReaderT
RulesEnv (StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m)) a
-> RulesT m a
RulesT (ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m))
()
-> RulesT m ())
-> ([MonitorFilePath]
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m))
())
-> [MonitorFilePath]
-> RulesT m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m) ()
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m))
()
forall (m :: * -> *) a. Monad m => m a -> ReaderT RulesEnv m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m) ()
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m))
())
-> ([MonitorFilePath]
-> StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m) ())
-> [MonitorFilePath]
-> ReaderT
RulesEnv
(StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m))
()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WriterT [MonitorFilePath] m ()
-> StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m) ()
forall (m :: * -> *) a.
Monad m =>
m a -> StateT (Map RuleId Rule) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (WriterT [MonitorFilePath] m ()
-> StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m) ())
-> ([MonitorFilePath] -> WriterT [MonitorFilePath] m ())
-> [MonitorFilePath]
-> StateT (Map RuleId Rule) (WriterT [MonitorFilePath] m) ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [MonitorFilePath] -> WriterT [MonitorFilePath] m ()
forall w (m :: * -> *). (Monoid w, Monad m) => w -> WriterT w m ()
Writer.tell
{-# INLINEABLE addRuleMonitors #-}
findAndMonitorDirFileGlob
:: MonadIO m
=> Maybe (SymbolicPath CWD (Dir Pkg))
-> Verbosity
-> [SymbolicPath Pkg (Dir dir)]
-> Glob
-> RulesT m [Location]
findAndMonitorDirFileGlob :: forall (m :: * -> *) dir.
MonadIO m =>
Maybe (SymbolicPath CWD ('Dir Pkg))
-> Verbosity
-> [SymbolicPath Pkg ('Dir dir)]
-> Glob
-> RulesT m [Location]
findAndMonitorDirFileGlob Maybe (SymbolicPath CWD ('Dir Pkg))
mbWorkDir Verbosity
verb [SymbolicPath Pkg ('Dir dir)]
searchDirs Glob
glob = do
[Location]
matchingFiles <- ([[Location]] -> [Location])
-> RulesT m [[Location]] -> RulesT m [Location]
forall a b. (a -> b) -> RulesT m a -> RulesT m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap [[Location]] -> [Location]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat (RulesT m [[Location]] -> RulesT m [Location])
-> RulesT m [[Location]] -> RulesT m [Location]
forall a b. (a -> b) -> a -> b
$ IO [[Location]] -> RulesT m [[Location]]
forall a. IO a -> RulesT m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [[Location]] -> RulesT m [[Location]])
-> IO [[Location]] -> RulesT m [[Location]]
forall a b. (a -> b) -> a -> b
$ [SymbolicPath Pkg ('Dir dir)]
-> (SymbolicPath Pkg ('Dir dir) -> IO [Location])
-> IO [[Location]]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
t a -> (a -> f b) -> f (t b)
for [SymbolicPath Pkg ('Dir dir)]
searchDirs ((SymbolicPath Pkg ('Dir dir) -> IO [Location]) -> IO [[Location]])
-> (SymbolicPath Pkg ('Dir dir) -> IO [Location])
-> IO [[Location]]
forall a b. (a -> b) -> a -> b
$ \SymbolicPath Pkg ('Dir dir)
srcDir -> do
let root :: FilePath
root = Maybe (SymbolicPath CWD ('Dir Pkg))
-> SymbolicPath Pkg ('Dir dir) -> FilePath
forall from (allowAbsolute :: AllowAbsolute) (to :: FileOrDir).
Maybe (SymbolicPath CWD ('Dir from))
-> SymbolicPathX allowAbsolute from to -> FilePath
interpretSymbolicPath Maybe (SymbolicPath CWD ('Dir Pkg))
mbWorkDir SymbolicPath Pkg ('Dir dir)
srcDir
[GlobResult FilePath]
matches <- Verbosity
-> Maybe CabalSpecVersion
-> FilePath
-> Glob
-> IO [GlobResult FilePath]
runDirFileGlob Verbosity
verb Maybe CabalSpecVersion
forall a. Maybe a
Nothing FilePath
root Glob
glob
[Location] -> IO [Location]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return
[ SymbolicPath Pkg ('Dir dir) -> RelativePath dir 'File -> Location
forall baseDir.
SymbolicPath Pkg ('Dir baseDir)
-> RelativePath baseDir 'File -> Location
Location SymbolicPath Pkg ('Dir dir)
srcDir (FilePath -> RelativePath dir 'File
forall from (to :: FileOrDir).
HasCallStack =>
FilePath -> RelativePath from to
makeRelativePathEx FilePath
match)
| FilePath
match <- [GlobResult FilePath] -> [FilePath]
forall a. [GlobResult a] -> [a]
globMatches [GlobResult FilePath]
matches
]
[MonitorFilePath] -> RulesT m ()
forall (m :: * -> *). Monad m => [MonitorFilePath] -> RulesT m ()
addRuleMonitors [RootedGlob -> MonitorFilePath
monitorFileGlobExistence (RootedGlob -> MonitorFilePath) -> RootedGlob -> MonitorFilePath
forall a b. (a -> b) -> a -> b
$ FilePathRoot -> Glob -> RootedGlob
RootedGlob FilePathRoot
FilePathRelative Glob
glob]
[Location] -> RulesT m [Location]
forall a. a -> RulesT m a
forall (m :: * -> *) a. Monad m => a -> m a
return [Location]
matchingFiles
{-# INLINEABLE findAndMonitorDirFileGlob #-}
findAndMonitorSourceDirsFileExts
:: MonadIO m
=> PreBuildComponentInputs
-> NE.NonEmpty String
-> RulesT m [Location]
findAndMonitorSourceDirsFileExts :: forall (m :: * -> *).
MonadIO m =>
PreBuildComponentInputs -> NonEmpty FilePath -> RulesT m [Location]
findAndMonitorSourceDirsFileExts
PreBuildComponentInputs
{ LocalBuildInfo
localBuildInfo :: LocalBuildInfo
localBuildInfo :: PreBuildComponentInputs -> LocalBuildInfo
localBuildInfo
, buildingWhat :: PreBuildComponentInputs -> BuildingWhat
buildingWhat = BuildingWhat
what
, TargetInfo
targetInfo :: TargetInfo
targetInfo :: PreBuildComponentInputs -> TargetInfo
targetInfo
} NonEmpty FilePath
exts =
let
comp :: Component
comp = TargetInfo -> Component
targetComponent TargetInfo
targetInfo
verbosity :: Verbosity
verbosity = VerbosityHandles -> VerbosityFlags -> Verbosity
mkVerbosity VerbosityHandles
defaultVerbosityHandles (BuildingWhat -> VerbosityFlags
buildingWhatVerbosity BuildingWhat
what)
mbWorkDir :: Maybe (SymbolicPath CWD ('Dir Pkg))
mbWorkDir = LocalBuildInfo -> Maybe (SymbolicPath CWD ('Dir Pkg))
mbWorkDirLBI LocalBuildInfo
localBuildInfo
searchDirs :: [SymbolicPath Pkg ('Dir Source)]
searchDirs = BuildInfo -> [SymbolicPath Pkg ('Dir Source)]
hsSourceDirs (BuildInfo -> [SymbolicPath Pkg ('Dir Source)])
-> BuildInfo -> [SymbolicPath Pkg ('Dir Source)]
forall a b. (a -> b) -> a -> b
$ Component -> BuildInfo
componentBuildInfo Component
comp
fileGlob :: [GlobPiece]
fileGlob = case NonEmpty FilePath
exts of
FilePath
e NE.:| [] -> [GlobPiece
WildCard, FilePath -> GlobPiece
Literal (FilePath
"." FilePath -> FilePath -> FilePath
forall a. [a] -> [a] -> [a]
++ FilePath
e)]
FilePath
e NE.:| [FilePath]
es -> [GlobPiece
WildCard, FilePath -> GlobPiece
Literal FilePath
".", [[GlobPiece]] -> GlobPiece
Union ((FilePath -> [GlobPiece]) -> [FilePath] -> [[GlobPiece]]
forall a b. (a -> b) -> [a] -> [b]
map (\FilePath
ext -> [FilePath -> GlobPiece
Literal FilePath
ext]) (FilePath
e FilePath -> [FilePath] -> [FilePath]
forall a. a -> [a] -> [a]
: [FilePath]
es))]
glob :: Glob
glob = [GlobPiece] -> Glob
GlobDirRecursive [GlobPiece]
fileGlob
in
Maybe (SymbolicPath CWD ('Dir Pkg))
-> Verbosity
-> [SymbolicPath Pkg ('Dir Source)]
-> Glob
-> RulesT m [Location]
forall (m :: * -> *) dir.
MonadIO m =>
Maybe (SymbolicPath CWD ('Dir Pkg))
-> Verbosity
-> [SymbolicPath Pkg ('Dir dir)]
-> Glob
-> RulesT m [Location]
findAndMonitorDirFileGlob Maybe (SymbolicPath CWD ('Dir Pkg))
mbWorkDir Verbosity
verbosity [SymbolicPath Pkg ('Dir Source)]
searchDirs Glob
glob
{-# INLINEABLE findAndMonitorSourceDirsFileExts #-}