1 {-# LANGUAGE DeriveGeneric, FlexibleInstances #-}

6 import Base

7 import Builder

9 import Package

10 import Stage

11 import Way

13 -- Target captures all parameters relevant to the current build target:

14 -- * Stage and Package being built,

15 -- * Builder to be invoked,

16 -- * Way to be built (set to vanilla for most targets),

17 -- * source file(s) to be passed to Builder,

18 -- * file(s) to be produced.

20 {

27 }

30 -- If values of type 'a' form a Monoid then we can also derive a Monoid instance

31 -- for values of type 'ReaderT Target Action a':

32 -- * the empty computation returns the identity element of the underlying type

33 -- * two computations can be combined by combining their results

38 -- PartialTarget is a partially constructed Target with fields Stage and

39 -- Package only. PartialTarget's are used for generating build rules.

42 -- Convert PartialTarget to Target assuming that unknown fields won't be used.

45 {

52 }

54 -- Construct a full target by augmenting a PartialTarget with missing fields.

55 -- Most targets are built only one way, vanilla, hence we set it by default.

58 {

65 }

67 -- Use this function to be explicit about the build way.

71 -- Instances for storing in the Shake database

72 instance Binary Target

73 instance NFData Target

74 instance Hashable Target