@@ -39,6 +39,10 @@ module Distribution.Simple.Build
39
39
, writeBuiltinAutogenFiles
40
40
, writeAutogenFiles
41
41
42
+ -- ** Legacy functions
43
+ , componentInitialBuildSteps
44
+ , initialBuildSteps
45
+
42
46
-- * Internal package database creation
43
47
, createInternalPackageDB
44
48
) where
@@ -1029,6 +1033,45 @@ replFLib flags pkg_descr lbi exe clbi =
1029
1033
GHC -> GHC. replFLib flags NoFlag pkg_descr lbi exe clbi
1030
1034
_ -> dieWithException verbosity REPLNotSupported
1031
1035
1036
+ -- | Runs 'componentInitialBuildSteps' on every configured component.
1037
+ --
1038
+ -- Legacy function: does not run pre-build hooks or pre-processors. This function
1039
+ -- is insufficient on its own to prepare the build for a package.
1040
+ initialBuildSteps
1041
+ :: FilePath
1042
+ -- ^ "dist" prefix
1043
+ -> PackageDescription
1044
+ -- ^ mostly information from the .cabal file
1045
+ -> LocalBuildInfo
1046
+ -- ^ Configuration information
1047
+ -> Verbosity
1048
+ -- ^ The verbosity to use
1049
+ -> IO ()
1050
+ initialBuildSteps distPref pkg_descr lbi verbosity =
1051
+ withAllComponentsInBuildOrder pkg_descr lbi $ \ _comp clbi ->
1052
+ componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
1053
+
1054
+ -- | Creates the autogenerated files for a particular configured component.
1055
+ --
1056
+ -- Legacy function: does not run pre-build hooks or pre-processors. This function
1057
+ -- is insufficient on its own to prepare the build for a component.
1058
+ componentInitialBuildSteps
1059
+ :: FilePath
1060
+ -- ^ "dist" prefix
1061
+ -> PackageDescription
1062
+ -- ^ mostly information from the .cabal file
1063
+ -> LocalBuildInfo
1064
+ -- ^ Configuration information
1065
+ -> ComponentLocalBuildInfo
1066
+ -- ^ Build info about the component
1067
+ -> Verbosity
1068
+ -- ^ The verbosity to use
1069
+ -> IO ()
1070
+ componentInitialBuildSteps _distPref pkg_descr lbi clbi verbosity = do
1071
+ let compBuildDir = interpretSymbolicPathLBI lbi $ componentBuildDir lbi clbi
1072
+ createDirectoryIfMissingVerbose verbosity True compBuildDir
1073
+ writeBuiltinAutogenFiles verbosity pkg_descr lbi clbi
1074
+
1032
1075
-- | Creates the autogenerated files for a particular configured component,
1033
1076
-- and runs the pre-build hook.
1034
1077
preBuildComponent
@@ -1042,7 +1085,8 @@ preBuildComponent
1042
1085
preBuildComponent preBuildHook verbosity lbi tgt = do
1043
1086
let pkg_descr = localPkgDescr lbi
1044
1087
clbi = targetCLBI tgt
1045
- createDirectoryIfMissingVerbose verbosity True (interpretSymbolicPathLBI lbi $ componentBuildDir lbi clbi)
1088
+ compBuildDir = interpretSymbolicPathLBI lbi $ componentBuildDir lbi clbi
1089
+ createDirectoryIfMissingVerbose verbosity True compBuildDir
1046
1090
writeBuiltinAutogenFiles verbosity pkg_descr lbi clbi
1047
1091
preBuildHook lbi tgt
1048
1092
0 commit comments