Move integerLibrary to flavour
[hadrian.git] / src / UserSettings.hs
1 -- If you want to customise your build you should copy this file from
2 -- hadrian/src/UserSettings.hs to hadrian/UserSettings.hs and edit your copy.
3 -- If you don't copy the file your changes will be tracked by git and you can
4 -- accidentally commit them.
5 module UserSettings (
6 buildRootPath, userFlavours, userKnownPackages, validating,
7 turnWarningsIntoErrors, verboseCommands, putBuild, putSuccess
8 ) where
9
10 import System.Console.ANSI
11
12 import Base
13 import Flavour
14 import Predicate
15
16 -- See doc/user-settings.md for instructions.
17
18 -- | All build results are put into 'buildRootPath' directory.
19 buildRootPath :: FilePath
20 buildRootPath = "_build"
21
22 -- | User defined build flavours. See 'defaultFlavour' as an example.
23 userFlavours :: [Flavour]
24 userFlavours = []
25
26 -- | Add user defined packages. Note, this only let's Hadrian know about the
27 -- existence of a new package; to actually build it you need to create a new
28 -- build flavour, modifying the list of packages that are built by default.
29 userKnownPackages :: [Package]
30 userKnownPackages = []
31
32 -- | User defined flags. Note the following type semantics:
33 -- * @Bool@: a plain Boolean flag whose value is known at compile time.
34 -- * @Action Bool@: a flag whose value can depend on the build environment.
35 -- * @Predicate@: a flag whose value can depend on the build environment and
36 -- on the current build target.
37
38 -- TODO: This should be set automatically when validating.
39 validating :: Bool
40 validating = False
41
42 -- TODO: Replace with stage2 ? arg "-Werror"? Also see #251.
43 -- | To enable -Werror in Stage2 set turnWarningsIntoErrors = stage2.
44 turnWarningsIntoErrors :: Predicate
45 turnWarningsIntoErrors = return False
46
47 -- | Set to True to print full command lines during the build process. Note,
48 -- this is a Predicate, hence you can enable verbose output only for certain
49 -- targets, e.g.: @verboseCommands = package ghcPrim@.
50 verboseCommands :: Predicate
51 verboseCommands = return False
52
53 -- | Customise build progress messages (e.g. executing a build command).
54 putBuild :: String -> Action ()
55 putBuild = putColoured Dull Magenta
56
57 -- | Customise build success messages (e.g. a package is built successfully).
58 putSuccess :: String -> Action ()
59 putSuccess = putColoured Dull Green