module Distribution.Simple.UserHooks (
UserHooks(..), Args,
emptyUserHooks,
) where
import Distribution.PackageDescription
(PackageDescription, GenericPackageDescription,
HookedBuildInfo, emptyHookedBuildInfo)
import Distribution.Simple.Program (Program)
import Distribution.Simple.Command (noExtraFlags)
import Distribution.Simple.PreProcess (PPSuffixHandler)
import Distribution.Simple.Setup
(ConfigFlags, BuildFlags, CleanFlags, CopyFlags,
InstallFlags, SDistFlags, RegisterFlags, HscolourFlags,
HaddockFlags, TestFlags)
import Distribution.Simple.LocalBuildInfo (LocalBuildInfo)
type Args = [String]
data sDistHook ::
PackageDescription
-> Maybe LocalBuildInfo
-> UserHooks
-> SDistFlags
-> IO ()UserHooks = UserHooks {
runTests :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO (),
readDesc :: IO (Maybe GenericPackageDescription),
hookedPreProcessors :: [ PPSuffixHandler ],
hookedPrograms :: [Program],
preConf :: Args -> ConfigFlags -> IO HookedBuildInfo,
confHook :: (GenericPackageDescription, HookedBuildInfo)
-> ConfigFlags -> IO LocalBuildInfo,
postConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO (),
preBuild :: Args -> BuildFlags -> IO HookedBuildInfo,
buildHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO (),
postBuild :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO (),
preClean :: Args -> CleanFlags -> IO HookedBuildInfo,
cleanHook :: PackageDescription -> () -> UserHooks -> CleanFlags -> IO (),
postClean :: Args -> CleanFlags -> PackageDescription -> () -> IO (),
preCopy :: Args -> CopyFlags -> IO HookedBuildInfo,
copyHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> CopyFlags -> IO (),
postCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO (),
preInst :: Args -> InstallFlags -> IO HookedBuildInfo,
instHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> InstallFlags -> IO (),
postInst :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO (),
preSDist :: Args -> SDistFlags -> IO HookedBuildInfo,
sDistHook :: PackageDescription -> Maybe LocalBuildInfo -> UserHooks -> SDistFlags -> IO (),
postSDist :: Args -> SDistFlags -> PackageDescription -> Maybe LocalBuildInfo -> IO (),
preReg :: Args -> RegisterFlags -> IO HookedBuildInfo,
regHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO (),
postReg :: Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO (),
preUnreg :: Args -> RegisterFlags -> IO HookedBuildInfo,
unregHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> RegisterFlags -> IO (),
postUnreg :: Args -> RegisterFlags -> PackageDescription -> LocalBuildInfo -> IO (),
preHscolour :: Args -> HscolourFlags -> IO HookedBuildInfo,
hscolourHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> HscolourFlags -> IO (),
postHscolour :: Args -> HscolourFlags -> PackageDescription -> LocalBuildInfo -> IO (),
preHaddock :: Args -> HaddockFlags -> IO HookedBuildInfo,
haddockHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> HaddockFlags -> IO (),
postHaddock :: Args -> HaddockFlags -> PackageDescription -> LocalBuildInfo -> IO (),
preTest :: Args -> TestFlags -> IO HookedBuildInfo,
testHook :: PackageDescription -> LocalBuildInfo -> UserHooks -> TestFlags -> IO (),
postTest :: Args -> TestFlags -> PackageDescription -> LocalBuildInfo -> IO ()
}
emptyUserHooks :: UserHooks
emptyUserHooks
= UserHooks {
runTests = ru :: t -> t -> t -> t -> m ()ru,
readDesc = return :: Monad m => forall a. a -> m areturn Nothing :: Maybe aNothing,
hookedPreProcessors = [] :: [a][],
hookedPrograms = [] :: [a][],
preConf = rn :: [String] -> t -> IO HookedBuildInforn,
confHook = (\_ _ -> return :: Monad m => forall a. a -> m areturn (error :: [Char] -> aerror "No local build info generated during configure. Over-ride empty configure hook.")),
postConf = ru :: t -> t -> t -> t -> m ()ru,
preBuild = rn :: [String] -> t -> IO HookedBuildInforn,
buildHook = ru :: t -> t -> t -> t -> m ()ru,
postBuild = ru :: t -> t -> t -> t -> m ()ru,
preClean = rn :: [String] -> t -> IO HookedBuildInforn,
cleanHook = ru :: t -> t -> t -> t -> m ()ru,
postClean = ru :: t -> t -> t -> t -> m ()ru,
preCopy = rn :: [String] -> t -> IO HookedBuildInforn,
copyHook = ru :: t -> t -> t -> t -> m ()ru,
postCopy = ru :: t -> t -> t -> t -> m ()ru,
preInst = rn :: [String] -> t -> IO HookedBuildInforn,
instHook = ru :: t -> t -> t -> t -> m ()ru,
postInst = ru :: t -> t -> t -> t -> m ()ru,
preSDist = rn :: [String] -> t -> IO HookedBuildInforn,
sDistHook = ru :: t -> t -> t -> t -> m ()ru,
postSDist = ru :: t -> t -> t -> t -> m ()ru,
preReg = rn :: [String] -> t -> IO HookedBuildInforn,
regHook = ru :: t -> t -> t -> t -> m ()ru,
postReg = ru :: t -> t -> t -> t -> m ()ru,
preUnreg = rn :: [String] -> t -> IO HookedBuildInforn,
unregHook = ru :: t -> t -> t -> t -> m ()ru,
postUnreg = ru :: t -> t -> t -> t -> m ()ru,
preHscolour = rn :: [String] -> t -> IO HookedBuildInforn,
hscolourHook = ru :: t -> t -> t -> t -> m ()ru,
postHscolour = ru :: t -> t -> t -> t -> m ()ru,
preHaddock = rn :: [String] -> t -> IO HookedBuildInforn,
haddockHook = ru :: t -> t -> t -> t -> m ()ru,
postHaddock = ru :: t -> t -> t -> t -> m ()ru,
preTest = \_ _ -> return :: Monad m => forall a. a -> m areturn emptyHookedBuildInfo :: HookedBuildInfoemptyHookedBuildInfo,
testHook = ru :: t -> t -> t -> t -> m ()ru,
postTest = ru :: t -> t -> t -> t -> m ()ru
}
where rn args _ = noExtraFlags :: [String] -> IO ()noExtraFlags args :: [String]args (>>) :: Monad m => forall a b. m a -> m b -> m b>> return :: Monad m => forall a. a -> m areturn emptyHookedBuildInfo :: HookedBuildInfoemptyHookedBuildInfo
ru _ _ _ _ = return :: Monad m => forall a. a -> m areturn ()