{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
module Development.Shake.Internal.Rules.Rerun(
defaultRuleRerun, alwaysRerun
) where
import Development.Shake.Internal.Core.Rules
import Development.Shake.Internal.Core.Types
import Development.Shake.Internal.Core.Build
import Development.Shake.Internal.Core.Action
import Development.Shake.Classes
import qualified Data.ByteString as BS
import General.Binary
newtype AlwaysRerunQ = AlwaysRerunQ ()
deriving (Typeable,AlwaysRerunQ -> AlwaysRerunQ -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlwaysRerunQ -> AlwaysRerunQ -> Bool
$c/= :: AlwaysRerunQ -> AlwaysRerunQ -> Bool
== :: AlwaysRerunQ -> AlwaysRerunQ -> Bool
$c== :: AlwaysRerunQ -> AlwaysRerunQ -> Bool
Eq,Eq AlwaysRerunQ
Int -> AlwaysRerunQ -> Int
AlwaysRerunQ -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: AlwaysRerunQ -> Int
$chash :: AlwaysRerunQ -> Int
hashWithSalt :: Int -> AlwaysRerunQ -> Int
$chashWithSalt :: Int -> AlwaysRerunQ -> Int
Hashable,Get AlwaysRerunQ
[AlwaysRerunQ] -> Put
AlwaysRerunQ -> Put
forall t. (t -> Put) -> Get t -> ([t] -> Put) -> Binary t
putList :: [AlwaysRerunQ] -> Put
$cputList :: [AlwaysRerunQ] -> Put
get :: Get AlwaysRerunQ
$cget :: Get AlwaysRerunQ
put :: AlwaysRerunQ -> Put
$cput :: AlwaysRerunQ -> Put
Binary,ByteString -> AlwaysRerunQ
AlwaysRerunQ -> Builder
forall a. (a -> Builder) -> (ByteString -> a) -> BinaryEx a
getEx :: ByteString -> AlwaysRerunQ
$cgetEx :: ByteString -> AlwaysRerunQ
putEx :: AlwaysRerunQ -> Builder
$cputEx :: AlwaysRerunQ -> Builder
BinaryEx,AlwaysRerunQ -> ()
forall a. (a -> ()) -> NFData a
rnf :: AlwaysRerunQ -> ()
$crnf :: AlwaysRerunQ -> ()
NFData)
instance Show AlwaysRerunQ where show :: AlwaysRerunQ -> String
show AlwaysRerunQ
_ = String
"alwaysRerun"
type instance RuleResult AlwaysRerunQ = ()
alwaysRerun :: Action ()
alwaysRerun :: Action ()
alwaysRerun = do
Action ()
historyDisable
forall key value.
(Partial, RuleResult key ~ value, ShakeValue key,
Typeable value) =>
key -> Action value
apply1 forall a b. (a -> b) -> a -> b
$ () -> AlwaysRerunQ
AlwaysRerunQ ()
defaultRuleRerun :: Rules ()
defaultRuleRerun :: Rules ()
defaultRuleRerun =
forall key value.
(RuleResult key ~ value, ShakeValue key, BinaryEx key,
Typeable value, NFData value, Show value, Partial) =>
BuiltinLint key value
-> BuiltinIdentity key value -> BuiltinRun key value -> Rules ()
addBuiltinRuleEx forall key value. BuiltinLint key value
noLint forall key value. BuiltinIdentity key value
noIdentity forall a b. (a -> b) -> a -> b
$
\AlwaysRerunQ{} Maybe ByteString
_ RunMode
_ -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ forall value. RunChanged -> ByteString -> value -> RunResult value
RunResult RunChanged
ChangedRecomputeDiff ByteString
BS.empty ()