mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
ide: BLITZ heuristics improved #1168
git-svn-id: svn://ultimatepp.org/upp/trunk@8651 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e6328e781a
commit
56191ba8ff
3 changed files with 22 additions and 3 deletions
|
|
@ -12,9 +12,26 @@ void ResetBlitz()
|
|||
SaveFile(BlitzBaseFile(), "");
|
||||
}
|
||||
|
||||
Time BlitzBaseTime()
|
||||
Time blitz_base_time;
|
||||
|
||||
void InitBlitz()
|
||||
{
|
||||
return max(GetSysTime() - 3600, Time(GetFileTime(BlitzBaseFile())));
|
||||
Time ltm = Time::High();
|
||||
|
||||
const Workspace& wspc = GetIdeWorkspace();
|
||||
for(int i = 0; i < wspc.GetCount(); i++) { // find lowest file time
|
||||
const Package& pk = wspc.GetPackage(i);
|
||||
String n = wspc[i];
|
||||
for(int i = 0; i < pk.GetCount(); i++) {
|
||||
String path = SourcePath(n, pk.file[i]);
|
||||
if(FileExists(path))
|
||||
ltm = min(ltm, FileGetTime(path));
|
||||
}
|
||||
}
|
||||
|
||||
blitz_base_time = max(GetSysTime() - 3600, Time(GetFileTime(BlitzBaseFile())));
|
||||
if(ltm != Time::High())
|
||||
blitz_base_time = max(blitz_base_time, ltm + 3 * 60); // should solve first build after install/checkout
|
||||
}
|
||||
|
||||
Blitz BlitzBuilderComponent::MakeBlitzStep(Vector<String>& sfile, Vector<String>& soptions,
|
||||
|
|
@ -44,7 +61,7 @@ Blitz BlitzBuilderComponent::MakeBlitzStep(Vector<String>& sfile, Vector<String>
|
|||
Time fntime = GetFileTime(fn);
|
||||
if((ext == ".cpp" || ext == ".cc" || ext == ".cxx" || ext == ".icpp")
|
||||
&& HdependBlitzApproved(fn) && IsNull(soptions[i]) && !optimize[i]
|
||||
&& fntime < BlitzBaseTime()
|
||||
&& fntime < blitz_base_time
|
||||
&& noblitz.Find(fn) < 0) {
|
||||
if(HdependFileTime(fn) > blitztime)
|
||||
b.build = true;
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ One<Host> MakeBuild::CreateHost(bool sync_files)
|
|||
One<Builder> MakeBuild::CreateBuilder(Host *host)
|
||||
{
|
||||
SetupDefaultMethod();
|
||||
InitBlitz();
|
||||
VectorMap<String, String> bm = GetMethodVars(method);
|
||||
String builder = bm.Get("BUILDER", "GCC");
|
||||
int q = BuilderMap().Find(builder);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ struct Blitz {
|
|||
|
||||
String BlitzBaseFile();
|
||||
void ResetBlitz();
|
||||
void InitBlitz();
|
||||
|
||||
class BlitzBuilderComponent : public BuilderComponent {
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue