.ide BLITZ for Android works on Android and added support for Android verbose builds.

git-svn-id: svn://ultimatepp.org/upp/trunk@10952 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
klugier 2017-03-18 23:49:10 +00:00
parent 575348b33e
commit 1d5cb740f6
7 changed files with 25 additions and 11 deletions

View file

@ -58,10 +58,11 @@ private:
class NDKBuild {
public:
NDKBuild(const String& path);
virtual ~NDKBuild();
virtual ~NDKBuild() {}
void SetJobs(int jobs) { this->jobs = jobs; }
void SetWorkingDir(const String& workingDir) { this->workingDir = workingDir; }
void EnableVerbose(bool verbose = true) { this->verbose = verbose; }
String MakeCmd() const;
@ -69,6 +70,7 @@ private:
String path;
String workingDir;
int jobs;
bool verbose;
};
}

View file

@ -3,19 +3,17 @@
namespace Upp {
NDKBuild::NDKBuild(const String& path)
: path(path)
, jobs(jobs)
, verbose(false)
{
this->path = path;
this->jobs = 0;
}
NDKBuild::~NDKBuild()
{
}
String NDKBuild::MakeCmd() const
{
String cmd = NormalizeExePath(path);
if(verbose)
cmd << " V=1 ";
if(!workingDir.IsEmpty())
cmd << " -C " << workingDir;
if(jobs > 0)

View file

@ -103,15 +103,17 @@ bool AndroidBuilder::BuildPackage(
}
else
if(BuilderUtils::IsCppOrCFile(filePath)) {
String normailzedFilePath = NormalizePathSeparator(filePath);
nativeSourcesOptions.Add(globalOptions);
if(pkg[i].noblitz) {
if (isBlitz) {
noBlitzNativeSourceFiles.Add(filePath);
noBlitzNativeSourceFiles.Add(normailzedFilePath);
continue;
}
}
nativeSources.Add(filePath);
nativeSources.Add(normailzedFilePath);
}
else
if(BuilderUtils::IsXmlFile(filePath)) {
@ -172,7 +174,7 @@ bool AndroidBuilder::BuildPackage(
LOG(ERROR_METHOD_NAME + "Blitz was enable, but no blitz file generated.");
}
else {
nativeSources.Add(blitz.path);
nativeSources.Add(package + DIR_SEPS + GetFileName(blitz.path));
}
}
@ -239,6 +241,9 @@ bool AndroidBuilder::Link(
GenerateMakeFile();
NDKBuild ndkBuild(ndk.GetNdkBuildPath());
if(IsVerbose()) {
ndkBuild.EnableVerbose();
}
ndkBuild.SetWorkingDir(project->GetDir());
ndkBuild.SetJobs(GetHydraThreads());
if(host->Execute(ndkBuild.MakeCmd()) != 0 ) {

View file

@ -89,6 +89,7 @@ static IdeContext *the_ide;
IdeContext *TheIde() { return the_ide; }
void TheIde(IdeContext *context) { the_ide = context; }
bool IsVerbose() { return the_ide ? the_ide->IsVerbose() : false; }
void PutConsole(const char *s) { if(the_ide) the_ide->PutConsole(s); }
void PutVerbose(const char *s) { if(the_ide) the_ide->PutVerbose(s); }
void PutLinking() { if(the_ide) the_ide->PutLinking(); }

View file

@ -37,6 +37,7 @@ class Image;
class IdeContext
{
public:
virtual bool IsVerbose() const = 0;
virtual void PutConsole(const char *s) = 0;
virtual void PutVerbose(const char *s) = 0;
virtual void PutLinking() = 0;
@ -95,6 +96,7 @@ public:
IdeContext *TheIde();
void TheIde(IdeContext *context);
bool IsVerbose();
void PutConsole(const char *s);
void PutVerbose(const char *s);
void PutLinking();

View file

@ -346,6 +346,7 @@ public:
virtual void Activate();
virtual void Layout();
virtual bool IsVerbose() const;
virtual void PutConsole(const char *s);
virtual void PutVerbose(const char *s);
virtual void PutLinking();

View file

@ -90,6 +90,11 @@ void Ide::ConsolePaste()
}
}
bool Ide::IsVerbose() const
{
return console.verbosebuild;
}
void Ide::PutConsole(const char *s)
{
console << s << "\n";