File tree 2 files changed +10
-3
lines changed
shake-bench/src/Development/Benchmark
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ import Development.Shake.Classes
55
55
import System.Console.GetOpt
56
56
import Data.Maybe
57
57
import Control.Monad.Extra
58
+ import System.FilePath
58
59
59
60
60
61
configPath :: FilePath
@@ -84,7 +85,12 @@ main = shakeArgsWith shakeOpts [configOpt] $ \configs wants -> pure $ Just $ do
84
85
_ -> want wants
85
86
86
87
ghcideBuildRules :: MkBuildRules BuildSystem
87
- ghcideBuildRules = MkBuildRules findGhcForBuildSystem " ghcide" buildGhcide
88
+ ghcideBuildRules = MkBuildRules findGhcForBuildSystem " ghcide" projectDepends buildGhcide
89
+ where
90
+ projectDepends = do
91
+ need . map (" src" </> ) =<< getDirectoryFiles " src" [" //*.hs" ]
92
+ need . map (" session-loader" </> ) =<< getDirectoryFiles " session-loader" [" //*.hs" ]
93
+ need =<< getDirectoryFiles " ." [" *.cabal" ]
88
94
89
95
--------------------------------------------------------------------------------
90
96
Original file line number Diff line number Diff line change @@ -177,6 +177,8 @@ data MkBuildRules buildSystem = MkBuildRules
177
177
findGhc :: buildSystem -> FilePath -> IO FilePath
178
178
-- | Name of the binary produced by 'buildProject'
179
179
, executableName :: String
180
+ -- | An action that captures the source dependencies, used for the HEAD build
181
+ , projectDepends :: Action ()
180
182
-- | Build the project found in the cwd and save the build artifacts in the output folder
181
183
, buildProject :: buildSystem
182
184
-> [CmdOption ]
@@ -204,9 +206,8 @@ buildRules build MkBuildRules{..} = do
204
206
, build -/- " binaries/HEAD/ghc.path"
205
207
]
206
208
&%> \ [out, ghcpath] -> do
209
+ projectDepends
207
210
liftIO $ createDirectoryIfMissing True $ dropFileName out
208
- -- TOOD more precise dependency tracking
209
- need =<< getDirectoryFiles " ." [" //*.hs" , " *.cabal" ]
210
211
buildSystem <- askOracle $ GetBuildSystem ()
211
212
buildProject buildSystem [Cwd " ." ] (takeDirectory out)
212
213
ghcLoc <- liftIO $ findGhc buildSystem " ."
You can’t perform that action at this time.
0 commit comments