definition:
|
getModulesToAnalyze :: (Eq a, Read a, ReadWrite a) => CConfig -> Bool
-> Analysis a -> String -> IO [(String,[String])]
getModulesToAnalyze cconfig enforce analysis moduleName = do
checkPrivateProgInfo cconfig analysis moduleName
if isSimpleAnalysis analysis
then do
ananewer <- isAnalysisFileNewer ananame moduleName
return (if ananewer && not enforce then [] else [(moduleName,[])])
else do
valid <- isAnalysisValid ananame moduleName
if valid && not enforce
then do
debugMessage dl 3 $
"Analysis file for '" ++ moduleName ++ "' up-to-date"
return []
else do
moduleList <- getDependencyList cconfig [moduleName] []
debugMessage dl 3 $ "Complete module list: "++ show moduleList
let impmods = map fst moduleList
storeImportModuleList dl moduleName impmods
sourceTimeList <- mapM getSourceFileTime impmods
fcyTimeList <- mapM getFlatCurryFileTime impmods
anaTimeList <- mapM (getAnaFileTime ananame) impmods
let (modulesToDo,modulesUpToDate) =
findModulesToAnalyze moduleList anaTimeList sourceTimeList
fcyTimeList ([],[])
--debugMessage dl 3 ("Modules up-to-date: "++ show modulesUpToDate)
let modulesToAnalyze =
if enforce
then moduleList
else
if withPrelude cconfig
then reduceDependencies modulesToDo modulesUpToDate
else let reduced = reduceDependencies modulesToDo
(modulesUpToDate ++ ["Prelude"])
in case reduced of
(("Prelude",_):remaining) -> remaining
_ -> reduced
debugMessage dl 3 ("Modules to analyze: " ++ show modulesToAnalyze)
return modulesToAnalyze
where
dl = debugLevel cconfig
ananame = analysisName analysis
|
signature:
|
(Prelude.Eq a, Prelude.Read a, RW.Base.ReadWrite a) => CASS.Configuration.CConfig
-> Prelude.Bool -> Analysis.Types.Analysis a -> String
-> Prelude.IO [(String, [String])]
|