From 5db397ddca9ffa5558fb80ebfad73332f8c52cd6 Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Tue, 20 Oct 2020 11:27:30 -0500 Subject: Add test for program's direct dependencies --- bootstrap/src/BuildModel.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bootstrap/src/BuildModel.hs') diff --git a/bootstrap/src/BuildModel.hs b/bootstrap/src/BuildModel.hs index 86df719..f4c809f 100644 --- a/bootstrap/src/BuildModel.hs +++ b/bootstrap/src/BuildModel.hs @@ -62,6 +62,7 @@ data CompileTimeInfo = CompileTimeInfo { compileTimeInfoSourceFileName :: FilePath , compileTimeInfoObjectFileProduced :: FilePath , compileTimeInfoOtherFilesProduced :: [FilePath] + , compileTimeInfoDirectDependencies :: [FilePath] } processRawSource :: RawSource -> Source @@ -92,13 +93,16 @@ processRawSource rawSource = } else undefined -constructCompileTimeInfo :: Source -> [Source] -> FilePath -> CompileTimeInfo -constructCompileTimeInfo program@(Program{}) otherSources buildDirectory = +constructCompileTimeInfo :: Source -> [String] -> FilePath -> CompileTimeInfo +constructCompileTimeInfo program@(Program{}) availableModules buildDirectory = CompileTimeInfo { compileTimeInfoSourceFileName = programSourceFileName program , compileTimeInfoObjectFileProduced = (programObjectFileName program) buildDirectory , compileTimeInfoOtherFilesProduced = [] + , compileTimeInfoDirectDependencies = map + (\mName -> buildDirectory mName <.> "mod") + (filter (`elem` availableModules) (programModulesUsed program)) } constructCompileTimeInfo _ otherSources buildDirectory = undefined -- cgit v1.2.3