992
992
AnUnitInfo: TUnitInfo;
993
993
LFMFilename: String;
994
994
IcoRes: TProjectIcon;
996
function EditorFileHasChanged: boolean;
999
if AnUnitInfo.IsPartOfProject or AnUnitInfo.IsVirtual then exit;
1000
if not FileExistsCached(AnUnitInfo.Filename) then exit;
1001
if StateFileAge>=FileAgeCached(AnUnitInfo.Filename) then exit;
1002
if FilenameIsPascalUnit(AnUnitInfo.Filename) then
1004
if (SearchDirectoryInSearchPath(AProject.CompilerOptions.GetUnitPath(false),
1005
ExtractFilePath(AnUnitInfo.Filename))>0)
1008
if ConsoleVerbosity>=0 then
1009
DebugLn('TMainIDE.CheckIfProjectNeedsCompilation Editor Unit in project''s unit path has changed ',AProject.IDAsString,' ',AnUnitInfo.Filename);
1010
Note+='Editor unit "'+AnUnitInfo.Filename+'" in project''s unit search path is newer than state file:'+LineEnding
1011
+' File age="'+FileAgeToStr(FileAgeCached(AnUnitInfo.Filename))+'"'+LineEnding
1012
+' State file age="'+FileAgeToStr(StateFileAge)+'"'+LineEnding
1013
+' State file='+StateFilename+LineEnding;
1017
if (SearchDirectoryInSearchPath(AProject.CompilerOptions.GetIncludePath(false),
1018
ExtractFilePath(AnUnitInfo.Filename))>0)
1021
if ConsoleVerbosity>=0 then
1022
DebugLn('TMainIDE.CheckIfProjectNeedsCompilation Editor Src in project''s include path has changed ',AProject.IDAsString,' ',AnUnitInfo.Filename);
1023
Note+='Editor file "'+AnUnitInfo.Filename+'" in project''s include search path is newer than state file:'+LineEnding
1024
+' File age="'+FileAgeToStr(FileAgeCached(AnUnitInfo.Filename))+'"'+LineEnding
1025
+' State file age="'+FileAgeToStr(StateFileAge)+'"'+LineEnding
1026
+' State file='+StateFilename+LineEnding;
996
1032
NeedBuildAllFlag:=false;
1142
1178
AnUnitInfo:=AnUnitInfo.NextPartOfProject;
1145
// check all open editor files (maybe the user forgot to add them to the project)
1181
// check all open editor files in unit/include path (maybe the user forgot
1182
// to add them to the project)
1146
1183
AnUnitInfo:=AProject.FirstUnitWithEditorIndex;
1147
1184
while AnUnitInfo<>nil do begin
1148
if (not AnUnitInfo.IsPartOfProject)
1149
and (not AnUnitInfo.IsVirtual)
1150
and FileExistsCached(AnUnitInfo.Filename)
1151
and (StateFileAge<FileAgeCached(AnUnitInfo.Filename)) then begin
1152
if ConsoleVerbosity>=0 then
1153
DebugLn('TMainIDE.CheckIfProjectNeedsCompilation Editor Src has changed ',AProject.IDAsString,' ',AnUnitInfo.Filename);
1154
Note+='Editor file "'+AnUnitInfo.Filename+'" is newer than state file:'+LineEnding
1155
+' File age="'+FileAgeToStr(FileAgeCached(AnUnitInfo.Filename))+'"'+LineEnding
1156
+' State file age="'+FileAgeToStr(StateFileAge)+'"'+LineEnding
1157
+' State file='+StateFilename+LineEnding;
1185
if EditorFileHasChanged then
1160
1187
AnUnitInfo:=AnUnitInfo.NextUnitWithEditorIndex;