void Ide::EndBuilding(bool ok) { console.EndGroup(); console.Wait(); Vector<String> errors = console.PickErrors(); CreateHost(false)->DeleteFile(errors); if(!errors.IsEmpty()) ok = false; PutConsole(""); PutConsole((ok ? "OK. " : "There were errors. ") + GetPrintTime(build_time)); SetIdeState(EDITING); if(GetTopWindow()->IsOpen()) { if(ok) BeepMuteInformation(); else BeepMuteExclamation(); } ShowConsole(); }
void Ide::BuildAndExecute() { if(Build()) { int time = msecs(); One<Host> h = CreateHostRunDir(); h->ChDir(Nvl(rundir, GetFileFolder(target))); String cmdline; if(!runexternal) cmdline << '\"' << h->GetHostPath(target) << "\" "; cmdline << ToSystemCharset(runarg); int exitcode; switch(runmode) { case RUN_WINDOW: HideBottom(); h->Launch(cmdline, FindIndex(SplitFlags(mainconfigparam, true), "GUI") < 0); break; case RUN_CONSOLE: ShowConsole(); PutConsole(String().Cat() << "Executing: " << cmdline); console.Sync(); exitcode = h->ExecuteWithInput(cmdline); PutConsole("Finished in " + GetPrintTime(time) + ", exit code: " + AsString(exitcode)); break; case RUN_FILE: { HideBottom(); String fn; if(IsNull(stdout_file)) fn = ForceExt(target, ".ol"); else fn = stdout_file; FileOut out(fn); if(!out) { PromptOK("Unable to open output file [* " + DeQtf(stdout_file) + "] !"); return; } if(h->Execute(cmdline, out) >= 0) { out.Close(); EditFile(fn); } } } } }
void PutCompileTime(int time, int count) { PutConsole(String().Cat() << count << " file(s) compiled in " << GetPrintTime(time) << " " << int(GetTickCount() - time) / count << " msec/file"); }
void CppBuilder::ShowTime(int count, int start_time) { if(count) PutConsole(NFormat("%d file(s) compiled in %s %d msec/file", count, GetPrintTime(start_time), msecs(start_time) / count)); }