Commit 45a6d13a authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Make projectRootDir available for the post-build phase

Stick it into the ProjectBuildContext. It's not used yet but it will be
useful, in particular for updating the .ghc.environment file. Arguably
it ought to just live in the DistDirLayout.
parent 66cd8579
......@@ -58,10 +58,10 @@ configureAction (configFlags, configExFlags, installFlags, haddockFlags)
( globalFlags, configFlags, configExFlags
, installFlags, haddockFlags )
PreBuildHooks {
hookPrePlanning = \projectRootDir _ cliConfig ->
hookPrePlanning = \rootDir _ cliConfig ->
-- Write out the @cabal.project.local@ so it gets picked up by the
-- planning phase.
writeProjectLocalExtraConfig projectRootDir cliConfig,
writeProjectLocalExtraConfig rootDir cliConfig,
hookSelectPlanSubset = \_ -> return
}
......
......@@ -128,6 +128,7 @@ data PreBuildHooks = PreBuildHooks {
-- | This holds the context between the pre-build, build and post-build phases.
--
data ProjectBuildContext = ProjectBuildContext {
projectRootDir :: FilePath,
distDirLayout :: DistDirLayout,
elaboratedPlan :: ElaboratedInstallPlan,
elaboratedShared :: ElaboratedSharedConfig,
......@@ -195,6 +196,7 @@ runProjectPreBuildPhase
elaboratedPlan'
return ProjectBuildContext {
projectRootDir,
distDirLayout,
elaboratedPlan = elaboratedPlan'',
elaboratedShared,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment