From 9bd388c679e60244dca5e4e09b6edf1a46088ca6 Mon Sep 17 00:00:00 2001 From: klugier Date: Sun, 15 May 2016 11:11:55 +0000 Subject: [PATCH] Invalid build method error is now more verbose (umk/ide) git-svn-id: svn://ultimatepp.org/upp/trunk@9833 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/Builders/Build.cpp | 9 +++++++-- uppsrc/ide/Builders/Build.h | 6 +++++- uppsrc/ide/Core/Core.cpp | 11 ++++++++++- uppsrc/ide/Core/Core.h | 4 +++- uppsrc/umk/umake.cpp | 11 ++++++++--- uppsrc/umk/umake.h | 3 ++- 6 files changed, 35 insertions(+), 9 deletions(-) diff --git a/uppsrc/ide/Builders/Build.cpp b/uppsrc/ide/Builders/Build.cpp index 414131310..085260289 100644 --- a/uppsrc/ide/Builders/Build.cpp +++ b/uppsrc/ide/Builders/Build.cpp @@ -292,7 +292,7 @@ bool MakeBuild::BuildPackage(const Workspace& wspc, int pkindex, int pknumber, i const Package& pkg = wspc.package[pkindex]; VectorMap bm = GetMethodVars(method); if(bm.GetCount() == 0) { - PutConsole("Invalid build method"); + PutConsole(GetInvalidBuildMethodError(method)); ConsoleShow(); return false; } @@ -547,7 +547,7 @@ bool MakeBuild::Build() { VectorMap bm = GetMethodVars(method); if(bm.GetCount() == 0) { - PutConsole("Invalid build method"); + PutConsole(GetInvalidBuildMethodError(method)); ConsoleShow(); return false; } @@ -733,3 +733,8 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting) } EndBuilding(true); } + +String MakeBuild::GetInvalidBuildMethodError(const String& method) +{ + return "Invalid build method " + method + " (" + GetMethodPath(method) + ")."; +} diff --git a/uppsrc/ide/Builders/Build.h b/uppsrc/ide/Builders/Build.h index bfd928bc5..3bf7676e9 100644 --- a/uppsrc/ide/Builders/Build.h +++ b/uppsrc/ide/Builders/Build.h @@ -27,7 +27,8 @@ int CharFilterSlash(int c); String GetDefaultMethod(); VectorMap GetMethodVars(const String& method); -struct MakeBuild { +class MakeBuild { +public: virtual void ConsoleShow() = 0; // ShowConsole(); console.Sync(); virtual void ConsoleSync() = 0; // console.Sync() virtual void ConsoleClear() = 0; @@ -89,6 +90,9 @@ struct MakeBuild { void SaveMakeFile(const String& fn, bool exporting); MakeBuild(); + +private: + static String GetInvalidBuildMethodError(const String& method); }; extern bool output_per_assembly; diff --git a/uppsrc/ide/Core/Core.cpp b/uppsrc/ide/Core/Core.cpp index e5111d1d4..a8e5c6eb6 100644 --- a/uppsrc/ide/Core/Core.cpp +++ b/uppsrc/ide/Core/Core.cpp @@ -115,10 +115,14 @@ String IdeContext::GetDefaultMethod() VectorMap IdeContext::GetMethodVars(const String& method) { VectorMap map; - LoadVarFile(ConfigFile((String)~method + ".bm"), map); + LoadVarFile(ConfigFile(GetMethodName(method)), map); return map; } +String IdeContext::GetMethodName(const String& method) +{ + return (String)~method + ".bm"; +} String GetDefaultMethod() { @@ -130,6 +134,11 @@ VectorMap GetMethodVars(const String& method) return the_ide ? the_ide->GetMethodVars(method) : VectorMap(); } +String GetMethodPath(const String& method) +{ + return the_ide ? the_ide->GetMethodName(method) : ""; +} + bool IdeIsBuilding() { return the_ide && the_ide->IdeIsBuilding(); diff --git a/uppsrc/ide/Core/Core.h b/uppsrc/ide/Core/Core.h index 3f2c09bc3..c5e73d920 100644 --- a/uppsrc/ide/Core/Core.h +++ b/uppsrc/ide/Core/Core.h @@ -83,8 +83,9 @@ public: virtual String IdeGetNestFolder() = 0; virtual String IdeGetIncludePath() = 0; - virtual String GetDefaultMethod(); + virtual String GetDefaultMethod(); virtual VectorMap GetMethodVars(const String& method); + virtual String GetMethodName(const String& method); virtual bool IsPersistentFindReplace() = 0; @@ -118,6 +119,7 @@ void IdeGotoCodeRef(String s); String GetDefaultMethod(); VectorMap GetMethodVars(const String& method); +String GetMethodPath(const String& method); bool IdeIsDebug(); void IdeEndDebug(); diff --git a/uppsrc/umk/umake.cpp b/uppsrc/umk/umake.cpp index 264c39b20..18ccf3a91 100644 --- a/uppsrc/umk/umake.cpp +++ b/uppsrc/umk/umake.cpp @@ -27,10 +27,15 @@ String Ide::GetDefaultMethod() VectorMap Ide::GetMethodVars(const String& method) { VectorMap map; - LoadVarFile(GetBuildMethodPath(method), map); + LoadVarFile(GetMethodName(method), map); return map; } +String Ide::GetMethodName(const String& method) +{ + return GetBuildMethodPath(method); +} + void Puts(const char *s) { if(!SilentMode) @@ -57,9 +62,9 @@ String GetAndroidSDKPath() return String(); } -#ifdef flagMAIN +#ifdef flagMAIN -CONSOLE_APP_MAIN +CONSOLE_APP_MAIN { #ifdef PLATFORM_POSIX setlinebuf(stdout); diff --git a/uppsrc/umk/umake.h b/uppsrc/umk/umake.h index 29269d62f..3d6e4ac08 100644 --- a/uppsrc/umk/umake.h +++ b/uppsrc/umk/umake.h @@ -154,8 +154,9 @@ struct Ide : public IdeContext, public MakeBuild { virtual void SetErrorEditor(); virtual String GetMain(); - virtual String GetDefaultMethod(); + virtual String GetDefaultMethod(); virtual VectorMap GetMethodVars(const String& method); + virtual String GetMethodName(const String& method); virtual bool IsPersistentFindReplace() { return false; }