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