@@ -34,6 +34,10 @@ module Distribution.Simple.Build
34
34
, writeBuiltinAutogenFiles
35
35
, writeAutogenFiles
36
36
37
+ -- ** Legacy functions
38
+ , componentInitialBuildSteps
39
+ , initialBuildSteps
40
+
37
41
-- * Internal package database creation
38
42
, createInternalPackageDB
39
43
) where
@@ -928,8 +932,68 @@ replFLib flags pkg_descr lbi exe clbi =
928
932
GHC -> GHC. replFLib flags NoFlag pkg_descr lbi exe clbi
929
933
_ -> dieWithException verbosity REPLNotSupported
930
934
935
+ <<<<<<< HEAD
931
936
-- | Pre-build steps for a component: creates the autogenerated files
932
937
-- for a particular configured component.
938
+ =======
939
+ -- | Runs 'componentInitialBuildSteps' on every configured component.
940
+ --
941
+ -- Legacy function: does not run pre-build hooks or pre-processors. This function
942
+ -- is insufficient on its own to prepare the build for a package.
943
+ --
944
+ -- Consumers wanting to prepare the sources of a package, e.g. in order to
945
+ -- launch a REPL session, are advised to run @Setup repl --repl-multi-file=<fn>@
946
+ -- instead.
947
+ initialBuildSteps
948
+ :: FilePath
949
+ -- ^ "dist" prefix
950
+ -> PackageDescription
951
+ -- ^ mostly information from the .cabal file
952
+ -> LocalBuildInfo
953
+ -- ^ Configuration information
954
+ -> Verbosity
955
+ -- ^ The verbosity to use
956
+ -> IO ()
957
+ initialBuildSteps distPref pkg_descr lbi verbosity =
958
+ withAllComponentsInBuildOrder pkg_descr lbi $ \ _comp clbi ->
959
+ componentInitialBuildSteps distPref pkg_descr lbi clbi verbosity
960
+ {-# DEPRECATED
961
+ initialBuildSteps
962
+ "This function does not prepare all source files for a package. Suggestion: use 'Setup repl --repl-multi-file=<fn>'."
963
+ #-}
964
+
965
+ -- | Creates the autogenerated files for a particular configured component.
966
+ --
967
+ -- Legacy function: does not run pre-build hooks or pre-processors. This function
968
+ -- is insufficient on its own to prepare the build for a component.
969
+ --
970
+ -- Consumers wanting to prepare the sources of a component, e.g. in order to
971
+ -- launch a REPL session, are advised to run
972
+ -- @Setup repl <compName> --repl-multi-file=<fn>@ instead.
973
+ componentInitialBuildSteps
974
+ :: FilePath
975
+ -- ^ "dist" prefix
976
+ -> PackageDescription
977
+ -- ^ mostly information from the .cabal file
978
+ -> LocalBuildInfo
979
+ -- ^ Configuration information
980
+ -> ComponentLocalBuildInfo
981
+ -- ^ Build info about the component
982
+ -> Verbosity
983
+ -- ^ The verbosity to use
984
+ -> IO ()
985
+ componentInitialBuildSteps _distPref pkg_descr lbi clbi verbosity = do
986
+ let compBuildDir = interpretSymbolicPathLBI lbi $ componentBuildDir lbi clbi
987
+ createDirectoryIfMissingVerbose verbosity True compBuildDir
988
+ writeBuiltinAutogenFiles verbosity pkg_descr lbi clbi
989
+ {-# DEPRECATED
990
+ componentInitialBuildSteps
991
+ "This function does not prepare all source files for a component. Suggestion: use 'Setup repl <compName> --repl-multi-file=<fn>'."
992
+ #-}
993
+
994
+ -- | Creates the autogenerated files for a particular configured component,
995
+ -- and runs the pre-build hook.
996
+ >>>>>>> dd74e9216 (Reinstate 'initialBuildSteps' function)
933
997
preBuildComponent
934
998
:: Verbosity
935
999
-> LocalBuildInfo
@@ -939,7 +1003,12 @@ preBuildComponent
939
1003
preBuildComponent verbosity lbi tgt = do
940
1004
let pkg_descr = localPkgDescr lbi
941
1005
clbi = targetCLBI tgt
1006
+ <<<<<<< HEAD
942
1007
createDirectoryIfMissingVerbose verbosity True (componentBuildDir lbi clbi)
1008
+ =======
1009
+ compBuildDir = interpretSymbolicPathLBI lbi $ componentBuildDir lbi clbi
1010
+ createDirectoryIfMissingVerbose verbosity True compBuildDir
1011
+ >>>>>>> dd74e9216 (Reinstate 'initialBuildSteps' function)
943
1012
writeBuiltinAutogenFiles verbosity pkg_descr lbi clbi
944
1013
945
1014
-- | Generate and write to disk all built-in autogenerated files
0 commit comments