mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-20 14:15:24 -06:00
ide: LocalHost/Host, urepo refactored
git-svn-id: svn://ultimatepp.org/upp/trunk@15586 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e274a4611a
commit
46cfc0fad8
47 changed files with 392 additions and 676 deletions
|
|
@ -31,7 +31,7 @@ String Ide::GetMain()
|
|||
return main;
|
||||
}
|
||||
|
||||
void Ide::BeginBuilding(bool sync_files, bool clear_console)
|
||||
void Ide::BeginBuilding(bool clear_console)
|
||||
{
|
||||
SetupDefaultMethod();
|
||||
HdependTimeDirty();
|
||||
|
|
@ -47,7 +47,6 @@ void Ide::BeginBuilding(bool sync_files, bool clear_console)
|
|||
if(clear_console)
|
||||
console.Clear();
|
||||
build_time = msecs();
|
||||
CreateHost(sync_files, disable_uhd);
|
||||
cmdout.Clear();
|
||||
}
|
||||
|
||||
|
|
@ -56,7 +55,8 @@ void Ide::EndBuilding(bool ok)
|
|||
console.EndGroup();
|
||||
console.Wait();
|
||||
Vector<String> errors = console.PickErrors();
|
||||
CreateHost(false, disable_uhd)->DeleteFile(errors);
|
||||
for(String p : errors)
|
||||
DeleteFile(p);
|
||||
if(!errors.IsEmpty())
|
||||
ok = false;
|
||||
PutConsole("");
|
||||
|
|
@ -79,7 +79,7 @@ void Ide::DoBuild()
|
|||
void Ide::PackageBuild()
|
||||
{
|
||||
InitBlitz();
|
||||
BeginBuilding(true, true);
|
||||
BeginBuilding(true);
|
||||
const Workspace& wspc = IdeWorkspace();
|
||||
int pi = GetPackageIndex();
|
||||
if(pi >= 0 && pi <= wspc.GetCount()) {
|
||||
|
|
@ -138,7 +138,7 @@ void Ide::FileCompile()
|
|||
return;
|
||||
ClearErrorEditor(editfile);
|
||||
SwitchHeader();
|
||||
BeginBuilding(true, true);
|
||||
BeginBuilding(true);
|
||||
const Workspace& wspc = IdeWorkspace();
|
||||
bool ok = true;
|
||||
onefile = editfile;
|
||||
|
|
@ -180,11 +180,12 @@ void Ide::Preprocess(bool asmout) {
|
|||
const Workspace& wspc = IdeWorkspace();
|
||||
if(pi >= wspc.GetCount())
|
||||
return;
|
||||
One<Host> host = CreateHost(darkmode, disable_uhd);
|
||||
One<Builder> b = CreateBuilder(~host);
|
||||
Host host;
|
||||
CreateHost(host, darkmode, disable_uhd);
|
||||
One<Builder> b = CreateBuilder(&host);
|
||||
Vector<String> linkfile;
|
||||
String linkopt;
|
||||
b->config = PackageConfig(wspc, pi, GetMethodVars(method), mainconfigparam, *host, *b);
|
||||
b->config = PackageConfig(wspc, pi, GetMethodVars(method), mainconfigparam, host, *b);
|
||||
console.Clear();
|
||||
PutConsole((asmout ? "Compiling " : "Preprocessing ") + editfile);
|
||||
b->Preprocess(wspc[pi], editfile, pfn, asmout);
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ Blitz BlitzBuilderComponent::MakeBlitzStep(
|
|||
b.build = true;
|
||||
blitz << "\r\n"
|
||||
<< "#define BLITZ_INDEX__ F" << i << "\r\n"
|
||||
<< "#include \"" << builder->GetHostPath(sourceFile) << "\"\r\n";
|
||||
<< "#include \"" << sourceFile << "\"\r\n";
|
||||
b.info << ' ' << GetFileName(sourceFile);
|
||||
const Vector<String>& d = HdependGetDefines(sourceFile);
|
||||
for(int i = 0; i < d.GetCount(); i++)
|
||||
|
|
@ -97,16 +97,16 @@ Blitz BlitzBuilderComponent::MakeBlitzStep(
|
|||
if(b.count > 1) {
|
||||
sourceFiles = pick(excluded);
|
||||
soptions = pick(excludedoptions);
|
||||
if(builder->LoadFile(b.path) != blitz) {
|
||||
builder->RealizeDir(GetFileDirectory(b.path));
|
||||
builder->SaveFile(b.path, blitz);
|
||||
if(LoadFile(b.path) != blitz) {
|
||||
RealizeDirectory(GetFileDirectory(b.path));
|
||||
SaveFile(b.path, blitz);
|
||||
b.build = true;
|
||||
}
|
||||
obj.Add(b.object);
|
||||
immfile.Add(b.object);
|
||||
}
|
||||
else {
|
||||
builder->DeleteFile(b.path);
|
||||
DeleteFile(b.path);
|
||||
b.build = false;
|
||||
}
|
||||
return b;
|
||||
|
|
|
|||
|
|
@ -93,13 +93,11 @@ String NoCr(const char *s)
|
|||
return out;
|
||||
}
|
||||
|
||||
One<Host> MakeBuild::CreateHost(bool darkmode, bool disable_uhd)
|
||||
void MakeBuild::CreateHost(Host& host, bool darkmode, bool disable_uhd, const VectorMap<String, String>& add_to_env)
|
||||
{
|
||||
SetupDefaultMethod();
|
||||
VectorMap<String, String> bm = GetMethodVars(method);
|
||||
One<Host> outhost;
|
||||
{
|
||||
auto& host = outhost.Create<LocalHost>();
|
||||
VectorMap<String, String> env = clone(Environment());
|
||||
host.exedirs = SplitDirs(bm.Get("PATH", "") + ';' + env.Get("PATH", ""));
|
||||
#ifdef PLATFORM_WIN32
|
||||
|
|
@ -127,10 +125,14 @@ One<Host> MakeBuild::CreateHost(bool darkmode, bool disable_uhd)
|
|||
LDUMP(env[i]);
|
||||
host.environment << env.GetKey(i) << '=' << env[i] << '\0';
|
||||
}
|
||||
for(int i = 0; i < add_to_env.GetCount(); i++) {
|
||||
LDUMP(add_to_env.GetKey(i));
|
||||
LDUMP(add_to_env[i]);
|
||||
host.environment << add_to_env.GetKey(i) << '=' << add_to_env[i] << '\0';
|
||||
}
|
||||
host.environment.Cat(0);
|
||||
host.cmdout = &cmdout;
|
||||
}
|
||||
return outhost;
|
||||
}
|
||||
|
||||
One<Builder> MakeBuild::CreateBuilder(Host *host)
|
||||
|
|
@ -219,7 +221,7 @@ String MakeBuild::OutDir(const Index<String>& cfg, const String& package, const
|
|||
Index<String> excl;
|
||||
excl.Add(bm.Get("BUILDER", "GCC"));
|
||||
excl.Add("MSC");
|
||||
LocalHost().AddFlags(excl);
|
||||
Host().AddFlags(excl);
|
||||
Vector<String> x;
|
||||
bool dbg = cfg.Find("DEBUG_FULL") >= 0 || cfg.Find("DEBUG_MINIMAL") >= 0;
|
||||
if(cfg.Find("DEBUG") >= 0) {
|
||||
|
|
@ -248,46 +250,6 @@ String MakeBuild::OutDir(const Index<String>& cfg, const String& package, const
|
|||
return outdir;
|
||||
}
|
||||
|
||||
struct OneFileHost : Host {
|
||||
One<Host> host;
|
||||
String onefile;
|
||||
|
||||
virtual String GetEnvironment() { return host->GetEnvironment(); }
|
||||
virtual String GetHostPath(const String& path) { return host->GetHostPath(path); }
|
||||
virtual String GetLocalPath(const String& path) { return host->GetLocalPath(path); }
|
||||
virtual String NormalizePath(const String& path) { return host->NormalizePath(path); }
|
||||
virtual String NormalizeExecutablePath(const String& path) { return host->NormalizeExecutablePath(path); }
|
||||
virtual void DeleteFile(const Vector<String>& path) { host->DeleteFile(path); }
|
||||
virtual void DeleteFolderDeep(const String& folder) { host->DeleteFolderDeep(folder); }
|
||||
virtual void ChDir(const String& path) { host->ChDir(path); }
|
||||
virtual bool RealizeDir(const String& path) { return host->RealizeDir(path); }
|
||||
virtual bool SaveFile(const String& path, const String& data) { return host->SaveFile(path, data); }
|
||||
virtual String LoadFile(const String& path) { return host->LoadFile(path); }
|
||||
virtual int Execute(const char *c) { return host->Execute(c); }
|
||||
virtual int ExecuteWithInput(const char *c, bool noconvert) { return host->ExecuteWithInput(c, noconvert); }
|
||||
virtual int Execute(const char *c, Stream& o, bool noconvert) { return host->Execute(c, o, noconvert); }
|
||||
virtual int AllocSlot() { return host->AllocSlot(); }
|
||||
virtual bool Run(const char *cmdline, int slot, String key, int blitz_count) { return host->Run(cmdline, slot, key, blitz_count); }
|
||||
virtual bool Run(const char *cmdline, Stream& out, int slot, String key, int blitz_count) { return host->Run(cmdline, out, slot, key, blitz_count); }
|
||||
virtual bool Wait() { return host->Wait(); }
|
||||
virtual bool Wait(int slot) { return host->Wait(slot); }
|
||||
virtual void OnFinish(Event<> cb) { return host->OnFinish(cb); }
|
||||
virtual One<AProcess> StartProcess(const char *c) { return host->StartProcess(c); }
|
||||
virtual void Launch(const char *cmdline, bool) { host->Launch(cmdline); }
|
||||
virtual void AddFlags(Index<String>& cfg) { host->AddFlags(cfg); }
|
||||
virtual const Vector<String>& GetExecutablesDirs() const { return host->GetExecutablesDirs(); }
|
||||
|
||||
virtual Vector<FileInfo> GetFileInfo(const Vector<String>& path) {
|
||||
Vector<FileInfo> fi = host->GetFileInfo(path);
|
||||
for(int i = 0; i < path.GetCount(); i++)
|
||||
if(path[i] == onefile)
|
||||
(Time &)fi[i] = GetSysTime();
|
||||
else
|
||||
(Time &)fi[i] = Time::Low();
|
||||
return fi;
|
||||
}
|
||||
};
|
||||
|
||||
void MakeBuild::PkgConfig(const Workspace& wspc, const Index<String>& config, Index<String>& pkg_config)
|
||||
{
|
||||
for(int i = 0; i < wspc.GetCount(); i++)
|
||||
|
|
@ -308,25 +270,21 @@ bool MakeBuild::BuildPackage(const Workspace& wspc, int pkindex, int pknumber, i
|
|||
ConsoleShow();
|
||||
return false;
|
||||
}
|
||||
One<Host> host = CreateHost(false, false);
|
||||
if(!IsNull(onefile)) {
|
||||
OneFileHost *h = new OneFileHost;
|
||||
h->host = pick(host);
|
||||
h->onefile = onefile;
|
||||
host = h;
|
||||
}
|
||||
One<Builder> b = CreateBuilder(~host);
|
||||
Host host;
|
||||
CreateHost(host, false, false);
|
||||
host.onefile = onefile;
|
||||
One<Builder> b = CreateBuilder(&host);
|
||||
if(!b)
|
||||
return false;
|
||||
b->config = PackageConfig(wspc, pkindex, bm, mainparam, *host, *b);
|
||||
b->config = PackageConfig(wspc, pkindex, bm, mainparam, host, *b);
|
||||
PkgConfig(wspc, b->config, b->pkg_config);
|
||||
const TargetMode& m = targetmode == 0 ? debug : release;
|
||||
b->version = m.version;
|
||||
b->method = method;
|
||||
b->outdir = OutDir(b->config, package, bm);
|
||||
host->RealizeDir(b->outdir);
|
||||
host.RealizeDir(b->outdir);
|
||||
String mainfn = Null;
|
||||
Index<String> mcfg = PackageConfig(wspc, 0, bm, mainparam, *host, *b, &mainfn);
|
||||
Index<String> mcfg = PackageConfig(wspc, 0, bm, mainparam, host, *b, &mainfn);
|
||||
HdependClearDependencies();
|
||||
for(int i = 0; i < pkg.GetCount(); i++) {
|
||||
const Array<OptItem>& f = pkg[i].depends;
|
||||
|
|
@ -335,7 +293,7 @@ bool MakeBuild::BuildPackage(const Workspace& wspc, int pkindex, int pknumber, i
|
|||
HdependAddDependency(SourcePath(package, pkg[i]), SourcePath(package, f[j].text));
|
||||
}
|
||||
String tout = OutDir(mcfg, mainpackage, bm, use_target);
|
||||
host->RealizeDir(tout);
|
||||
host.RealizeDir(tout);
|
||||
if(IsNull(mainfn))
|
||||
mainfn = GetFileTitle(mainpackage) + b->GetTargetExt();
|
||||
if(!IsNull(outfile))
|
||||
|
|
@ -348,18 +306,18 @@ bool MakeBuild::BuildPackage(const Workspace& wspc, int pkindex, int pknumber, i
|
|||
else
|
||||
#endif
|
||||
if(m.target_override && !IsNull(m.target) && IsFolder(m.target))
|
||||
target = host->NormalizePath(AppendFileName(m.target, mainfn));
|
||||
target = NormalizePath(AppendFileName(m.target, mainfn));
|
||||
else
|
||||
if(m.target_override && (IsFullPath(m.target) || *m.target == '/' || *m.target == '\\'))
|
||||
target = m.target;
|
||||
else
|
||||
if(m.target_override && !IsNull(m.target))
|
||||
target = host->NormalizePath(AppendFileName(tout, m.target));
|
||||
target = NormalizePath(AppendFileName(tout, m.target));
|
||||
else
|
||||
if(IsFullPath(mainfn))
|
||||
target = mainfn;
|
||||
else
|
||||
target = host->NormalizePath(AppendFileName(tout, mainfn));
|
||||
target = NormalizePath(AppendFileName(tout, mainfn));
|
||||
}
|
||||
b->target = target;
|
||||
b->mainpackage = mainpackage;
|
||||
|
|
@ -373,19 +331,21 @@ bool MakeBuild::BuildPackage(const Workspace& wspc, int pkindex, int pknumber, i
|
|||
else
|
||||
b->config.FindAdd("NOLIB");
|
||||
bool ok = b->BuildPackage(package, linkfile, immfile, linkopt,
|
||||
GetAllUses(wspc, pkindex, bm, mainparam, *host, *b),
|
||||
GetAllLibraries(wspc, pkindex, bm, mainparam, *host, *b),
|
||||
GetAllUses(wspc, pkindex, bm, mainparam, host, *b),
|
||||
GetAllLibraries(wspc, pkindex, bm, mainparam, host, *b),
|
||||
targetmode - 1);
|
||||
target = b->target; // apple app bundle can change target
|
||||
Vector<String> errors = PickErrors();
|
||||
host->DeleteFile(errors);
|
||||
for(String p : errors)
|
||||
DeleteFile(p);
|
||||
if(!ok || !errors.IsEmpty())
|
||||
return false;
|
||||
if(link) {
|
||||
ok = b->Link(linkfile, linkopt, GetTargetMode().createmap);
|
||||
PutLinkingEnd(ok);
|
||||
errors = PickErrors();
|
||||
host->DeleteFile(errors);
|
||||
for(String p : errors)
|
||||
DeleteFile(p);
|
||||
if(!ok || !errors.IsEmpty())
|
||||
return false;
|
||||
}
|
||||
|
|
@ -470,7 +430,7 @@ bool MakeBuild::Build(const Workspace& wspc, String mainparam, String outfile, b
|
|||
DeleteFile(hfile);
|
||||
|
||||
ClearErrorEditor();
|
||||
BeginBuilding(true, clear_console);
|
||||
BeginBuilding(clear_console);
|
||||
bool ok = true;
|
||||
main_conf.Clear();
|
||||
if(wspc.GetCount()) {
|
||||
|
|
@ -487,10 +447,11 @@ bool MakeBuild::Build(const Workspace& wspc, String mainparam, String outfile, b
|
|||
|
||||
if(main_conf.GetCount()) {
|
||||
VectorMap<String, String> bm = GetMethodVars(method);
|
||||
One<Host> host = CreateHost(false, false);
|
||||
One<Builder> b = CreateBuilder(~host);
|
||||
Host host;
|
||||
CreateHost(host, false, false);
|
||||
One<Builder> b = CreateBuilder(&host);
|
||||
if(b) {
|
||||
Index<String> mcfg = PackageConfig(wspc, 0, bm, mainparam, *host, *b, NULL);
|
||||
Index<String> mcfg = PackageConfig(wspc, 0, bm, mainparam, host, *b, NULL);
|
||||
String outdir = OutDir(mcfg, wspc[0], bm, false);
|
||||
String path = AppendFileName(outdir, "main.conf.h");
|
||||
RealizePath(path);
|
||||
|
|
@ -567,12 +528,13 @@ bool MakeBuild::Build()
|
|||
ConsoleShow();
|
||||
return false;
|
||||
}
|
||||
One<Host> host = CreateHost(false, false);
|
||||
One<Builder> builder = CreateBuilder(~host);
|
||||
Host host;
|
||||
CreateHost(host, false, false);
|
||||
One<Builder> builder = CreateBuilder(&host);
|
||||
if(!builder)
|
||||
return false;
|
||||
Index<String> p = PackageConfig(GetIdeWorkspace(), 0, bm, mainconfigparam,
|
||||
*host, *builder);
|
||||
host, *builder);
|
||||
Workspace wspc;
|
||||
wspc.Scan(GetMain(), p.GetKeys());
|
||||
return Build(wspc, mainconfigparam, Null);
|
||||
|
|
@ -581,12 +543,13 @@ bool MakeBuild::Build()
|
|||
void MakeBuild::CleanPackage(const Workspace& wspc, int package)
|
||||
{
|
||||
PutConsole(Format("Cleaning %s", wspc[package]));
|
||||
One<Host> host = CreateHost(false, false);
|
||||
One<Builder> builder = CreateBuilder(~host);
|
||||
Host host;
|
||||
CreateHost(host, false, false);
|
||||
One<Builder> builder = CreateBuilder(&host);
|
||||
if(!builder)
|
||||
return;
|
||||
String outdir = OutDir(PackageConfig(wspc, package, GetMethodVars(method), mainconfigparam,
|
||||
*host, *builder), wspc[package], GetMethodVars(method));
|
||||
host, *builder), wspc[package], GetMethodVars(method));
|
||||
// TODO: almost perfect, but target will be detected after build. if build does not occur the target is empty :(
|
||||
// How to make sure we know target? Target directory is where android project sandbox is.
|
||||
builder->target = target;
|
||||
|
|
@ -597,8 +560,9 @@ void MakeBuild::Clean()
|
|||
{
|
||||
ConsoleClear();
|
||||
|
||||
One<Host> host = CreateHost(false, false);
|
||||
One<Builder> builder = CreateBuilder(~host);
|
||||
Host host;
|
||||
CreateHost(host, false, false);
|
||||
One<Builder> builder = CreateBuilder(&host);
|
||||
if(!builder)
|
||||
return;
|
||||
builder->target = target;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public:
|
|||
virtual void ConsoleClear() = 0;
|
||||
virtual void SetupDefaultMethod() = 0;
|
||||
virtual Vector<String> PickErrors() = 0; //console.PickErrors()
|
||||
virtual void BeginBuilding(bool sync_files, bool clear_console) = 0;
|
||||
virtual void BeginBuilding(bool clear_console) = 0;
|
||||
virtual void EndBuilding(bool ok) = 0;
|
||||
virtual void ClearErrorEditor() = 0;
|
||||
virtual void DoProcessEvents() = 0;
|
||||
|
|
@ -67,10 +67,11 @@ public:
|
|||
|
||||
bool makefile_svn_revision = true;
|
||||
|
||||
void CreateHost(Host& host, bool darkmode = false, bool disable_uhd = false, const VectorMap<String, String>& add_to_env = VectorMap<String, String>());
|
||||
|
||||
const TargetMode& GetTargetMode();
|
||||
Index<String> PackageConfig(const Workspace& wspc, int package, const VectorMap<String, String>& bm,
|
||||
String mainparam, Host& host, Builder& b, String *target = NULL);
|
||||
One<Host> CreateHost(bool darkmode, bool disable_uhd);
|
||||
One<Builder> CreateBuilder(Host *host);
|
||||
String OutDir(const Index<String>& cfg, const String& package,
|
||||
const VectorMap<String, String>& bm, bool use_target = false);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ struct CppBuilder : Builder {
|
|||
Time targettime;
|
||||
|
||||
String GetSharedLibPath(const String& package) const;
|
||||
String GetLocalPath(const String& path) const;
|
||||
int AllocSlot();
|
||||
bool Run(const char *cmdline, int slot, String key, int blitz_count);
|
||||
bool Run(const char *cmdline, Stream& out, int slot, String key, int blitz_count);
|
||||
|
|
|
|||
|
|
@ -94,11 +94,6 @@ String CppBuilder::GetSharedLibPath(const String& package) const
|
|||
return CatAnyPath(GetFileFolder(target), outfn);
|
||||
}
|
||||
|
||||
String CppBuilder::GetLocalPath(const String& path) const
|
||||
{
|
||||
return host->GetLocalPath(path);
|
||||
}
|
||||
|
||||
int CppBuilder::AllocSlot()
|
||||
{
|
||||
return host->AllocSlot();
|
||||
|
|
@ -268,7 +263,7 @@ Vector<String> CppBuilder::CustomStep(const String& pf, const String& package_,
|
|||
{
|
||||
String package = Nvl(package_, mainpackage);
|
||||
String path = (*pf == '.' && pf[1] != '.') ? target : SourcePath(package, pf);
|
||||
String file = GetHostPath(path);
|
||||
String file = path;
|
||||
String ext = ToLower(GetFileExt(pf));
|
||||
if(ext == ".ext") {
|
||||
Vector<String> files;
|
||||
|
|
@ -355,15 +350,15 @@ Vector<String> CppBuilder::CustomStep(const String& pf, const String& package_,
|
|||
AddPath(mac, "PACKAGE", package);
|
||||
mac.Add("FILE", GetFileName(file));
|
||||
mac.Add("TITLE", GetFileTitle(file));
|
||||
AddPath(mac, "EXEPATH", GetHostPath(target));
|
||||
AddPath(mac, "EXEDIR", GetHostPath(GetFileFolder(target)));
|
||||
AddPath(mac, "EXEPATH", target);
|
||||
AddPath(mac, "EXEDIR", GetFileFolder(target));
|
||||
mac.Add("EXEFILE", GetFileName(target));
|
||||
mac.Add("EXETITLE", GetFileTitle(target));
|
||||
AddPath(mac, "OUTDIR", GetHostPath(outdir));
|
||||
AddPath(mac, "OUTDIR", outdir);
|
||||
//BW
|
||||
AddPath(mac, "OUTDIR", GetHostPath(GetFileFolder(target)));
|
||||
AddPath(mac, "OUTFILE", GetHostPath(GetFileName(target)));
|
||||
AddPath(mac, "OUTTITLE", GetHostPath(GetFileTitle(target)));
|
||||
AddPath(mac, "OUTDIR", GetFileFolder(target));
|
||||
AddPath(mac, "OUTFILE", GetFileName(target));
|
||||
AddPath(mac, "OUTTITLE", GetFileTitle(target));
|
||||
|
||||
mac.Add("INCLUDE", Join(include, ";"));
|
||||
|
||||
|
|
@ -406,8 +401,8 @@ String CppBuilder::Includes(const char *sep, const String& package, const Packag
|
|||
{
|
||||
String cc;
|
||||
for(int i = 0; i < include.GetCount(); i++)
|
||||
cc << sep << GetHostPathQ(include[i]);
|
||||
cc << sep << GetHostPathQ(outdir);
|
||||
cc << sep << GetPathQ(include[i]);
|
||||
cc << sep << GetPathQ(outdir);
|
||||
return cc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ void GccBuilder::BinaryToObject(String objfile, CParser& binscript, String based
|
|||
String tmpfile = ForceExt(objfile, ".c");
|
||||
SaveFile(tmpfile, fo);
|
||||
String cc = CmdLine(package, pkg);
|
||||
cc << " -c -o " << GetHostPathQ(objfile) << " -x c " << GetHostPathQ(tmpfile);
|
||||
cc << " -c -o " << GetPathQ(objfile) << " -x c " << GetPathQ(tmpfile);
|
||||
int slot = AllocSlot();
|
||||
if(slot < 0 || !Run(cc, slot, objfile, 1))
|
||||
throw Exc(Format("Error compiling binary object '%s'.", objfile));
|
||||
|
|
@ -202,22 +202,22 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
int pch_slot = AllocSlot();
|
||||
StringBuffer sb;
|
||||
|
||||
sb << Join(cc, cpp_options) << " -x c++-header " << GetHostPathQ(pch_header) << " -o " << GetHostPathQ(pch_file);
|
||||
sb << Join(cc, cpp_options) << " -x c++-header " << GetPathQ(pch_header) << " -o " << GetPathQ(pch_file);
|
||||
|
||||
PutConsole("Precompiling header: " + GetFileName(pch_header));
|
||||
if(pch_slot < 0 || !Run(~sb, pch_slot, GetHostPath(pch_file), 1))
|
||||
if(pch_slot < 0 || !Run(~sb, pch_slot, pch_file, 1))
|
||||
error = true;
|
||||
Wait();
|
||||
|
||||
pch_use = " -I" + GetHostPathQ(outdir) + " -include " + GetFileName(pch_header2) + " -Winvalid-pch ";
|
||||
pch_use = " -I" + GetPathQ(outdir) + " -include " + GetFileName(pch_header2) + " -Winvalid-pch ";
|
||||
}
|
||||
|
||||
if(blitz && b.build) {
|
||||
PutConsole("BLITZ:" + b.info);
|
||||
int slot = AllocSlot();
|
||||
if(slot < 0 || !Run(String().Cat() << Join(cc, cpp_options) << ' '
|
||||
<< GetHostPathQ(b.path)
|
||||
<< " -o " << GetHostPathQ(b.object), slot, GetHostPath(b.object), b.count))
|
||||
<< GetPathQ(b.path)
|
||||
<< " -o " << GetPathQ(b.object), slot, b.object, b.count))
|
||||
error = true;
|
||||
}
|
||||
|
||||
|
|
@ -237,7 +237,7 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
String objfile = CatAnyPath(outdir, GetFileTitle(fn) + (rc ? "$rc.o" : brc ? "$brc.o" : ".o"));
|
||||
if(GetFileName(fn) == "Info.plist")
|
||||
Info_plist = LoadFile(fn);
|
||||
if(HdependFileTime(fn) > GetFileTime(GetHostPath(objfile))) {
|
||||
if(HdependFileTime(fn) > GetFileTime(objfile)) {
|
||||
PutConsole(GetFileName(fn));
|
||||
int time = msecs();
|
||||
bool execerr = false;
|
||||
|
|
@ -247,14 +247,14 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
int q = compiler.ReverseFind('-'); // clang32 windres name is i686-w64-mingw32-windres.exe
|
||||
if(q > 0)
|
||||
windres = compiler.Mid(0, q + 1) + windres;
|
||||
exec << GetHostPath(FindInDirs(host->GetExecutablesDirs(), windres)) << " -i " << GetHostPathQ(fn);
|
||||
exec << FindInDirs(host->GetExecutablesDirs(), windres) << " -i " << GetPathQ(fn);
|
||||
if(cc.Find(" -m32 ") >= 0)
|
||||
exec << " --target=pe-i386 ";
|
||||
exec << " -o " << GetHostPathQ(objfile) << Includes(" --include-dir=", package, pkg)
|
||||
exec << " -o " << GetPathQ(objfile) << Includes(" --include-dir=", package, pkg)
|
||||
<< DefinesTargetTime(" -D", package, pkg) + (HasFlag("DEBUG")?" -D_DEBUG":"");
|
||||
PutVerbose(exec);
|
||||
int slot = AllocSlot();
|
||||
execerr = (slot < 0 || !Run(exec, slot, GetHostPath(objfile), 1));
|
||||
execerr = (slot < 0 || !Run(exec, slot, objfile, 1));
|
||||
}
|
||||
else if(brc) {
|
||||
try {
|
||||
|
|
@ -262,7 +262,7 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
if(brcdata.IsVoid())
|
||||
throw Exc(Format("error reading file '%s'", fn));
|
||||
CParser parser(brcdata, fn);
|
||||
BinaryToObject(GetHostPath(objfile), parser, GetFileDirectory(fn), package, pkg);
|
||||
BinaryToObject(objfile, parser, GetFileDirectory(fn), package, pkg);
|
||||
}
|
||||
catch(Exc e) {
|
||||
PutConsole(e);
|
||||
|
|
@ -285,10 +285,10 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
exec << fuse_cxa_atexit << Join(" -x c++", cpp_options) << ' ';
|
||||
exec << pch_use;
|
||||
}
|
||||
exec << GetHostPathQ(fn) << " " << soptions[i] << " -o " << GetHostPathQ(objfile);
|
||||
exec << GetPathQ(fn) << " " << soptions[i] << " -o " << GetPathQ(objfile);
|
||||
PutVerbose(exec);
|
||||
int slot = AllocSlot();
|
||||
execerr = (slot < 0 || !Run(exec, slot, GetHostPath(objfile), 1));
|
||||
execerr = (slot < 0 || !Run(exec, slot, objfile, 1));
|
||||
}
|
||||
if(execerr)
|
||||
DeleteFile(objfile);
|
||||
|
|
@ -340,11 +340,11 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
product = GetSharedLibPath(package);
|
||||
else
|
||||
product = CatAnyPath(outdir, GetAnyFileName(package) + ".a");
|
||||
String hproduct = GetHostPath(product);
|
||||
String hproduct = product;
|
||||
Time producttime = GetFileTime(hproduct);
|
||||
if(obj.GetCount()) {
|
||||
linkfile.Add(GetHostPath(product));
|
||||
immfile.Add(GetHostPath(product));
|
||||
linkfile.Add(product);
|
||||
immfile.Add(product);
|
||||
}
|
||||
for(int i = 0; i < obj.GetCount(); i++)
|
||||
if(GetFileTime(obj[i]) > producttime)
|
||||
|
|
@ -363,7 +363,7 @@ bool GccBuilder::CreateLib(const String& product, const Vector<String>& obj,
|
|||
const String& link_options)
|
||||
{
|
||||
int libtime = msecs();
|
||||
String hproduct = GetHostPath(product);
|
||||
String hproduct = product;
|
||||
String lib;
|
||||
bool is_shared = HasFlag("SO");
|
||||
if(is_shared) {
|
||||
|
|
@ -382,20 +382,20 @@ bool GccBuilder::CreateLib(const String& product, const Vector<String>& obj,
|
|||
}
|
||||
else
|
||||
lib = "ar -sr ";
|
||||
lib << GetHostPathQ(product);
|
||||
lib << GetPathQ(product);
|
||||
|
||||
String llib;
|
||||
for(int i = 0; i < obj.GetCount(); i++)
|
||||
llib << ' ' << GetHostPathQ(obj[i]);
|
||||
llib << ' ' << GetPathQ(obj[i]);
|
||||
PutConsole("Creating library...");
|
||||
DeleteFile(hproduct);
|
||||
if(is_shared) {
|
||||
for(int i = 0; i < libpath.GetCount(); i++)
|
||||
llib << " -L" << GetHostPathQ(libpath[i]);
|
||||
llib << " -L" << GetPathQ(libpath[i]);
|
||||
for(int i = 0; i < all_uses.GetCount(); i++)
|
||||
llib << ' ' << GetHostPathQ(GetSharedLibPath(all_uses[i]));
|
||||
llib << ' ' << GetPathQ(GetSharedLibPath(all_uses[i]));
|
||||
for(int i = 0; i < all_libraries.GetCount(); i++)
|
||||
llib << " -l" << GetHostPathQ(all_libraries[i]);
|
||||
llib << " -l" << GetPathQ(all_libraries[i]);
|
||||
|
||||
if(HasFlag("POSIX"))
|
||||
llib << " -Wl,-soname," << GetSoname(product);
|
||||
|
|
@ -522,15 +522,15 @@ bool GccBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
lnk << " -mconsole";
|
||||
}
|
||||
}
|
||||
lnk << " -o " << GetHostPathQ(target);
|
||||
lnk << " -o " << GetPathQ(target);
|
||||
if(createmap)
|
||||
lnk << " -Wl,-Map," << GetHostPathQ(GetFileDirectory(target) + GetFileTitle(target) + ".map");
|
||||
lnk << " -Wl,-Map," << GetPathQ(GetFileDirectory(target) + GetFileTitle(target) + ".map");
|
||||
if(HasFlag("DEBUG_MINIMAL") || HasFlag("DEBUG_FULL"))
|
||||
lnk << (HasFlag("CLANG") && HasFlag("WIN32") ? " -Wl,-pdb=" : " -ggdb");
|
||||
else
|
||||
lnk << (!HasFlag("OSX") ? " -Wl,-s" : "");
|
||||
for(i = 0; i < libpath.GetCount(); i++)
|
||||
lnk << " -L" << GetHostPathQ(libpath[i]);
|
||||
lnk << " -L" << GetPathQ(libpath[i]);
|
||||
MergeWith(lnk, " ", linkoptions);
|
||||
String lfilename;
|
||||
if(HasFlag("OBJC")) {
|
||||
|
|
@ -538,23 +538,23 @@ bool GccBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
String linklist;
|
||||
for(i = 0; i < linkfile.GetCount(); i++)
|
||||
if(ToLower(GetFileExt(linkfile[i])) == ".o" || ToLower(GetFileExt(linkfile[i])) == ".a")
|
||||
linklist << GetHostPath(linkfile[i]) << '\n';
|
||||
linklist << linkfile[i] << '\n';
|
||||
|
||||
String linklistM = "Producing link file list ...\n";
|
||||
String odir = GetFileDirectory(linkfile[0]);
|
||||
lfilename << GetHostPath(GetFileFolder(linkfile[0])) << ".LinkFileList";
|
||||
lfilename << GetFileFolder(linkfile[0]) << ".LinkFileList";
|
||||
|
||||
linklistM << lfilename;
|
||||
UPP::SaveFile(lfilename, linklist);
|
||||
lnk << " -L" << GetHostPathQ(odir)
|
||||
<< " -F" << GetHostPathQ(odir)
|
||||
lnk << " -L" << GetPathQ(odir)
|
||||
<< " -F" << GetPathQ(odir)
|
||||
<< " -filelist " << lfilename << " ";
|
||||
PutConsole( linklistM );
|
||||
}
|
||||
else
|
||||
for(i = 0; i < linkfile.GetCount(); i++) {
|
||||
if(ToLower(GetFileExt(linkfile[i])) == ".o")
|
||||
lnk << ' ' << GetHostPathQ(linkfile[i]);
|
||||
lnk << ' ' << GetPathQ(linkfile[i]);
|
||||
else
|
||||
lib.Add(linkfile[i]);
|
||||
}
|
||||
|
|
@ -582,12 +582,12 @@ bool GccBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
|
||||
if(pass == 0) {
|
||||
if(ext == ".a")
|
||||
lnk << ' ' << GetHostPathQ(FindInDirs(libpath, lib[i]));
|
||||
lnk << ' ' << GetPathQ(FindInDirs(libpath, lib[i]));
|
||||
}
|
||||
else
|
||||
if(ext != ".a") {
|
||||
if(ext == ".so" || ext == ".dll" || ext == ".lib")
|
||||
lnk << ' ' << GetHostPathQ(FindInDirs(libpath, lib[i]));
|
||||
lnk << ' ' << GetPathQ(FindInDirs(libpath, lib[i]));
|
||||
else
|
||||
lnk << " -l" << ln;
|
||||
}
|
||||
|
|
@ -600,7 +600,7 @@ bool GccBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
CustomStep(".pre-link", Null, error);
|
||||
if(!error && Execute(lnk) == 0) {
|
||||
CustomStep(".post-link", Null, error);
|
||||
PutConsole(String().Cat() << GetHostPath(target) << " (" << GetFileInfo(target).length
|
||||
PutConsole(String().Cat() << target << " (" << GetFileInfo(target).length
|
||||
<< " B) linked in " << GetPrintTime(time));
|
||||
return !error;
|
||||
}
|
||||
|
|
@ -610,7 +610,7 @@ bool GccBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
}
|
||||
}
|
||||
|
||||
PutConsole(String().Cat() << GetHostPath(target) << " (" << GetFileInfo(target).length
|
||||
PutConsole(String().Cat() << target << " (" << GetFileInfo(target).length
|
||||
<< " B) is up to date.");
|
||||
return true;
|
||||
}
|
||||
|
|
@ -627,7 +627,7 @@ bool GccBuilder::Preprocess(const String& package, const String& file, const Str
|
|||
String cmd = CmdLine(package, pkg);
|
||||
cmd << " " << Gather(pkg.option, config.GetKeys());
|
||||
cmd << " -o " << target;
|
||||
cmd << (asmout ? " -S " : " -E ") << GetHostPathQ(file);
|
||||
cmd << (asmout ? " -S " : " -E ") << GetPathQ(file);
|
||||
if(BuilderUtils::IsCFile(file))
|
||||
cmd << " " << c_options;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -104,8 +104,8 @@ bool JavaBuilder::BuildPackage(const String& package, Vector<String>& linkfile,
|
|||
ismf = true;
|
||||
if(manifest >= 0)
|
||||
{
|
||||
PutConsole(Format("%s(1): duplicate manifest file", GetHostPath(fn)));
|
||||
PutConsole(Format("%s(1): (previous manifest file)", GetHostPath(sfile[manifest])));
|
||||
PutConsole(Format("%s(1): duplicate manifest file", fn));
|
||||
PutConsole(Format("%s(1): (previous manifest file)", sfile[manifest]));
|
||||
}
|
||||
manifest = sfile.GetCount();
|
||||
}
|
||||
|
|
@ -199,12 +199,12 @@ bool JavaBuilder::PreprocessJava(String file, String target, String options,
|
|||
{
|
||||
prepfile = ForceExt(file, ".i");
|
||||
host->ChDir(GetFileFolder(prepfile));
|
||||
execpath << GetHostPath(file);
|
||||
execpath << file;
|
||||
}
|
||||
else
|
||||
{
|
||||
PutConsole(file);
|
||||
execpath << GetHostPath(file) << " " << GetHostPath(target);
|
||||
execpath << file << " " << target;
|
||||
prepfile = target;
|
||||
}
|
||||
if(Execute(execpath) != 0)
|
||||
|
|
@ -268,9 +268,9 @@ bool JavaBuilder::Link(const Vector<String>& linkfile, const String& linkoptions
|
|||
cmdline << "cf";
|
||||
if(!manifest.IsEmpty())
|
||||
cmdline << 'm';
|
||||
cmdline << ' ' << GetHostPath(target);
|
||||
cmdline << ' ' << target;
|
||||
if(!manifest.IsEmpty())
|
||||
cmdline << ' ' << GetHostPath(manifest);
|
||||
cmdline << ' ' << manifest;
|
||||
Time tm = Time::Low();
|
||||
for(int i = ITEMCOUNT; i < linkfile.GetCount(); i++)
|
||||
tm = max(tm, AddClassDeep(cmdline, linkfile[i], Null));
|
||||
|
|
@ -301,7 +301,7 @@ bool JavaBuilder::Link(const Vector<String>& linkfile, const String& linkoptions
|
|||
<< " B) archived in " << GetPrintTime(time));
|
||||
}
|
||||
else
|
||||
PutConsole(String().Cat() << GetHostPath(target) << " (" << GetFileInfo(target).length
|
||||
PutConsole(String().Cat() << target << " (" << GetFileInfo(target).length
|
||||
<< " B) is up to date.");
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ void CppBuilder::AddMakeFile(MakeFile& makefile, String package,
|
|||
<< " $(LINKOPTIONS)\n"
|
||||
"LIBPATH =";
|
||||
for(int i = 0; i < libpath.GetCount(); i++)
|
||||
makefile.config << " -L" << GetMakePath(AdjustMakePath(GetHostPathQ(libpath[i])));
|
||||
makefile.config << " -L" << GetMakePath(AdjustMakePath(GetPathQ(libpath[i])));
|
||||
makefile.config << "\n"
|
||||
"AR = ar -sr\n\n";
|
||||
Vector<String> lib;
|
||||
|
|
@ -149,7 +149,7 @@ void CppBuilder::AddMakeFile(MakeFile& makefile, String package,
|
|||
String ln = libs[i];
|
||||
String ext = ToLower(GetFileExt(ln));
|
||||
if(ext == ".a" || ext == ".so" || ext == ".dll")
|
||||
makefile.linkfileend << " \\\n\t\t\t" << GetHostPathQ(FindInDirs(libpath, ln));
|
||||
makefile.linkfileend << " \\\n\t\t\t" << GetPathQ(FindInDirs(libpath, ln));
|
||||
else
|
||||
makefile.linkfileend << " \\\n\t\t\t-l" << ln;
|
||||
}
|
||||
|
|
@ -257,11 +257,12 @@ void CppBuilder::ShowTime(int count, int start_time)
|
|||
|
||||
void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
||||
{
|
||||
BeginBuilding(false, true);
|
||||
BeginBuilding(true);
|
||||
|
||||
VectorMap<String, String> bm = GetMethodVars(method);
|
||||
One<Host> host = CreateHost(false, false);
|
||||
One<Builder> b = CreateBuilder(~host);
|
||||
Host host;
|
||||
CreateHost(host, false, false);
|
||||
One<Builder> b = CreateBuilder(&host);
|
||||
|
||||
if(!b)
|
||||
return;
|
||||
|
|
@ -271,10 +272,10 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
|||
String makefile;
|
||||
|
||||
Vector<String> uppdirs = GetUppDirs();
|
||||
String uppout = exporting ? host->GetHostPath(GetVar("OUTPUT")) : ".cache/upp.out";
|
||||
String uppout = exporting ? GetVar("OUTPUT") : ".cache/upp.out";
|
||||
String inclist;
|
||||
|
||||
Index<String> allconfig = PackageConfig(GetIdeWorkspace(), 0, bm, mainconfigparam, *host, *b);
|
||||
Index<String> allconfig = PackageConfig(GetIdeWorkspace(), 0, bm, mainconfigparam, host, *b);
|
||||
bool win32 = allconfig.Find("WIN32") >= 0;
|
||||
|
||||
Workspace wspc;
|
||||
|
|
@ -282,7 +283,7 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
|||
|
||||
Index<String> pkg_config;
|
||||
for(int i = 0; i < wspc.GetCount(); i++) {
|
||||
Index<String> modconfig = PackageConfig(wspc, i, bm, mainconfigparam, *host, *b);
|
||||
Index<String> modconfig = PackageConfig(wspc, i, bm, mainconfigparam, host, *b);
|
||||
PkgConfig(wspc, modconfig, pkg_config);
|
||||
if(i)
|
||||
for(int a = allconfig.GetCount(); --a >= 0;)
|
||||
|
|
@ -292,7 +293,7 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
|||
|
||||
if(!exporting)
|
||||
for(int i = 0; i < uppdirs.GetCount(); i++) {
|
||||
String srcdir = GetMakePath(AdjustMakePath(host->GetHostPath(AppendFileName(uppdirs[i], ""))), win32);
|
||||
String srcdir = GetMakePath(AdjustMakePath(AppendFileName(uppdirs[i], "")), win32);
|
||||
makefile << "UPPDIR" << (i + 1) << " = " << srcdir << "\n";
|
||||
inclist << " -I$(UPPDIR" << (i + 1) << ")";
|
||||
}
|
||||
|
|
@ -308,7 +309,7 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
|||
inclist << " -I$(UPPOUT)"; // build_info.h is created there
|
||||
|
||||
makefile << "\n"
|
||||
"UPPOUT = " << (exporting ? "_out/" : GetMakePath(AdjustMakePath(host->GetHostPath(AppendFileName(uppout, ""))), win32)) << "\n"
|
||||
"UPPOUT = " << (exporting ? "_out/" : GetMakePath(AdjustMakePath(AppendFileName(uppout, "")), win32)) << "\n"
|
||||
"CINC = " << inclist << "\n"
|
||||
"Macro = ";
|
||||
|
||||
|
|
@ -322,12 +323,12 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
|
|||
linkfileend << " \\\n\t\t\t`pkg-config --libs " << s << "`";
|
||||
|
||||
for(int i = 0; i < wspc.GetCount(); i++) {
|
||||
b->config = PackageConfig(wspc, i, bm, mainconfigparam, *host, *b);
|
||||
b->config = PackageConfig(wspc, i, bm, mainconfigparam, host, *b);
|
||||
b->version = tm.version;
|
||||
b->method = method;
|
||||
MakeFile mf;
|
||||
b->AddMakeFile(mf, wspc[i], GetAllUses(wspc, i, bm, mainconfigparam, *host, *b),
|
||||
GetAllLibraries(wspc, i, bm, mainconfigparam, *host, *b), allconfig,
|
||||
b->AddMakeFile(mf, wspc[i], GetAllUses(wspc, i, bm, mainconfigparam, host, *b),
|
||||
GetAllLibraries(wspc, i, bm, mainconfigparam, host, *b), allconfig,
|
||||
exporting);
|
||||
if(i == 0) { // main package
|
||||
String tdir = mf.outdir;
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ String MscBuilder::Pdb(String package, int slot, bool separate_pdb) const
|
|||
String pdb_name = GetAnyFileName(package);
|
||||
if(separate_pdb)
|
||||
pdb_name << '-' << (slot + 1);
|
||||
return " -Gy -Fd" + GetHostPathQ(CatAnyPath(outdir, pdb_name + ".pdb"));
|
||||
return " -Gy -Fd" + GetPathQ(CatAnyPath(outdir, pdb_name + ".pdb"));
|
||||
}
|
||||
|
||||
void DeletePCHFile(const String& pch_file)
|
||||
|
|
@ -265,10 +265,10 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
cc << " -EHsc";
|
||||
else
|
||||
cc << " -GX";
|
||||
// String pdb = GetHostPathQ(CatAnyPath(outdir, GetAnyFileName(package) + ".pdb"));
|
||||
// String pdb = GetPathQ(CatAnyPath(outdir, GetAnyFileName(package) + ".pdb"));
|
||||
// String pch;
|
||||
// if(!HasFlag("MSC8")) // MSC8 does not support automatic precompiled headers...
|
||||
// pch << " -YX -Fp" << GetHostPathQ(CatAnyPath(outdir, GetAnyFileName(package) + ".pch")) << ' ';
|
||||
// pch << " -YX -Fp" << GetPathQ(CatAnyPath(outdir, GetAnyFileName(package) + ".pch")) << ' ';
|
||||
// cc << " -Gy -Fd" << pdb;
|
||||
// if(HasFlag("SSE2") && !IsMsc64())
|
||||
// cc << " /arch:SSE2";
|
||||
|
|
@ -309,7 +309,7 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
String pch_obj = CatAnyPath(outdir, GetFileTitle(pch_header) + "$pch.obj");
|
||||
pch_file = CatAnyPath(outdir, GetFileTitle(pch_header) + ".pch");
|
||||
RegisterPCHFile(pch_file);
|
||||
String pch_common = GetHostPathQ(pch_header) + " -Fp" + GetHostPathQ(pch_file) + " -FI" + GetHostPathQ(pch_header);
|
||||
String pch_common = GetPathQ(pch_header) + " -Fp" + GetPathQ(pch_file) + " -FI" + GetPathQ(pch_header);
|
||||
|
||||
if(blitz) // enable MK__s macros
|
||||
pch_common.Cat(" -DBLITZ_INDEX__=FPCH");
|
||||
|
|
@ -318,9 +318,9 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
int pch_slot = AllocSlot();
|
||||
StringBuffer sb;
|
||||
sb << Join(cc, cpp_options) << Pdb(package, pch_slot, false) << " -Yc" << pch_common
|
||||
<< " -Tp " << GetHostPathQ(pch_header) << " -Fo" + GetHostPathQ(pch_obj);
|
||||
<< " -Tp " << GetPathQ(pch_header) << " -Fo" + GetPathQ(pch_obj);
|
||||
PutConsole("Precompiling header: " + GetFileName(pch_header));
|
||||
if(pch_slot < 0 || !Run(~sb, pch_slot, GetHostPath(pch_obj), 1))
|
||||
if(pch_slot < 0 || !Run(~sb, pch_slot, pch_obj, 1))
|
||||
error = true;
|
||||
Wait();
|
||||
}
|
||||
|
|
@ -336,8 +336,8 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
if(HasAnyDebug())
|
||||
c << Pdb(package, slot, false);
|
||||
if(slot < 0 ||
|
||||
!Run(c + " -Tp " + GetHostPathQ(b.path) + " -Fo" + GetHostPathQ(b.object),
|
||||
slot, GetHostPath(b.object), b.count))
|
||||
!Run(c + " -Tp " + GetPathQ(b.path) + " -Fo" + GetPathQ(b.object),
|
||||
slot, b.object, b.count))
|
||||
error = true;
|
||||
}
|
||||
|
||||
|
|
@ -362,9 +362,9 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
if(rc) {
|
||||
PutConsole(GetFileNamePos(fn));
|
||||
int slot = AllocSlot();
|
||||
if(slot < 0 || !Run("rc /fo" + GetHostPathQ(objfile) + Includes(" /i", package, pkg)
|
||||
if(slot < 0 || !Run("rc /fo" + GetPathQ(objfile) + Includes(" /i", package, pkg)
|
||||
+ DefinesTargetTime(" /d", package, pkg) + (HasFlag("DEBUG")?" /d_DEBUG":"")
|
||||
+ ' ' + GetHostPathQ(fn), slot, GetHostPath(objfile), 1))
|
||||
+ ' ' + GetPathQ(fn), slot, objfile, 1))
|
||||
execerr = true;
|
||||
}
|
||||
else
|
||||
|
|
@ -381,8 +381,8 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
int slot = AllocSlot();
|
||||
StringBuffer cmdline;
|
||||
cmdline << cc << Pdb(package, slot, false)
|
||||
<< " -Tc " << GetHostPathQ(tmpfile) << " -Fo" << GetHostPathQ(objfile);
|
||||
if(slot < 0 || !Run(String(cmdline), slot, GetHostPath(objfile), 1))
|
||||
<< " -Tc " << GetPathQ(tmpfile) << " -Fo" << GetPathQ(objfile);
|
||||
if(slot < 0 || !Run(String(cmdline), slot, objfile, 1))
|
||||
throw Exc(Format("Error compiling binary object '%s'.", objfile));
|
||||
}
|
||||
catch(Exc e) {
|
||||
|
|
@ -396,10 +396,10 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
if(HasAnyDebug())
|
||||
c << Pdb(package, slot, !sContainsPchOptions(cc) && !sContainsPchOptions(soptions[i]));
|
||||
c << " " + soptions[i] + (ext == ".c" ? Join(c_options, " -Tc") : Join(cpp_options, " -Tp")) + ' '
|
||||
+ GetHostPathQ(fn) + " -Fo" + GetHostPathQ(objfile);
|
||||
+ GetPathQ(fn) + " -Fo" + GetPathQ(objfile);
|
||||
if(nopch.Find(fn) < 0)
|
||||
c << pch_use;
|
||||
if(slot < 0 || !Run(c, slot, GetHostPath(objfile), 1))
|
||||
if(slot < 0 || !Run(c, slot, objfile, 1))
|
||||
execerr = true;
|
||||
}
|
||||
if(execerr)
|
||||
|
|
@ -495,8 +495,8 @@ bool MscBuilder::CreateLib(const String& product, const Vector<String>& obj,
|
|||
if(is_shared) {
|
||||
linker << LinkerName() << " -dll -nologo ";
|
||||
lib << "-machine:" << MachineName()
|
||||
<< " -pdb:" << GetHostPathQ(ForceExt(product, ".pdb"))
|
||||
<< " -out:" << GetHostPathQ(product);
|
||||
<< " -pdb:" << GetPathQ(ForceExt(product, ".pdb"))
|
||||
<< " -out:" << GetPathQ(product);
|
||||
if(!isgemsc10)
|
||||
lib << " -incremental:no";
|
||||
if(HasAnyDebug())
|
||||
|
|
@ -525,12 +525,12 @@ bool MscBuilder::CreateLib(const String& product, const Vector<String>& obj,
|
|||
PutConsole(Format("%s: error saving file", deffile));
|
||||
return false;
|
||||
}
|
||||
lib << " -def:" << GetHostPathQ(deffile);
|
||||
lib << " -def:" << GetPathQ(deffile);
|
||||
for(int i = 0; i < libpath.GetCount(); i++)
|
||||
lib << " -LIBPATH:" << GetHostPathQ(libpath[i]);
|
||||
lib << " -LIBPATH:" << GetPathQ(libpath[i]);
|
||||
lib << ' ' << link_options;
|
||||
for(int i = 0; i < all_uses.GetCount(); i++)
|
||||
lib << ' ' << GetHostPathQ(ForceExt(GetSharedLibPath(all_uses[i]), ".lib"));
|
||||
lib << ' ' << GetPathQ(ForceExt(GetSharedLibPath(all_uses[i]), ".lib"));
|
||||
for(int i = 0; i < all_libraries.GetCount(); i++) {
|
||||
String libfile = AppendExt(all_libraries[i], ".lib");
|
||||
if(!IsFullPath(libfile)) {
|
||||
|
|
@ -542,15 +542,15 @@ bool MscBuilder::CreateLib(const String& product, const Vector<String>& obj,
|
|||
}
|
||||
}
|
||||
}
|
||||
lib << ' ' << GetHostPathQ(libfile);
|
||||
lib << ' ' << GetPathQ(libfile);
|
||||
}
|
||||
}
|
||||
else{
|
||||
linker << (HasFlag("INTEL") ? "xilib" : "link /lib") << " -nologo ";
|
||||
lib << " -out:" << GetHostPathQ(product) << ' ' << link_options;
|
||||
lib << " -out:" << GetPathQ(product) << ' ' << link_options;
|
||||
}
|
||||
for(int i = 0; i < obj.GetCount(); i++)
|
||||
lib << ' ' << GetHostPathQ(obj[i]);
|
||||
lib << ' ' << GetPathQ(obj[i]);
|
||||
PutConsole("Creating library...");
|
||||
IdeConsoleEndGroup();
|
||||
DeleteFile(product);
|
||||
|
|
@ -595,7 +595,7 @@ bool MscBuilder::CreateLib(const String& product, const Vector<String>& obj,
|
|||
else
|
||||
if((IsMsc86() || IsMsc64()) && is_shared) {
|
||||
String mt("mt -nologo -manifest ");
|
||||
mt << GetHostPathQ(product) << ".manifest -outputresource:" << GetHostPathQ(product) << ";2";
|
||||
mt << GetPathQ(product) << ".manifest -outputresource:" << GetPathQ(product) << ";2";
|
||||
Execute(mt);
|
||||
}
|
||||
PutConsole(String().Cat() << product << " (" << GetFileInfo(product).length
|
||||
|
|
@ -626,8 +626,8 @@ bool MscBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
if(GetFileTime(linkfile[i]) > targettime) {
|
||||
String link, lib;
|
||||
link << LinkerName() << " -nologo -machine:" << MachineName()
|
||||
<< " -pdb:" << GetHostPathQ(ForceExt(target, ".pdb"))
|
||||
<< " -out:" << GetHostPathQ(target);
|
||||
<< " -pdb:" << GetPathQ(ForceExt(target, ".pdb"))
|
||||
<< " -out:" << GetPathQ(target);
|
||||
if(!isgemsc10)
|
||||
if(HasAnyDebug())
|
||||
link << " -incremental:yes -debug -OPT:NOREF";
|
||||
|
|
@ -656,7 +656,7 @@ bool MscBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
link << " -LIBPATH:\"" << libpath[i] << '\"';
|
||||
link << ' ' << linkoptions << ' ';
|
||||
for(i = 0; i < linkfile.GetCount(); i++)
|
||||
lib << ' ' << GetHostPathQ(AppendExt(linkfile[i], ".lib"));
|
||||
lib << ' ' << GetPathQ(AppendExt(linkfile[i], ".lib"));
|
||||
PutConsole("Linking...");
|
||||
bool error = false;
|
||||
|
||||
|
|
@ -697,11 +697,11 @@ bool MscBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
CustomStep(".post-link", Null, error);
|
||||
if((IsMsc86() || IsMsc64()) && HasFlag("SHARED")) {
|
||||
String mt("mt -nologo -manifest ");
|
||||
mt << GetHostPathQ(target) << ".manifest -outputresource:" << GetHostPathQ(target)
|
||||
mt << GetPathQ(target) << ".manifest -outputresource:" << GetPathQ(target)
|
||||
<< (HasFlag("DLL") ? ";2" : ";1");
|
||||
Execute(mt);
|
||||
}
|
||||
PutConsole(String().Cat() << GetHostPath(target) << " (" << GetFileInfo(target).length
|
||||
PutConsole(String().Cat() << target << " (" << GetFileInfo(target).length
|
||||
<< " B) linked in " << GetPrintTime(time));
|
||||
}
|
||||
else {
|
||||
|
|
@ -712,7 +712,7 @@ bool MscBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
FileDelete(tmpFileName);
|
||||
return !error;
|
||||
}
|
||||
PutConsole(String().Cat() << GetHostPath(target) << " (" << GetFileInfo(target).length
|
||||
PutConsole(String().Cat() << target << " (" << GetFileInfo(target).length
|
||||
<< " B) is up to date.");
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,12 +79,12 @@ void ScriptBuilder::CheckParse()
|
|||
EscValue inclist;
|
||||
inclist.SetEmptyArray();
|
||||
for(int i = 0; i < include.GetCount(); i++)
|
||||
inclist.ArrayAdd(GetHostPathQ(include[i]));
|
||||
inclist.ArrayAdd(GetPathQ(include[i]));
|
||||
globals.GetAdd("INCLUDE") = inclist;
|
||||
EscValue liblist;
|
||||
liblist.SetEmptyArray();
|
||||
for(int i = 0; i < libpath.GetCount(); i++)
|
||||
liblist.ArrayAdd(GetHostPathQ(libpath[i]));
|
||||
liblist.ArrayAdd(GetPathQ(libpath[i]));
|
||||
globals.GetAdd("LIBPATH") = liblist;
|
||||
|
||||
try
|
||||
|
|
@ -156,7 +156,7 @@ bool ScriptBuilder::BuildPackage(const String& package, Vector<String>& linkfile
|
|||
if(b.build) {
|
||||
PutConsole("BLITZ:" + b.info);
|
||||
int time = msecs();
|
||||
if(Execute(cc + " " + GetHostPathQ(b.path) + " -o " + GetHostPathQ(b.object)) == 0)
|
||||
if(Execute(cc + " " + GetPathQ(b.path) + " -o " + GetPathQ(b.object)) == 0)
|
||||
PutCompileTime(time, b.count);
|
||||
else
|
||||
error = true;
|
||||
|
|
@ -176,10 +176,10 @@ bool ScriptBuilder::BuildPackage(const String& package, Vector<String>& linkfile
|
|||
return false;
|
||||
if(IsNull(objfile))
|
||||
objfile = CatAnyPath(outdir, GetFileTitle(fn) + ".o");
|
||||
if(HdependFileTime(fn) > GetFileTime(GetHostPath(objfile))) {
|
||||
if(HdependFileTime(fn) > GetFileTime(objfile)) {
|
||||
PutConsole(GetFileName(fn));
|
||||
int time = msecs();
|
||||
if(!ExecuteIf("compile", GetHostPathQ(fn), GetHostPathQ(objfile), soptions[i]).GetNumber()) {
|
||||
if(!ExecuteIf("compile", GetPathQ(fn), GetPathQ(objfile), soptions[i]).GetNumber()) {
|
||||
DeleteFile(objfile);
|
||||
error = true;
|
||||
}
|
||||
|
|
@ -218,7 +218,7 @@ bool ScriptBuilder::BuildPackage(const String& package, Vector<String>& linkfile
|
|||
EscValue objlist;
|
||||
objlist.SetEmptyArray();
|
||||
for(int i = 0; i < obj.GetCount(); i++)
|
||||
objlist.ArrayAdd(GetHostPathQ(obj[i]));
|
||||
objlist.ArrayAdd(GetPathQ(obj[i]));
|
||||
if(!ExecuteIf("library", objlist, product).GetNumber()) {
|
||||
DeleteFile(product);
|
||||
error = true;
|
||||
|
|
@ -248,13 +248,13 @@ bool ScriptBuilder::Link(const Vector<String>& linkfile, const String& linkoptio
|
|||
liblist.SetEmptyArray();
|
||||
for(i = 0; i < linkfile.GetCount(); i++)
|
||||
if(*linkfile[i] == '*')
|
||||
liblist.ArrayAdd(GetHostPathQ(linkfile[i].Mid(1)));
|
||||
liblist.ArrayAdd(GetPathQ(linkfile[i].Mid(1)));
|
||||
else
|
||||
objlist.ArrayAdd(GetHostPathQ(linkfile[i]));
|
||||
objlist.ArrayAdd(GetPathQ(linkfile[i]));
|
||||
Vector<EscValue> linkargs;
|
||||
linkargs.Add(objlist);
|
||||
linkargs.Add(liblist);
|
||||
linkargs.Add(GetHostPathQ(target));
|
||||
linkargs.Add(GetPathQ(target));
|
||||
linkargs.Add(linkoptions);
|
||||
PutConsole("Linking...");
|
||||
bool error = false;
|
||||
|
|
@ -264,11 +264,11 @@ bool ScriptBuilder::Link(const Vector<String>& linkfile, const String& linkoptio
|
|||
return false;
|
||||
}
|
||||
CustomStep(".post-link", Null, error);
|
||||
PutConsole(String().Cat() << GetHostPath(target) << " (" << GetFileInfo(target).length
|
||||
PutConsole(String().Cat() << target << " (" << GetFileInfo(target).length
|
||||
<< " B) linked in " << GetPrintTime(time));
|
||||
return !error;
|
||||
}
|
||||
PutConsole(String().Cat() << GetHostPath(target) << " (" << GetFileInfo(target).length
|
||||
PutConsole(String().Cat() << target << " (" << GetFileInfo(target).length
|
||||
<< " B) is up to date.");
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,9 @@ bool CopyFolder(const char *dst, const char *src, Progress *pi = NULL);
|
|||
|
||||
bool HasSvn();
|
||||
bool HasGit();
|
||||
#ifdef PLATFORM_WIN32
|
||||
String GetInternalGitPath();
|
||||
#endif
|
||||
|
||||
int MaxAscent(Font f);
|
||||
|
||||
|
|
|
|||
|
|
@ -252,6 +252,31 @@ bool HasSvn()
|
|||
return b;
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
|
||||
String GetInternalGitPath()
|
||||
{
|
||||
return GetExeDirFile("bin/mingit/cmd/git.exe");
|
||||
}
|
||||
|
||||
bool HasGit()
|
||||
{
|
||||
String dummy;
|
||||
static bool b = FileExists(GetInternalGitPath()) || Sys("svn", dummy) >= 0;
|
||||
return b;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
bool HasGit()
|
||||
{
|
||||
String dummy;
|
||||
static bool b = Sys("svn", dummy) >= 0;
|
||||
return b;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int MaxAscent(Font f)
|
||||
{
|
||||
return max(f.GetAscent(), f().Bold().GetAscent(),
|
||||
|
|
|
|||
|
|
@ -5,11 +5,6 @@ void Builder::ChDir(const String& path)
|
|||
host->ChDir(path);
|
||||
}
|
||||
|
||||
String Builder::GetHostPath(const String& path) const
|
||||
{
|
||||
return host->GetHostPath(path);
|
||||
}
|
||||
|
||||
String TrimSlash(String s)
|
||||
{
|
||||
while(findarg(*s.Last(), '/', '\\') >= 0)
|
||||
|
|
@ -17,9 +12,9 @@ String TrimSlash(String s)
|
|||
return s;
|
||||
}
|
||||
|
||||
String Builder::GetHostPathQ(const String& path) const
|
||||
String Builder::GetPathQ(const String& path) const
|
||||
{
|
||||
return '\"' + TrimSlash(GetHostPath(path)) + '\"';
|
||||
return '\"' + TrimSlash(path) + '\"';
|
||||
}
|
||||
|
||||
Vector<Host::FileInfo> Builder::GetFileInfo(const Vector<String>& path) const
|
||||
|
|
@ -72,33 +67,3 @@ int Builder::Execute(const char *cl, Stream& out)
|
|||
{
|
||||
return host->Execute(CmdX(cl), out);
|
||||
}
|
||||
|
||||
void Builder::DeleteFile(const Vector<String>& path)
|
||||
{
|
||||
host->DeleteFile(path);
|
||||
}
|
||||
|
||||
void Builder::DeleteFile(const String& path)
|
||||
{
|
||||
host->DeleteFile(Vector<String>() << path);
|
||||
}
|
||||
|
||||
bool Builder::RealizeDir(const String& path)
|
||||
{
|
||||
return host->RealizeDir(path);
|
||||
}
|
||||
|
||||
bool Builder::SaveFile(const String& path, const String& data)
|
||||
{
|
||||
return host->SaveFile(path, data);
|
||||
}
|
||||
|
||||
String Builder::LoadFile(const String& path)
|
||||
{
|
||||
return host->LoadFile(path);
|
||||
}
|
||||
|
||||
bool Builder::FileExists(const String& path) const
|
||||
{
|
||||
return !IsNull(GetFileInfo(path).length);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -476,19 +476,12 @@ struct Builder {
|
|||
|
||||
// TODO: move other methods if needed
|
||||
void ChDir(const String& path);
|
||||
String GetHostPath(const String& path) const;
|
||||
String GetHostPathQ(const String& path) const;
|
||||
String GetPathQ(const String& path) const;
|
||||
Vector<Host::FileInfo> GetFileInfo(const Vector<String>& path) const;
|
||||
Host::FileInfo GetFileInfo(const String& path) const;
|
||||
Time GetFileTime(const String& path) const;
|
||||
int Execute(const char *cmdline);
|
||||
int Execute(const char *cl, Stream& out);
|
||||
void DeleteFile(const Vector<String>& path);
|
||||
void DeleteFile(const String& path);
|
||||
bool FileExists(const String& path) const;
|
||||
bool RealizeDir(const String& path);
|
||||
bool SaveFile(const String& path, const String& data);
|
||||
String LoadFile(const String& path);
|
||||
bool HasFlag(const char *f) const { return config.Find(f) >= 0; }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,40 +4,21 @@
|
|||
|
||||
#include <plugin/bz2/bz2.h>
|
||||
|
||||
LocalHost::LocalHost()
|
||||
Host::Host()
|
||||
{
|
||||
}
|
||||
|
||||
String LocalHost::GetEnvironment()
|
||||
String Host::GetEnvironment()
|
||||
{
|
||||
return environment;
|
||||
}
|
||||
|
||||
String LocalHost::GetHostPath(const String& path)
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
String LocalHost::GetLocalPath(const String& path)
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
String LocalHost::NormalizePath(const String& path)
|
||||
{
|
||||
return ::NormalizePath(path);
|
||||
}
|
||||
|
||||
String LocalHost::NormalizeExecutablePath(const String& path)
|
||||
{
|
||||
return NormalizeExePath(path);
|
||||
}
|
||||
|
||||
Vector<Host::FileInfo> LocalHost::GetFileInfo(const Vector<String>& path)
|
||||
Vector<Host::FileInfo> Host::GetFileInfo(const Vector<String>& path)
|
||||
{
|
||||
Vector<FileInfo> fi;
|
||||
for(int i = 0; i < path.GetCount(); i++) {
|
||||
FindFile ff(path[i]);
|
||||
|
||||
FileInfo& f = fi.Add();
|
||||
if(ff) {
|
||||
(Time&)f = ff.GetLastWriteTime();
|
||||
|
|
@ -47,22 +28,18 @@ Vector<Host::FileInfo> LocalHost::GetFileInfo(const Vector<String>& path)
|
|||
(Time&)f = Time::Low();
|
||||
f.length = Null;
|
||||
}
|
||||
|
||||
if(onefile.GetCount()) {
|
||||
if(path[i] == onefile)
|
||||
(Time &)f = GetSysTime();
|
||||
else
|
||||
(Time &)f = Time::Low();
|
||||
}
|
||||
}
|
||||
return fi;
|
||||
}
|
||||
|
||||
void LocalHost::DeleteFile(const Vector<String>& path)
|
||||
{
|
||||
for(int i = 0; i < path.GetCount(); i++)
|
||||
::DeleteFile(path[i]);
|
||||
}
|
||||
|
||||
void LocalHost::DeleteFolderDeep(const String& folder)
|
||||
{
|
||||
::DeleteFolderDeep(folder);
|
||||
}
|
||||
|
||||
void LocalHost::ChDir(const String& path)
|
||||
void Host::ChDir(const String& path)
|
||||
{
|
||||
#ifdef PLATFORM_WIN32
|
||||
SetCurrentDirectory(path);
|
||||
|
|
@ -71,10 +48,10 @@ void LocalHost::ChDir(const String& path)
|
|||
IGNORE_RESULT( chdir(path) );
|
||||
#endif
|
||||
if(cmdout)
|
||||
*cmdout << "cd \"" << GetHostPath(path) << "\"\n";
|
||||
*cmdout << "cd \"" << path << "\"\n";
|
||||
}
|
||||
|
||||
void LocalHost::DoDir(const String& dir)
|
||||
void Host::DoDir(const String& dir)
|
||||
{
|
||||
if(dir.GetLength() > 3) {
|
||||
DoDir(GetFileFolder(dir));
|
||||
|
|
@ -82,7 +59,7 @@ void LocalHost::DoDir(const String& dir)
|
|||
}
|
||||
}
|
||||
|
||||
bool LocalHost::RealizeDir(const String& path)
|
||||
bool Host::RealizeDir(const String& path)
|
||||
{
|
||||
bool realized = RealizeDirectory(path);
|
||||
if(cmdout)
|
||||
|
|
@ -90,17 +67,7 @@ bool LocalHost::RealizeDir(const String& path)
|
|||
return realized;
|
||||
}
|
||||
|
||||
bool LocalHost::SaveFile(const String& path, const String& data)
|
||||
{
|
||||
return ::SaveFile(path, data);
|
||||
}
|
||||
|
||||
String LocalHost::LoadFile(const String& path)
|
||||
{
|
||||
return ::LoadFile(path);
|
||||
}
|
||||
|
||||
int LocalHost::Execute(const char *cmdline)
|
||||
int Host::Execute(const char *cmdline)
|
||||
{
|
||||
if(cmdout)
|
||||
*cmdout << cmdline << '\n';
|
||||
|
|
@ -110,7 +77,7 @@ int LocalHost::Execute(const char *cmdline)
|
|||
return q;
|
||||
}
|
||||
|
||||
int LocalHost::ExecuteWithInput(const char *cmdline, bool noconvert)
|
||||
int Host::ExecuteWithInput(const char *cmdline, bool noconvert)
|
||||
{
|
||||
if(cmdout)
|
||||
*cmdout << cmdline << '\n';
|
||||
|
|
@ -120,7 +87,7 @@ int LocalHost::ExecuteWithInput(const char *cmdline, bool noconvert)
|
|||
return q;
|
||||
}
|
||||
|
||||
int LocalHost::Execute(const char *cmdline, Stream& out, bool noconvert)
|
||||
int Host::Execute(const char *cmdline, Stream& out, bool noconvert)
|
||||
{
|
||||
PutVerbose(cmdline);
|
||||
int q = IdeConsoleExecute(FindCommand(exedirs, cmdline), &out, environment, true, noconvert);
|
||||
|
|
@ -128,47 +95,46 @@ int LocalHost::Execute(const char *cmdline, Stream& out, bool noconvert)
|
|||
return q;
|
||||
}
|
||||
|
||||
int LocalHost::AllocSlot()
|
||||
int Host::AllocSlot()
|
||||
{
|
||||
return IdeConsoleAllocSlot();
|
||||
}
|
||||
|
||||
bool LocalHost::Run(const char *cmdline, int slot, String key, int blitz_count)
|
||||
bool Host::Run(const char *cmdline, int slot, String key, int blitz_count)
|
||||
{
|
||||
return IdeConsoleRun(FindCommand(exedirs, cmdline), NULL, environment, false, slot, key, blitz_count);
|
||||
}
|
||||
|
||||
bool LocalHost::Run(const char *cmdline, Stream& out, int slot, String key, int blitz_count)
|
||||
bool Host::Run(const char *cmdline, Stream& out, int slot, String key, int blitz_count)
|
||||
{
|
||||
return IdeConsoleRun(FindCommand(exedirs, cmdline), &out, environment, true, slot, key, blitz_count);
|
||||
}
|
||||
|
||||
bool LocalHost::Wait()
|
||||
bool Host::Wait()
|
||||
{
|
||||
return IdeConsoleWait();
|
||||
}
|
||||
|
||||
bool LocalHost::Wait(int slot)
|
||||
bool Host::Wait(int slot)
|
||||
{
|
||||
return IdeConsoleWait(slot);
|
||||
}
|
||||
|
||||
void LocalHost::OnFinish(Event<> cb)
|
||||
void Host::OnFinish(Event<> cb)
|
||||
{
|
||||
IdeConsoleOnFinish(cb);
|
||||
}
|
||||
|
||||
One<AProcess> LocalHost::StartProcess(const char *cmdline)
|
||||
bool Host::StartProcess(LocalProcess& p, const char *cmdline)
|
||||
{
|
||||
try {
|
||||
PutVerbose(cmdline);
|
||||
One<AProcess> p;
|
||||
if(p.Create<LocalProcess>().Start(FindCommand(exedirs, cmdline), environment))
|
||||
return p;
|
||||
if(p.Start(FindCommand(exedirs, cmdline), environment))
|
||||
return true;
|
||||
}
|
||||
catch(...) {
|
||||
}
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_POSIX
|
||||
|
|
@ -201,7 +167,7 @@ String HostConsole = "powershell.exe";
|
|||
String HostConsole = "/usr/bin/xterm -e";
|
||||
#endif
|
||||
|
||||
void LocalHost::Launch(const char *_cmdline, bool console)
|
||||
void Host::Launch(const char *_cmdline, bool console)
|
||||
{
|
||||
String cmdline = FindCommand(exedirs, _cmdline);
|
||||
PutVerbose(cmdline);
|
||||
|
|
@ -319,7 +285,7 @@ void LocalHost::Launch(const char *_cmdline, bool console)
|
|||
#endif
|
||||
}
|
||||
|
||||
void LocalHost::AddFlags(Index<String>& cfg)
|
||||
void Host::AddFlags(Index<String>& cfg)
|
||||
{
|
||||
if(HasPlatformFlag(cfg))
|
||||
return;
|
||||
|
|
@ -373,12 +339,12 @@ void LocalHost::AddFlags(Index<String>& cfg)
|
|||
#endif
|
||||
}
|
||||
|
||||
const Vector<String>& LocalHost::GetExecutablesDirs() const
|
||||
const Vector<String>& Host::GetExecutablesDirs() const
|
||||
{
|
||||
return exedirs;
|
||||
}
|
||||
|
||||
bool LocalHost::HasPlatformFlag(const Index<String>& cfg)
|
||||
bool Host::HasPlatformFlag(const Index<String>& cfg)
|
||||
{
|
||||
static const Index<String> platformFlags = {
|
||||
"WIN32", "POSIX", "LINUX", "ANDROID",
|
||||
|
|
@ -392,13 +358,3 @@ bool LocalHost::HasPlatformFlag(const Index<String>& cfg)
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static bool IsSamePath(const char *a, const char *b, int count) {
|
||||
for(; --count >= 0; a++, b++)
|
||||
if(a != b && ToLower(*a) != ToLower(*b) && !((*a == '\\' || *a == '/') && (*b == '\\' || *b == '/')))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2,119 +2,43 @@ enum { REMOTE_TIMEOUT = 2000 };
|
|||
|
||||
extern String HostConsole;
|
||||
|
||||
class Host {
|
||||
public:
|
||||
virtual ~Host() {}
|
||||
|
||||
struct Host : LocalProcess {
|
||||
struct FileInfo : Time, Moveable<FileInfo> {
|
||||
int length;
|
||||
};
|
||||
|
||||
virtual String GetEnvironment() = 0;
|
||||
virtual String GetHostPath(const String& path) = 0;
|
||||
virtual String GetLocalPath(const String& path) = 0;
|
||||
virtual String NormalizePath(const String& path) = 0;
|
||||
virtual String NormalizeExecutablePath(const String& path) = 0;
|
||||
virtual Vector<FileInfo> GetFileInfo(const Vector<String>& path) = 0;
|
||||
virtual void DeleteFile(const Vector<String>& path) = 0;
|
||||
virtual void DeleteFolderDeep(const String& dir) = 0;
|
||||
virtual void ChDir(const String& path) = 0;
|
||||
virtual bool RealizeDir(const String& path) = 0;
|
||||
virtual bool SaveFile(const String& path, const String& data) = 0;
|
||||
virtual String LoadFile(const String& path) = 0;
|
||||
virtual int Execute(const char *cmdline) = 0;
|
||||
virtual int ExecuteWithInput(const char *cmdline, bool noconvert) = 0;
|
||||
virtual int Execute(const char *cmdline, Stream& out, bool noconvert = false) = 0;
|
||||
virtual int AllocSlot() = 0;
|
||||
virtual bool Run(const char *cmdline, int slot, String key, int blitz_count) = 0;
|
||||
virtual bool Run(const char *cmdline, Stream& out, int slot, String key, int blitz_count) = 0;
|
||||
virtual bool Wait() = 0;
|
||||
virtual bool Wait(int slot) = 0;
|
||||
virtual void OnFinish(Event<> cb) = 0;
|
||||
virtual One<AProcess> StartProcess(const char *cmdline) = 0;
|
||||
virtual void Launch(const char *cmdline, bool console = false) = 0;
|
||||
virtual void AddFlags(Index<String>& cfg) = 0;
|
||||
|
||||
virtual const Vector<String>& GetExecutablesDirs() const = 0;
|
||||
};
|
||||
|
||||
class LocalHost : public Host {
|
||||
public:
|
||||
Vector<String> exedirs;
|
||||
String environment;
|
||||
|
||||
String *cmdout;
|
||||
|
||||
String onefile; // support for Ctrl+F7 - build single file
|
||||
|
||||
void DoDir(const String& s);
|
||||
|
||||
public: /* Host */
|
||||
LocalHost();
|
||||
Host();
|
||||
|
||||
String GetEnvironment() override;
|
||||
String GetHostPath(const String& path) override;
|
||||
String GetLocalPath(const String& path) override;
|
||||
String NormalizePath(const String& path) override;
|
||||
String NormalizeExecutablePath(const String& path) override;
|
||||
Vector<FileInfo> GetFileInfo(const Vector<String>& path) override;
|
||||
void DeleteFile(const Vector<String>& path) override;
|
||||
void DeleteFolderDeep(const String& dir) override;
|
||||
void ChDir(const String& path) override;
|
||||
bool RealizeDir(const String& path) override;
|
||||
bool SaveFile(const String& path, const String& data) override;
|
||||
String LoadFile(const String& path) override;
|
||||
int Execute(const char *cmdline) override;
|
||||
int ExecuteWithInput(const char *cmdline, bool noconvert) override;
|
||||
int Execute(const char *cmdline, Stream& out, bool noconvert = false) override;
|
||||
int AllocSlot() override;
|
||||
bool Run(const char *cmdline, int slot, String key, int blitz_count) override;
|
||||
bool Run(const char *cmdline, Stream& out, int slot, String key, int blitz_count) override;
|
||||
bool Wait() override;
|
||||
bool Wait(int slot) override;
|
||||
void OnFinish(Event<> cb) override;
|
||||
One<AProcess> StartProcess(const char *cmdline) override;
|
||||
void Launch(const char *cmdline, bool console) override;
|
||||
void AddFlags(Index<String>& cfg) override;
|
||||
String GetEnvironment();
|
||||
Vector<FileInfo> GetFileInfo(const Vector<String>& path);
|
||||
|
||||
void ChDir(const String& path);
|
||||
bool RealizeDir(const String& path);
|
||||
|
||||
int Execute(const char *cmdline);
|
||||
int ExecuteWithInput(const char *cmdline, bool noconvert);
|
||||
int Execute(const char *cmdline, Stream& out, bool noconvert = false);
|
||||
int AllocSlot();
|
||||
bool Run(const char *cmdline, int slot, String key, int blitz_count);
|
||||
bool Run(const char *cmdline, Stream& out, int slot, String key, int blitz_count);
|
||||
bool Wait();
|
||||
bool Wait(int slot);
|
||||
void OnFinish(Event<> cb);
|
||||
bool StartProcess(LocalProcess& p, const char *cmdline);
|
||||
void Launch(const char *cmdline, bool console = false);
|
||||
void AddFlags(Index<String>& cfg);
|
||||
|
||||
const Vector<String>& GetExecutablesDirs() const override;
|
||||
const Vector<String>& GetExecutablesDirs() const;
|
||||
|
||||
private:
|
||||
bool HasPlatformFlag(const Index<String>& cfg);
|
||||
};
|
||||
|
||||
/*
|
||||
struct RemoteHost : Host {
|
||||
String host;
|
||||
int port;
|
||||
String os_type;
|
||||
// bool transfer_files;
|
||||
Vector<String> path_map_local;
|
||||
Vector<String> path_map_remote;
|
||||
String chdir_path;
|
||||
String environment;
|
||||
|
||||
static Time TimeBase() { return Time(2000, 1, 1); }
|
||||
|
||||
virtual String GetEnvironment();
|
||||
virtual String GetHostPath(const String& path);
|
||||
virtual String GetLocalPath(const String& path);
|
||||
virtual String NormalizePath(const String& path);
|
||||
virtual Vector<FileInfo> GetFileInfo(const Vector<String>& path);
|
||||
virtual void DeleteFile(const Vector<String>& path);
|
||||
virtual void DeleteFolderDeep(const String& dir);
|
||||
virtual void ChDir(const String& path);
|
||||
virtual void RealizeDir(const String& path);
|
||||
virtual void SaveFile(const String& path, const String& data);
|
||||
virtual String LoadFile(const String& path);
|
||||
virtual int Execute(const char *cmdline);
|
||||
virtual int ExecuteWithInput(const char *cmdline);
|
||||
virtual int Execute(const char *cmdline, Stream& out);
|
||||
virtual int AllocSlot();
|
||||
virtual bool Run(const char *cmdline, int slot, String key, int blitz_count);
|
||||
virtual bool Run(const char *cmdline, Stream& out, int slot, String key, int blitz_count);
|
||||
virtual bool Wait();
|
||||
virtual One<AProcess> StartProcess(const char *cmdline);
|
||||
virtual void Launch(const char *cmdline, bool console);
|
||||
virtual void AddFlags(Index<String>& cfg);
|
||||
|
||||
String RemoteExec(String cmd);
|
||||
};
|
||||
*/
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
#include "urepo.h"
|
||||
|
||||
namespace Upp {
|
||||
#include "ide.h"
|
||||
|
||||
String GetSvnDir(const String& p)
|
||||
{
|
||||
|
|
@ -81,5 +79,3 @@ void EditCredentials(RepoSync& rs)
|
|||
dlg.GetResults();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -105,14 +105,13 @@ void Ide::RunArgs() {
|
|||
}
|
||||
}
|
||||
|
||||
One<Host> Ide::CreateHostRunDir()
|
||||
void Ide::CreateHostRunDir(Host& h)
|
||||
{
|
||||
One<Host> h = CreateHost(darkmode, disable_uhd);
|
||||
CreateHost(h, darkmode, disable_uhd);
|
||||
if(IsNull(rundir))
|
||||
h->ChDir(GetFileFolder(target));
|
||||
h.ChDir(GetFileFolder(target));
|
||||
else
|
||||
h->ChDir(rundir);
|
||||
return h;
|
||||
h.ChDir(rundir);
|
||||
}
|
||||
|
||||
bool Ide::ShouldHaveConsole()
|
||||
|
|
@ -135,24 +134,25 @@ void Ide::BuildAndExecute()
|
|||
void Ide::ExecuteBinary()
|
||||
{
|
||||
int time = msecs();
|
||||
One<Host> h = CreateHostRunDir();
|
||||
h->ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
Host h;
|
||||
CreateHostRunDir(h);
|
||||
h.ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
String cmdline;
|
||||
if(!runexternal)
|
||||
cmdline << '\"' << h->GetHostPath(target) << "\" ";
|
||||
cmdline << '\"' << target << "\" ";
|
||||
cmdline << ToSystemCharset(runarg);
|
||||
|
||||
int exitcode;
|
||||
switch(runmode) {
|
||||
case RUN_WINDOW:
|
||||
HideBottom();
|
||||
h->Launch(cmdline, ShouldHaveConsole());
|
||||
h.Launch(cmdline, ShouldHaveConsole());
|
||||
break;
|
||||
case RUN_CONSOLE:
|
||||
ShowConsole();
|
||||
PutConsole(String().Cat() << "Executing: " << cmdline);
|
||||
console.Sync();
|
||||
exitcode = h->ExecuteWithInput(cmdline, console_utf8);
|
||||
exitcode = h.ExecuteWithInput(cmdline, console_utf8);
|
||||
PutConsole("Finished in " + GetPrintTime(time) + ", exit code: " + AsString(exitcode));
|
||||
break;
|
||||
case RUN_FILE: {
|
||||
|
|
@ -167,7 +167,7 @@ void Ide::ExecuteBinary()
|
|||
PromptOK("Unable to open output file [* " + DeQtf(stdout_file) + "] !");
|
||||
return;
|
||||
}
|
||||
if(h->Execute(cmdline, out, console_utf8) >= 0) {
|
||||
if(h.Execute(cmdline, out, console_utf8) >= 0) {
|
||||
out.Close();
|
||||
EditFile(fn);
|
||||
}
|
||||
|
|
@ -177,16 +177,17 @@ void Ide::ExecuteBinary()
|
|||
|
||||
void Ide::LaunchTerminal(const char *dir)
|
||||
{
|
||||
One<Host> h = CreateHost(false, false);
|
||||
h->ChDir(dir);
|
||||
Host h;
|
||||
CreateHost(h, false, false);
|
||||
h.ChDir(dir);
|
||||
#ifdef PLATFORM_WIN32
|
||||
h->Launch(Nvl(HostConsole, "powershell.exe"), false);
|
||||
h.Launch(Nvl(HostConsole, "powershell.exe"), false);
|
||||
#else
|
||||
String c = HostConsole;
|
||||
int q = c.Find(' ');
|
||||
if(q >= 0)
|
||||
c.Trim(q);
|
||||
h->Launch(Nvl(c, "/usr/bin/xterm"), false);
|
||||
h.Launch(Nvl(c, "/usr/bin/xterm"), false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -260,27 +261,29 @@ void Ide::ExecuteApk()
|
|||
if(!select.GetDeviceCount())
|
||||
return;
|
||||
|
||||
One<Host> host = CreateHost(darkmode, disable_uhd);
|
||||
Host host;
|
||||
CreateHost(host, darkmode, disable_uhd);
|
||||
Apk apk(target, sdk);
|
||||
String packageName = apk.FindPackageName();
|
||||
String activityName = apk.FindLaunchableActivity();
|
||||
|
||||
Adb adb = sdk.MakeAdb();
|
||||
adb.SetSerial(select.GetSelectedSerial());
|
||||
host->Execute(adb.MakeInstallCmd(target));
|
||||
host.Execute(adb.MakeInstallCmd(target));
|
||||
|
||||
if(!packageName.IsEmpty() && !activityName.IsEmpty())
|
||||
host->Execute(adb.MakeLaunchOnDeviceCmd(packageName, activityName));
|
||||
host.Execute(adb.MakeLaunchOnDeviceCmd(packageName, activityName));
|
||||
}
|
||||
|
||||
void Ide::BuildAndDebug0(const String& srcfile)
|
||||
{
|
||||
if(Build()) {
|
||||
One<Host> h = CreateHostRunDir();
|
||||
h->ChDir(GetFileFolder(target));
|
||||
Host h;
|
||||
CreateHostRunDir(h);
|
||||
h.ChDir(GetFileFolder(target));
|
||||
VectorMap<String, String> bm = GetMethodVars(method);
|
||||
String dbg = Nvl(bm.Get("DEBUGGER", Null), "gdb");
|
||||
h->Launch('\"' + dbg + "\" \"" + h->GetHostPath(target) + "\"", true);
|
||||
h.Launch('\"' + dbg + "\" \"" + target + "\"", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -294,10 +297,10 @@ void Ide::BuildAndExtDebugFile()
|
|||
BuildAndDebug0(editfile);
|
||||
}
|
||||
|
||||
One<Debugger> GdbCreate(One<Host>&& host, const String& exefile, const String& cmdline, bool console);
|
||||
One<Debugger> GdbCreate(Host& host, const String& exefile, const String& cmdline, bool console);
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
One<Debugger> PdbCreate(One<Host>&& host, const String& exefile, const String& cmdline, bool clang);
|
||||
One<Debugger> PdbCreate(Host& host, const String& exefile, const String& cmdline, bool clang);
|
||||
#endif
|
||||
|
||||
void Ide::BuildAndDebug(bool runto)
|
||||
|
|
@ -317,8 +320,9 @@ void Ide::BuildAndDebug(bool runto)
|
|||
return;
|
||||
if(designer && !editfile_isfolder)
|
||||
EditAsText();
|
||||
One<Host> host = CreateHostRunDir();
|
||||
host->ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
Host host;
|
||||
CreateHostRunDir(host);
|
||||
host.ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
HideBottom();
|
||||
editor.Disable();
|
||||
|
||||
|
|
@ -326,10 +330,10 @@ void Ide::BuildAndDebug(bool runto)
|
|||
|
||||
#ifdef PLATFORM_WIN32
|
||||
if(findarg(builder, "GCC") < 0) // llvm-mingw can generate pdb symbolic info
|
||||
debugger = PdbCreate(pick(host), target, runarg, builder == "CLANG");
|
||||
debugger = PdbCreate(host, target, runarg, builder == "CLANG");
|
||||
else
|
||||
#endif
|
||||
debugger = GdbCreate(pick(host), target, runarg, console);
|
||||
debugger = GdbCreate(host, target, runarg, console);
|
||||
|
||||
if(!debugger) {
|
||||
IdeEndDebug();
|
||||
|
|
@ -426,9 +430,11 @@ void Ide::ConditionalBreak()
|
|||
String brk = editor.GetBreakpoint(ln);
|
||||
if(brk == "\xe")
|
||||
brk = "1";
|
||||
|
||||
Index<String> cfg = PackageConfig(IdeWorkspace(), 0, GetMethodVars(method), mainconfigparam,
|
||||
*CreateHost(darkmode, disable_uhd), *CreateBuilder(~CreateHostRunDir()));
|
||||
|
||||
Host h;
|
||||
CreateHost(h, darkmode, disable_uhd);
|
||||
Index<String> cfg = PackageConfig(IdeWorkspace(), 0, GetMethodVars(method), mainconfigparam, h,
|
||||
*CreateBuilder(&h));
|
||||
#ifdef PLATFORM_WIN32
|
||||
if(cfg.Find("MSC") >= 0) {
|
||||
if(EditPDBExpression("Conditional breakpoint", brk, NULL))
|
||||
|
|
|
|||
|
|
@ -136,9 +136,9 @@ int CharFilterReSlash(int c)
|
|||
return c == '\\' ? '/' : c;
|
||||
}
|
||||
|
||||
String Bpoint(Host& host, const String& file, int line)
|
||||
String Bpoint(const String& file, int line)
|
||||
{
|
||||
return String().Cat() << Filter(host.GetHostPath(NormalizePath(file)), CharFilterReSlash) << ":" << line + 1;
|
||||
return String().Cat() << Filter(NormalizePath(file), CharFilterReSlash) << ":" << line + 1;
|
||||
}
|
||||
|
||||
bool Gdb::TryBreak(const char *text)
|
||||
|
|
@ -156,7 +156,7 @@ bool Gdb::SetBreakpoint(const String& filename, int line, const String& bp)
|
|||
return true;
|
||||
}
|
||||
|
||||
String bi = Bpoint(*host, filename, line);
|
||||
String bi = Bpoint(filename, line);
|
||||
|
||||
String command;
|
||||
if(bp.IsEmpty())
|
||||
|
|
@ -230,7 +230,7 @@ bool ParsePos(const String& s, String& fn, int& line, adr_t & adr)
|
|||
|
||||
void Gdb::CheckEnd(const char *s)
|
||||
{
|
||||
if(!dbg) {
|
||||
if(!dbg.IsRunning()) {
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
|
@ -270,9 +270,9 @@ String Gdb::Cmdp(const char *cmdline, bool fr, bool setframe)
|
|||
}
|
||||
|
||||
if(ParsePos(s, file, line, addr)) {
|
||||
IdeSetDebugPos(GetLocalPath(file), line - 1, fr ? DbgImg::FrameLinePtr()
|
||||
: DbgImg::IpLinePtr(), 0);
|
||||
IdeSetDebugPos(GetLocalPath(file), line - 1,
|
||||
IdeSetDebugPos(file, line - 1, fr ? DbgImg::FrameLinePtr()
|
||||
: DbgImg::IpLinePtr(), 0);
|
||||
IdeSetDebugPos(file, line - 1,
|
||||
disas.HasFocus() ? fr ? DbgImg::FrameLinePtr() : DbgImg::IpLinePtr()
|
||||
: Image(), 1);
|
||||
SyncDisas(fr);
|
||||
|
|
@ -303,7 +303,7 @@ String Gdb::Cmdp(const char *cmdline, bool fr, bool setframe)
|
|||
SyncFrameButtons();
|
||||
}
|
||||
|
||||
if (dbg->IsRunning()) {
|
||||
if (dbg.IsRunning()) {
|
||||
if (IsProcessExitedNormally(s))
|
||||
Stop();
|
||||
else {
|
||||
|
|
@ -430,7 +430,7 @@ bool Gdb::RunTo()
|
|||
bi = Sprintf("*0x%X", disas.GetCursor());
|
||||
}
|
||||
else
|
||||
bi = Bpoint(*host, IdeGetFileName(), IdeGetFileLine());
|
||||
bi = Bpoint(IdeGetFileName(), IdeGetFileLine());
|
||||
if(!TryBreak("b " + bi)) {
|
||||
Exclamation("No code at chosen location!");
|
||||
return false;
|
||||
|
|
@ -593,14 +593,11 @@ bool Gdb::Key(dword key, int count)
|
|||
return Ctrl::Key(key, count);
|
||||
}
|
||||
|
||||
bool Gdb::Create(One<Host>&& _host, const String& exefile, const String& cmdline, bool console)
|
||||
bool Gdb::Create(Host& host, const String& exefile, const String& cmdline, bool console)
|
||||
{
|
||||
host = pick(_host);
|
||||
|
||||
String gdb_command = GdbCommand(console) + host->NormalizeExecutablePath(exefile);
|
||||
dbg = host->StartProcess(gdb_command);
|
||||
String gdb_command = GdbCommand(console) + NormalizeExePath(exefile);
|
||||
|
||||
if (!dbg) {
|
||||
if(!host.StartProcess(dbg, gdb_command)) {
|
||||
Loge() << METHOD_NAME << "Failed to launch gdb (\"" << gdb_command << "\").";
|
||||
|
||||
ErrorOK("Error while invoking gdb! For details check TheIDE logs.");
|
||||
|
|
@ -780,10 +777,10 @@ Gdb::Gdb()
|
|||
pane.Add(nodebuginfo_bg);
|
||||
}
|
||||
|
||||
One<Debugger> GdbCreate(One<Host>&& host, const String& exefile, const String& cmdline, bool console)
|
||||
One<Debugger> GdbCreate(Host& host, const String& exefile, const String& cmdline, bool console)
|
||||
{
|
||||
auto dbg = MakeOne<Gdb>();
|
||||
if(!dbg->Create(pick(host), exefile, cmdline, console))
|
||||
if(!dbg->Create(host, exefile, cmdline, console))
|
||||
return nullptr;
|
||||
return pick(dbg); // CLANG does not like this without pick
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,6 @@ public:
|
|||
|
||||
void AddReg(const char *reg, Label *lbl) { regname.Add(reg); reglbl.Add(lbl); }
|
||||
|
||||
String GetHostPath(const String& path) { return host->GetHostPath(path); }
|
||||
String GetLocalPath(const String& path) { return host->GetLocalPath(path); }
|
||||
|
||||
void Lock();
|
||||
void Unlock();
|
||||
|
||||
|
|
@ -94,7 +91,7 @@ public:
|
|||
|
||||
void BreakRunning();
|
||||
|
||||
bool Create(One<Host>&& host, const String& exefile, const String& cmdline, bool console);
|
||||
bool Create(Host& host, const String& exefile, const String& cmdline, bool console);
|
||||
|
||||
TimeCallback periodic; // Period check for killed console
|
||||
void Periodic();
|
||||
|
|
@ -105,8 +102,7 @@ public:
|
|||
Gdb();
|
||||
|
||||
protected:
|
||||
One<Host> host;
|
||||
One<AProcess> dbg;
|
||||
LocalProcess dbg;
|
||||
|
||||
Vector<String> regname;
|
||||
Vector<Label *> reglbl;
|
||||
|
|
|
|||
|
|
@ -115,22 +115,22 @@ bool Gdb::Result(String& result, const String& s)
|
|||
|
||||
String Gdb::Cmd(const char *command, bool start)
|
||||
{
|
||||
if(!dbg || !dbg->IsRunning() || IdeIsDebugLock()) return Null;
|
||||
if(!dbg.IsRunning() || IdeIsDebugLock()) return Null;
|
||||
TimeStop ts;
|
||||
Lock();
|
||||
if(command) {
|
||||
LLOG("========= Cmd: " << command);
|
||||
dbg->Write(String(command) + "\n");
|
||||
dbg.Write(String(command) + "\n");
|
||||
PutVerbose(String() << "Command: " << command);
|
||||
}
|
||||
String result;
|
||||
int ms0 = msecs();
|
||||
while(dbg) {
|
||||
while(dbg.IsRunning()) {
|
||||
String s;
|
||||
if(!dbg->Read(s)) {
|
||||
if(!dbg.Read(s)) {
|
||||
PutVerbose(result);
|
||||
PutVerbose("Debugger terminated");
|
||||
LLOG("Running: " << dbg->IsRunning());
|
||||
LLOG("Running: " << dbg.IsRunning());
|
||||
break;
|
||||
}
|
||||
if(!s.IsEmpty() && Result(result, s)) {
|
||||
|
|
@ -165,25 +165,25 @@ String Gdb::Cmd(const char *command, bool start)
|
|||
|
||||
String Gdb::FastCmd(const char *command)
|
||||
{
|
||||
if(!dbg || !dbg->IsRunning() || IdeIsDebugLock()) return Null;
|
||||
if(!dbg.IsRunning() || IdeIsDebugLock()) return Null;
|
||||
bool lock = false;
|
||||
if(command) {
|
||||
dbg->Write(String(command) + "\n");
|
||||
dbg.Write(String(command) + "\n");
|
||||
PutVerbose(String() << "Fast Command: " << command);
|
||||
}
|
||||
String result;
|
||||
TimeStop ts;
|
||||
while(dbg) {
|
||||
while(dbg.IsRunning()) {
|
||||
String s;
|
||||
if(TTYQuit()) {
|
||||
LLOG("TTYQuit");
|
||||
Stop();
|
||||
}
|
||||
if(!dbg->Read(s)) {
|
||||
if(!dbg.Read(s)) {
|
||||
LLOG(result);
|
||||
PutVerbose(result);
|
||||
PutVerbose("dbg terminated");
|
||||
LLOG("Running: " << dbg->IsRunning());
|
||||
LLOG("Running: " << dbg.IsRunning());
|
||||
break;
|
||||
}
|
||||
if(!s.IsEmpty() && Result(result, s)) {
|
||||
|
|
@ -217,11 +217,11 @@ String Gdb::FastCmd(const char *command)
|
|||
void Gdb::Stop()
|
||||
{
|
||||
LLOG("Stop");
|
||||
if(dbg && dbg->IsRunning())
|
||||
dbg->Kill();
|
||||
if(dbg.IsRunning())
|
||||
dbg.Kill();
|
||||
}
|
||||
|
||||
bool Gdb::IsFinished()
|
||||
{
|
||||
return !(dbg && dbg->IsRunning()) && !IdeIsDebugLock();
|
||||
return !dbg.IsRunning() && !IdeIsDebugLock();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ INITBLOCK
|
|||
RegisterGlobalConfig(CONFIGNAME);
|
||||
}
|
||||
|
||||
bool Pdb::Create(One<Host> local, const String& exefile, const String& cmdline, bool clang_)
|
||||
bool Pdb::Create(Host& local, const String& exefile, const String& cmdline, bool clang_)
|
||||
{
|
||||
STARTUPINFO si;
|
||||
ZeroMemory(&si, sizeof(STARTUPINFO));
|
||||
|
|
@ -164,8 +164,8 @@ bool Pdb::Create(One<Host> local, const String& exefile, const String& cmdline,
|
|||
memcpy(cmd, cl, cl.GetLength() + 1);
|
||||
PROCESS_INFORMATION pi;
|
||||
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
|
||||
Buffer<char> env(local->GetEnvironment().GetCount() + 1);
|
||||
memcpy(env, ~local->GetEnvironment(), local->GetEnvironment().GetCount() + 1);
|
||||
Buffer<char> env(local.environment.GetCount() + 1);
|
||||
memcpy(env, ~local.environment, local.environment.GetCount() + 1);
|
||||
bool h = CreateProcess(exefile, cmd, NULL, NULL, TRUE,
|
||||
/*NORMAL_PRIORITY_CLASS|CREATE_NEW_CONSOLE|*/DEBUG_ONLY_THIS_PROCESS/*|DEBUG_PROCESS*/,
|
||||
~env, NULL, &si, &pi);
|
||||
|
|
@ -457,10 +457,10 @@ Pdb::~Pdb()
|
|||
Stop();
|
||||
}
|
||||
|
||||
One<Debugger> PdbCreate(One<Host>&& host, const String& exefile, const String& cmdline, bool clang)
|
||||
One<Debugger> PdbCreate(Host& host, const String& exefile, const String& cmdline, bool clang)
|
||||
{
|
||||
One<Debugger> dbg;
|
||||
if(!dbg.Create<Pdb>().Create(pick(host), exefile, cmdline, clang))
|
||||
if(!dbg.Create<Pdb>().Create(host, exefile, cmdline, clang))
|
||||
dbg.Clear();
|
||||
return dbg;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -526,7 +526,7 @@ struct Pdb : Debugger, ParentCtrl {
|
|||
|
||||
void Tab();
|
||||
|
||||
bool Create(One<Host> local, const String& exefile, const String& cmdline, bool clang_);
|
||||
bool Create(Host& local, const String& exefile, const String& cmdline, bool clang_);
|
||||
|
||||
void SerializeSession(Stream& s);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
#include "urepo.h"
|
||||
|
||||
namespace Upp {
|
||||
#include "ide.h"
|
||||
|
||||
#define IMAGECLASS UrepoImg
|
||||
#define IMAGEFILE <urepo/urepo.iml>
|
||||
|
|
@ -132,5 +130,3 @@ void RunRepoDiff(const String& filepath)
|
|||
RepoDiff dlg;
|
||||
dlg.Execute(filepath);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -206,7 +206,8 @@ void Ide::FindPrevError() {
|
|||
return;
|
||||
int ln = console.GetLine(console.GetCursor());
|
||||
int l = ln;
|
||||
One<Host> host = CreateHost(false, disable_uhd);
|
||||
Host h;
|
||||
CreateHost(h, false, disable_uhd);
|
||||
for(l = ln - 2; l >= 0; l--)
|
||||
if(FindLineError(l)) return;
|
||||
for(l = console.GetLineCount() - 1; l > ln; l--)
|
||||
|
|
|
|||
|
|
@ -409,21 +409,23 @@ void Ide::MacroExecute(EscEscape& e)
|
|||
{
|
||||
int time = msecs();
|
||||
String cmdline = e[0];
|
||||
One<Host> h = CreateHostRunDir();
|
||||
h->ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
Host h;
|
||||
CreateHostRunDir(h);
|
||||
h.ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
ShowConsole();
|
||||
PutConsole(String().Cat() << "MacroExecute: " << cmdline);
|
||||
console.Sync();
|
||||
e = h->Execute(cmdline);
|
||||
e = h.Execute(cmdline);
|
||||
PutVerbose("Finished in " + GetPrintTime(time));
|
||||
}
|
||||
|
||||
void Ide::MacroLaunch(EscEscape& e)
|
||||
{
|
||||
String cmdline = e[0];
|
||||
One<Host> h = CreateHostRunDir();
|
||||
h->ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
h->Launch(cmdline);
|
||||
Host h;
|
||||
CreateHostRunDir(h);
|
||||
h.ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
h.Launch(cmdline);
|
||||
}
|
||||
|
||||
void Ide::MacroClearConsole(EscEscape& e)
|
||||
|
|
|
|||
|
|
@ -871,7 +871,7 @@ String Ide::GetIncludePath()
|
|||
}
|
||||
|
||||
const Workspace& wspc = GetIdeWorkspace();
|
||||
LocalHost dummy_host;
|
||||
Host dummy_host;
|
||||
One<Builder> b = CreateBuilder(&dummy_host);
|
||||
Index<String> pkg_config;
|
||||
for(int i = 0; i < wspc.GetCount(); i++) {
|
||||
|
|
|
|||
|
|
@ -314,10 +314,11 @@ void OutMode::CmdOptions()
|
|||
PromptOK("Invalid build method");
|
||||
return;
|
||||
}
|
||||
One<Host> host = ide.CreateHost(false, false);
|
||||
One<Builder> b = ide.CreateBuilder(~host);
|
||||
Host host;
|
||||
ide.CreateHost(host, false, false);
|
||||
One<Builder> b = ide.CreateBuilder(&host);
|
||||
const String& p = wspc[pi];
|
||||
String output = NativePath(ide.OutDir(ide.PackageConfig(wspc, pi, bm, ~config, *host, *b), p, bm, true));
|
||||
String output = NativePath(ide.OutDir(ide.PackageConfig(wspc, pi, bm, ~config, host, *b), p, bm, true));
|
||||
if (output.Right(1) == ".")
|
||||
output = output.Left(output.GetCount() - 1);
|
||||
const ModePane& pane = ~mode == 0 ? debug : release;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,17 @@
|
|||
#include "urepo.h"
|
||||
#include "ide.h"
|
||||
|
||||
namespace Upp {
|
||||
int RepoSys(const char *cmd, String& out, bool convertcharset)
|
||||
{
|
||||
LocalProcess p; // TODO: CreateHost global
|
||||
Ide *ide = (Ide *)TheIde();
|
||||
if(!ide)
|
||||
return -1;
|
||||
Host host;
|
||||
ide->CreateHost(host, false, false);
|
||||
if(!p.Start(cmd))
|
||||
return -1;
|
||||
return p.Finish(out);
|
||||
}
|
||||
|
||||
UrepoConsole::UrepoConsole()
|
||||
{
|
||||
|
|
@ -28,19 +39,22 @@ void UrepoConsole::Log(const Value& s, Color ink)
|
|||
list.Add(AttrText(s).SetFont(font).NormalInk(ink), s);
|
||||
}
|
||||
|
||||
int UrepoConsole::System(const char *cmd, Event<One<AProcess>&, const char *> start_process)
|
||||
int UrepoConsole::System(const char *cmd)
|
||||
{
|
||||
if(!IsOpen())
|
||||
Open();
|
||||
list.Add(AttrText(cmd).SetFont(font().Bold()).Ink(SLtBlue()));
|
||||
int ii = list.GetCount();
|
||||
One<AProcess> ap;
|
||||
start_process(ap, cmd);
|
||||
if(!ap) {
|
||||
LocalProcess p;
|
||||
Ide *ide = (Ide *)TheIde();
|
||||
if(!ide)
|
||||
return -1;
|
||||
Host host;
|
||||
ide->CreateHost(host, false, false);
|
||||
if(!p.Start(cmd)) {
|
||||
list.Add(AttrText("Failed to start the executable").SetFont(font().Bold()).Ink(SLtRed()));
|
||||
return -1;
|
||||
}
|
||||
AProcess& p = *ap;
|
||||
String out;
|
||||
canceled = false;
|
||||
cancel.Show();
|
||||
|
|
@ -70,15 +84,6 @@ int UrepoConsole::System(const char *cmd, Event<One<AProcess>&, const char *> st
|
|||
return code;
|
||||
}
|
||||
|
||||
int UrepoConsole::System(const char *cmd)
|
||||
{
|
||||
return System(cmd, [&](One<AProcess>& ap, const char *cmd) {
|
||||
LocalProcess& p = ap.Create<LocalProcess>();
|
||||
if(!p.Start(cmd))
|
||||
ap.Clear();
|
||||
});
|
||||
}
|
||||
|
||||
int UrepoConsole::CheckSystem(const char *s)
|
||||
{
|
||||
int exitcode = System(s);
|
||||
|
|
@ -100,5 +105,3 @@ int UrepoConsole::Git(const char *dir, const char *command)
|
|||
SetCurrentDirectory(h);
|
||||
return code;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
#include "urepo.h"
|
||||
|
||||
namespace Upp {
|
||||
#include "ide.h"
|
||||
|
||||
RepoSync::RepoSync()
|
||||
{
|
||||
|
|
@ -524,5 +522,3 @@ int GetRepoKind(const String& p)
|
|||
}
|
||||
return NOT_REPO_DIR;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -150,13 +150,7 @@ void UppHubDlg::Install(const Index<int>& ii)
|
|||
else
|
||||
cmd << repo;
|
||||
cmd << ' ' << GetHubDir() << '/' << n;
|
||||
Ide *ide = (Ide *)TheIde();
|
||||
if(!ide)
|
||||
console.Log("failed", Gray());
|
||||
One<Host> host = ide->CreateHost(false, false);
|
||||
console.System(cmd, [&](One<AProcess>& ap, const char *cmd) {
|
||||
ap = host->StartProcess(cmd);
|
||||
});
|
||||
console.System(cmd);
|
||||
}
|
||||
}
|
||||
console.Log("Done", Gray());
|
||||
|
|
|
|||
|
|
@ -15,19 +15,20 @@ void Ide::Valgrind()
|
|||
return;
|
||||
if(!Build())
|
||||
return;
|
||||
One<Host> h = CreateHostRunDir();
|
||||
h->ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
Host h;
|
||||
CreateHostRunDir(h);
|
||||
h.ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
String cmdline;
|
||||
String fn = GetTempFileName();
|
||||
cmdline << "valgrind --xml=yes --num-callers=40 --xml-file=" << fn << ' ';
|
||||
String ValgSupp = ConfigFile("valgrind.supp");
|
||||
if(!IsNull(LoadFile(ValgSupp)))
|
||||
cmdline << "--suppressions=" << ValgSupp << ' ';
|
||||
cmdline << '\"' << h->GetHostPath(target) << "\" ";
|
||||
cmdline << '\"' << target << "\" ";
|
||||
cmdline << runarg;
|
||||
ConsoleClear();
|
||||
PutConsole("Valgrind..");
|
||||
if(IsNull(h->Execute(cmdline))) {
|
||||
if(IsNull(h.Execute(cmdline))) {
|
||||
PutConsole("Error executing valgrind");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,9 @@ bool Ide::OpenMainPackage()
|
|||
void Ide::NewMainPackage()
|
||||
{
|
||||
if(setmain_newide) {
|
||||
CreateHost(false, false)->Launch(GetExeFilePath() + " --nosplash");
|
||||
Host h;
|
||||
CreateHost(h, false, false);
|
||||
h.Launch(GetExeFilePath() + " --nosplash");
|
||||
}
|
||||
else {
|
||||
SaveCodeBase();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include <ide/Browser/Browser.h>
|
||||
#include <TabBar/TabBar.h>
|
||||
#include <CodeEditor/CodeEditor.h>
|
||||
#include <urepo/urepo.h>
|
||||
#include <ide/IconDes/IconDes.h>
|
||||
#include <ide/Java/Java.h>
|
||||
#include <ide/LayDes/LayDes.h>
|
||||
|
|
@ -431,7 +430,7 @@ public:
|
|||
virtual void ConsoleClear();
|
||||
virtual void SetupDefaultMethod();
|
||||
virtual Vector<String> PickErrors();
|
||||
virtual void BeginBuilding(bool sync_files, bool clear_console);
|
||||
virtual void BeginBuilding(bool clear_console);
|
||||
virtual void EndBuilding(bool ok);
|
||||
virtual void ClearErrorEditor();
|
||||
virtual void DoProcessEvents();
|
||||
|
|
@ -914,7 +913,7 @@ public:
|
|||
void FileCompile();
|
||||
void Preprocess(bool asmout);
|
||||
void ToggleStopOnErrors();
|
||||
One<Host> CreateHostRunDir();
|
||||
void CreateHostRunDir(Host& h);
|
||||
void OpenOutputFolder();
|
||||
void PreprocessInternal();
|
||||
|
||||
|
|
@ -1229,10 +1228,6 @@ public:
|
|||
|
||||
Ide();
|
||||
~Ide();
|
||||
|
||||
|
||||
// THIS IS SANDBOX FOR DEVELOPING NEW NAVIGATOR
|
||||
// void CodeBrowser();
|
||||
};
|
||||
|
||||
inline void ShowConsole() { if(TheIde()) ((Ide *)TheIde())->ShowConsole(); }
|
||||
|
|
@ -1244,4 +1239,6 @@ bool SetupSVNTrunk();
|
|||
void UppHub();
|
||||
void UppHubAuto(const String& s);
|
||||
|
||||
#include "urepo.h"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -834,7 +834,7 @@ LAYOUT(BaseSetupLayout, 608, 136)
|
|||
ITEM(Upp::EditString, upp, LeftPosZ(104, 476).TopPosZ(4, 19))
|
||||
ITEM(Upp::Label, dv___2, SetLabel(t_("Output directory")).LeftPosZ(4, 96).TopPosZ(28, 19))
|
||||
ITEM(Upp::EditString, output, HSizePosZ(104, 28).TopPosZ(28, 19))
|
||||
ITEM(Upp::Label, dv___4, SetLabel(t_("UppHub direcotry")).LeftPosZ(4, 96).TopPosZ(76, 19))
|
||||
ITEM(Upp::Label, dv___4, SetLabel(t_("UppHub directory")).LeftPosZ(4, 96).TopPosZ(76, 19))
|
||||
ITEM(Upp::EditString, upv, HSizePosZ(104, 28).TopPosZ(76, 19))
|
||||
ITEM(Upp::Label, dv___6, SetLabel(t_("Assembly name")).LeftPosZ(4, 96).TopPosZ(52, 19))
|
||||
ITEM(Upp::EditString, base, NotNull(true).LeftPosZ(104, 140).TopPosZ(52, 19))
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ uses
|
|||
ide/Android,
|
||||
ide/Java,
|
||||
ide/MacroManager,
|
||||
urepo,
|
||||
Report,
|
||||
Core/SSL;
|
||||
|
||||
|
|
@ -109,6 +108,14 @@ file
|
|||
depends() xide.ico
|
||||
depends() ide.ico,
|
||||
theide.desktop,
|
||||
Repo readonly separator,
|
||||
urepo.h,
|
||||
RepoConsole.cpp,
|
||||
RepoSync.cpp,
|
||||
Credentials.cpp,
|
||||
Diff.cpp,
|
||||
urepo.iml,
|
||||
urepo.lay,
|
||||
Info readonly separator,
|
||||
Copying;
|
||||
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ void Ide::Setup(Bar& menu)
|
|||
.Help("Setups/fixes build methods and basic assemblies..");
|
||||
#endif
|
||||
menu.MenuSeparator();
|
||||
menu.Add("UppHub..", [] { UppHub(); });
|
||||
menu.Add(HasGit(), "UppHub..", [] { UppHub(); });
|
||||
menu.Add("Checkout and setup U++ SVN trunk sources..", [=] {
|
||||
if(SetupSVNTrunk()) {
|
||||
IdeAgain = true;
|
||||
|
|
|
|||
|
|
@ -626,18 +626,21 @@ void Ide::RemoveDs()
|
|||
|
||||
void Ide::LaunchAndroidSDKManager(const AndroidSDK& androidSDK)
|
||||
{
|
||||
One<Host> host = CreateHost(darkmode, disable_uhd);
|
||||
IGNORE_RESULT(host->Execute(androidSDK.GetLauchSDKManagerCmd()));
|
||||
Host host;
|
||||
CreateHost(host, darkmode, disable_uhd);
|
||||
IGNORE_RESULT(host.Execute(androidSDK.GetLauchSDKManagerCmd()));
|
||||
}
|
||||
|
||||
void Ide::LaunchAndroidAVDManager(const AndroidSDK& androidSDK)
|
||||
{
|
||||
One<Host> host = CreateHost(darkmode, disable_uhd);
|
||||
IGNORE_RESULT(host->Execute(androidSDK.GetLauchAVDManagerCmd()));
|
||||
Host host;
|
||||
CreateHost(host, darkmode, disable_uhd);
|
||||
IGNORE_RESULT(host.Execute(androidSDK.GetLauchAVDManagerCmd()));
|
||||
}
|
||||
|
||||
void Ide::LauchAndroidDeviceMonitor(const AndroidSDK& androidSDK)
|
||||
{
|
||||
One<Host> host = CreateHost(darkmode, disable_uhd);
|
||||
IGNORE_RESULT(host->Execute(androidSDK.MonitorPath()));
|
||||
Host host;
|
||||
CreateHost(host, darkmode, disable_uhd);
|
||||
IGNORE_RESULT(host.Execute(androidSDK.MonitorPath()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,4 @@
|
|||
#ifndef _urepo_urepo_h_
|
||||
#define _urepo_urepo_h_
|
||||
|
||||
#include <TextDiffCtrl/TextDiffCtrl.h>
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define LAYOUTFILE <urepo/urepo.lay>
|
||||
#define LAYOUTFILE <ide/urepo.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
class UrepoConsole : public WithUrepoConsoleLayout<TopWindow> {
|
||||
|
|
@ -16,7 +9,6 @@ class UrepoConsole : public WithUrepoConsoleLayout<TopWindow> {
|
|||
bool canceled = false;
|
||||
|
||||
public:
|
||||
int System(const char *cmd, Event<One<AProcess>&, const char *> start_process);
|
||||
int System(const char *s);
|
||||
int CheckSystem(const char *s);
|
||||
int Git(const char *dir, const char *command);
|
||||
|
|
@ -106,7 +98,3 @@ public:
|
|||
void EditCredentials(RepoSync& rs);
|
||||
|
||||
void RunRepoDiff(const String& filepath);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
Copyright (c) 1998, 2020, The U++ Project
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
#include "urepo.h"
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#ifdef flagMAIN
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
/*
|
||||
RunRepoDiff("c:\\u\\foamiemaker\\foamiemaker\\View.cpp");
|
||||
return;
|
||||
*/
|
||||
RepoSync ss;
|
||||
String mp = ConfigFile("usvn.msg");
|
||||
ss.SetMsgs(LoadFile(mp));
|
||||
// ss.Dir("c:/u/foamiemaker");
|
||||
ss.Dir("C:\\u\\sandbox\\se");
|
||||
ss.Dir("C:\\u\\upp.src\\uppsrc");
|
||||
ss.Dir("C:\\u\\upp.src\\examples");
|
||||
// ss.Dir("C:\\u\\sandbox\\arduino");
|
||||
// ss.Dir("C:\\u\\sandbox\\uppdev");
|
||||
ss.DoSync();
|
||||
SaveFile(mp, ss.GetMsgs());
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
description "GUI for GIT and SVN synchronization\377";
|
||||
|
||||
uses
|
||||
TextDiffCtrl;
|
||||
|
||||
file
|
||||
urepo.h options(BUILDER_OPTION) PCH,
|
||||
Console.cpp,
|
||||
Credentials.cpp,
|
||||
RepoSync.cpp,
|
||||
Diff.cpp,
|
||||
main.cpp,
|
||||
urepo.iml,
|
||||
urepo.lay,
|
||||
Info readonly separator,
|
||||
Copying;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
PREMULTIPLIED
|
||||
IMAGE_ID(RepoDiff)
|
||||
|
||||
IMAGE_BEGIN_DATA
|
||||
IMAGE_DATA(120,156,99,16,96,16,96,24,68,224,63,62,44,16,33,128,23,131,212,60,120,240,0,43,134,233,103,192,1,105,161,31)
|
||||
IMAGE_DATA(153,143,162,159,129,176,126,108,102,161,216,207,128,91,63,161,112,68,193,52,176,159,26,254,71,55,7,111,248,51,224,214)
|
||||
IMAGE_DATA(15,18,59,112,224,0,110,253,64,113,16,192,229,126,144,94,156,250,161,122,145,245,83,152,126,7,20,0,0,49,101,131)
|
||||
IMAGE_DATA(129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
|
||||
IMAGE_END_DATA(128, 1)
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
LAYOUT(RepoSyncLayout, 680, 400)
|
||||
ITEM(ArrayCtrl, list, AutoHideSb(true).HSizePosZ(4, 4).VSizePosZ(4, 36))
|
||||
ITEM(Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(4, 64).BottomPosZ(4, 24))
|
||||
ITEM(Button, ok, SetLabel(t_("Synchronize!")).RightPosZ(4, 84).BottomPosZ(4, 24))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(ConsoleLayout, 680, 660)
|
||||
ITEM(ArrayCtrl, list, HSizePosZ(4, 4).VSizePosZ(4, 40))
|
||||
ITEM(Button, exit, SetLabel(t_("Close")).RightPosZ(4, 64).BottomPosZ(8, 24))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(SvnOptionsLayout, 140, 16)
|
||||
ITEM(Option, commit, SetLabel(t_("Commit")).LeftPosZ(0, 68).VCenterPosZ(16, 0))
|
||||
ITEM(Option, update, SetLabel(t_("Update")).LeftPosZ(72, 68).VCenterPosZ(16, 0))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(GitOptionsLayout, 164, 16)
|
||||
ITEM(Option, commit, SetLabel(t_("Commit")).LeftPosZ(0, 68).VCenterPosZ(16, 0))
|
||||
ITEM(Option, push, SetLabel(t_("Push")).LeftPosZ(68, 48).VCenterPosZ(16, 0))
|
||||
ITEM(Option, pull, SetLabel(t_("Pull")).LeftPosZ(116, 48).VCenterPosZ(16, 0))
|
||||
END_LAYOUT
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue