Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
acd13b47
Commit
acd13b47
authored
Feb 02, 2016
by
Andrey Mokhov
Browse files
Add configFile to Base, track building ./settings
See
#200
.
parent
1329a948
Changes
3
Show whitespace changes
Inline
Side-by-side
src/Base.hs
View file @
acd13b47
...
...
@@ -16,7 +16,7 @@ module Base (
module
Development
.
Shake
.
FilePath
,
-- * Paths
shakeFilesPath
,
configPath
,
sourcePath
,
programInplacePath
,
shakeFilesPath
,
configPath
,
configFile
,
sourcePath
,
programInplacePath
,
bootPackageConstraints
,
packageDependencies
,
-- * Output
...
...
@@ -54,6 +54,9 @@ shakeFilesPath = shakePath -/- ".db"
configPath
::
FilePath
configPath
=
shakePath
-/-
"cfg"
configFile
::
FilePath
configFile
=
configPath
-/-
"system.config"
-- | Path to source files of the build system, e.g. this file is located at
-- sourcePath -/- "Base.hs". We use this to `need` some of the source files.
sourcePath
::
FilePath
...
...
src/Oracles/Config.hs
View file @
acd13b47
...
...
@@ -8,9 +8,6 @@ import Development.Shake.Config
newtype
ConfigKey
=
ConfigKey
String
deriving
(
Show
,
Typeable
,
Eq
,
Hashable
,
Binary
,
NFData
)
configFile
::
FilePath
configFile
=
configPath
-/-
"system.config"
askConfig
::
String
->
Action
String
askConfig
key
=
askConfigWithDefault
key
.
putError
$
"Cannot find key '"
++
key
++
"' in configuration files."
...
...
src/Rules/Config.hs
View file @
acd13b47
...
...
@@ -8,12 +8,14 @@ configRules :: Rules ()
configRules
=
do
-- We always rerun the configure script in this mode, because the flags
-- passed to it can affect the contents of system.config file.
config
Path
-/-
"system.config"
%>
\
out
->
do
[
config
File
,
"settings"
]
&%>
\
[
cfg
,
settings
]
->
do
alwaysRerun
case
cmdConfigure
of
RunConfigure
args
->
runConfigure
"."
[]
[
args
]
SkipConfigure
->
unlessM
(
doesFileExist
out
)
$
putError
$
"Configuration file "
++
out
++
" is missing.
\n
"
RunConfigure
args
->
do
need
[
settings
<.>
"in"
]
runConfigure
"."
[]
[
args
]
SkipConfigure
->
unlessM
(
doesFileExist
cfg
)
$
putError
$
"Configuration file "
++
cfg
++
" is missing.
\n
"
++
"Run the configure script either manually or via the "
++
"build system by passing --configure[=ARGS] flag."
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment