logic: added Gradle project setup (issue #379)
* added implementation for Gradle project setup (icon is still missing) * refactored project loading/saving and SourceGroupSettings * removed long deprecated Cxx UseSourcePathsForHeaderSearch option fortune cookie message = There is true and sincere friendship between you and your friends.
This commit is contained in:
@@ -11,65 +11,9 @@
|
||||
#include "utility/file/FileSystem.h"
|
||||
#include "utility/text/TextAccess.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
#include "utility/utilityJava.h"
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
std::vector<std::string> JavaParser::getRequiredJarNames()
|
||||
{
|
||||
std::vector<std::string> jarNames = {
|
||||
|
||||
"java-indexer.jar",
|
||||
"org.eclipse.core.commands-3.8.1.jar",
|
||||
"org.eclipse.core.contenttype-3.5.100.jar",
|
||||
"org.eclipse.core.expressions-3.5.100.jar",
|
||||
"org.eclipse.core.filesystem-1.6.1.jar",
|
||||
"org.eclipse.core.jobs-3.8.0.jar",
|
||||
"org.eclipse.core.resources-3.11.1.jar",
|
||||
"org.eclipse.core.runtime-3.12.0.jar",
|
||||
"org.eclipse.equinox.app-1.3.400.jar",
|
||||
"org.eclipse.equinox.common-3.8.0.jar",
|
||||
"org.eclipse.equinox.preferences-3.6.1.jar",
|
||||
"org.eclipse.equinox.registry-3.6.100.jar",
|
||||
"org.eclipse.jdt.core-3.12.3.jar",
|
||||
"org.eclipse.osgi-3.11.3.jar",
|
||||
"org.eclipse.text-3.6.0.jar"
|
||||
};
|
||||
return jarNames;
|
||||
}
|
||||
|
||||
std::string JavaParser::prepareJavaEnvironment()
|
||||
{
|
||||
std::string errorString;
|
||||
|
||||
if (!JavaEnvironmentFactory::getInstance())
|
||||
{
|
||||
#ifdef _WIN32
|
||||
const std::string separator = ";";
|
||||
#else
|
||||
const std::string separator = ":";
|
||||
#endif
|
||||
|
||||
std::string classPath = "";
|
||||
{
|
||||
const std::vector<std::string> jarNames = getRequiredJarNames();
|
||||
for (size_t i = 0; i < jarNames.size(); i++)
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
classPath += separator;
|
||||
}
|
||||
classPath += ResourcePaths::getJavaPath().str() + jarNames[i];
|
||||
}
|
||||
}
|
||||
|
||||
JavaEnvironmentFactory::createInstance(
|
||||
classPath,
|
||||
errorString
|
||||
);
|
||||
}
|
||||
|
||||
return errorString;
|
||||
}
|
||||
|
||||
void JavaParser::clearCaches()
|
||||
{
|
||||
std::shared_ptr<JavaEnvironmentFactory> factory = JavaEnvironmentFactory::getInstance();
|
||||
@@ -90,7 +34,7 @@ JavaParser::JavaParser(std::shared_ptr<ParserClient> client, std::shared_ptr<Fil
|
||||
: Parser(client)
|
||||
, m_id(s_nextParserId++)
|
||||
{
|
||||
const std::string errorString = prepareJavaEnvironment();
|
||||
const std::string errorString = utility::prepareJavaEnvironment();
|
||||
if (errorString.size() > 0)
|
||||
{
|
||||
LOG_ERROR(errorString);
|
||||
|
||||
Reference in New Issue
Block a user