File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
shake-bench/src/Development/Benchmark Expand file tree Collapse file tree 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
5555import System.Console.GetOpt
5656import Data.Maybe
5757import Control.Monad.Extra
58+ import System.FilePath
5859
5960
6061configPath :: FilePath
@@ -84,7 +85,12 @@ main = shakeArgsWith shakeOpts [configOpt] $ \configs wants -> pure $ Just $ do
8485 _ -> want wants
8586
8687ghcideBuildRules :: 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" ]
8894
8995--------------------------------------------------------------------------------
9096
Original file line number Diff line number Diff line change @@ -177,6 +177,8 @@ data MkBuildRules buildSystem = MkBuildRules
177177 findGhc :: buildSystem -> FilePath -> IO FilePath
178178 -- | Name of the binary produced by 'buildProject'
179179 , executableName :: String
180+ -- | An action that captures the source dependencies, used for the HEAD build
181+ , projectDepends :: Action ()
180182 -- | Build the project found in the cwd and save the build artifacts in the output folder
181183 , buildProject :: buildSystem
182184 -> [CmdOption ]
@@ -204,9 +206,8 @@ buildRules build MkBuildRules{..} = do
204206 , build -/- " binaries/HEAD/ghc.path"
205207 ]
206208 &%> \ [out, ghcpath] -> do
209+ projectDepends
207210 liftIO $ createDirectoryIfMissing True $ dropFileName out
208- -- TOOD more precise dependency tracking
209- need =<< getDirectoryFiles " ." [" //*.hs" , " *.cabal" ]
210211 buildSystem <- askOracle $ GetBuildSystem ()
211212 buildProject buildSystem [Cwd " ." ] (takeDirectory out)
212213 ghcLoc <- liftIO $ findGhc buildSystem " ."
You can’t perform that action at this time.
0 commit comments