logic: maven project setup
* added option to create a Coati project from a Maven POM file * show list of indexed file paths in maven project setup * use FileManager to detect indexed files in project setup (except cdb) * added Maven path to preferences window and added path detectors. * fixed: QtDialogView::hideStatusDialog now also hides loader in status bar. * refactored ProjectType fortune cookie message = If you continually give, you will continually have.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include "utility/path_detector/maven_executable/MavenPathDetectorUnix.h"
|
||||
|
||||
#include "utility/utilityApp.h"
|
||||
|
||||
MavenPathDetectorUnix::MavenPathDetectorUnix()
|
||||
: PathDetector("Maven for Unix")
|
||||
{
|
||||
}
|
||||
|
||||
MavenPathDetectorUnix::~MavenPathDetectorUnix()
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<FilePath> MavenPathDetectorUnix::getPaths() const
|
||||
{
|
||||
std::string command = "which mvn";
|
||||
FilePath mavenPath(utility::executeProcess(command.c_str()));
|
||||
|
||||
std::vector<FilePath> paths;
|
||||
if (mavenPath.exists())
|
||||
{
|
||||
paths.push_back(mavenPath);
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef MAVEN_PATH_DETECTOR_UNIX_H
|
||||
#define MAVEN_PATH_DETECTOR_UNIX_H
|
||||
|
||||
#include "utility/path_detector/PathDetector.h"
|
||||
|
||||
class MavenPathDetectorUnix: public PathDetector
|
||||
{
|
||||
public:
|
||||
MavenPathDetectorUnix();
|
||||
virtual ~MavenPathDetectorUnix();
|
||||
|
||||
virtual std::vector<FilePath> getPaths() const;
|
||||
};
|
||||
|
||||
#endif // MAVEN_PATH_DETECTOR_UNIX_H
|
||||
@@ -0,0 +1,25 @@
|
||||
#include "utility/path_detector/maven_executable/MavenPathDetectorWindows.h"
|
||||
|
||||
#include "utility/utilityApp.h"
|
||||
|
||||
MavenPathDetectorWindows::MavenPathDetectorWindows()
|
||||
: PathDetector("Maven for Windows")
|
||||
{
|
||||
}
|
||||
|
||||
MavenPathDetectorWindows::~MavenPathDetectorWindows()
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<FilePath> MavenPathDetectorWindows::getPaths() const
|
||||
{
|
||||
std::string command = "cmd /k where mvn.cmd && exit";
|
||||
FilePath mavenPath(utility::executeProcess(command.c_str()));
|
||||
|
||||
std::vector<FilePath> paths;
|
||||
if (mavenPath.exists())
|
||||
{
|
||||
paths.push_back(mavenPath);
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef MAVEN_PATH_DETECTOR_WINDOWS_H
|
||||
#define MAVEN_PATH_DETECTOR_WINDOWS_H
|
||||
|
||||
#include "utility/path_detector/PathDetector.h"
|
||||
|
||||
class MavenPathDetectorWindows: public PathDetector
|
||||
{
|
||||
public:
|
||||
MavenPathDetectorWindows();
|
||||
virtual ~MavenPathDetectorWindows();
|
||||
|
||||
virtual std::vector<FilePath> getPaths() const;
|
||||
};
|
||||
|
||||
#endif // MAVEN_PATH_DETECTOR_WINDOWS_H
|
||||
@@ -5,11 +5,17 @@
|
||||
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
std::string utility::executeProcess(const char *cmd)
|
||||
std::string utility::executeProcess(const std::string& command, const std::string& workingDirectory)
|
||||
{
|
||||
QProcess process;
|
||||
process.setProcessChannelMode(QProcess::MergedChannels);
|
||||
process.start(cmd);
|
||||
|
||||
if (!workingDirectory.empty())
|
||||
{
|
||||
process.setWorkingDirectory(workingDirectory.c_str());
|
||||
}
|
||||
|
||||
process.start(command.c_str());
|
||||
process.waitForFinished();
|
||||
std::string processoutput = process.readAll().toStdString();
|
||||
process.close();
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
#ifndef UTILITY_APP_H
|
||||
#define UTILITY_APP_H
|
||||
|
||||
#include <QProcess>
|
||||
#include <string>
|
||||
|
||||
#include "utility/ApplicationArchitectureType.h"
|
||||
|
||||
namespace utility
|
||||
{
|
||||
std::string executeProcess(const char* cmd);
|
||||
std::string executeProcess(const std::string& command, const std::string& workingDirectory = "");
|
||||
|
||||
ApplicationArchitectureType getApplicationArchitectureType();
|
||||
}
|
||||
|
||||
|
||||
#endif // UTILITY_APP_H
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#include "utility/path_detector/java_runtime/JavaPathDetectorMac.h"
|
||||
#include "utility/path_detector/java_runtime/JavaPathDetectorWindows.h"
|
||||
|
||||
#include "utility/path_detector/maven_executable/MavenPathDetectorUnix.h"
|
||||
#include "utility/path_detector/maven_executable/MavenPathDetectorWindows.h"
|
||||
|
||||
#include "utility/path_detector/cxx_header/CxxFrameworkPathDetector.h"
|
||||
#include "utility/path_detector/cxx_header/CxxHeaderPathDetector.h"
|
||||
#include "utility/path_detector/cxx_header/CxxVsHeaderPathDetector.h"
|
||||
@@ -29,6 +32,21 @@ std::shared_ptr<CombinedPathDetector> utility::getJavaRuntimePathDetector()
|
||||
return combinedDetector;
|
||||
}
|
||||
|
||||
std::shared_ptr<CombinedPathDetector> utility::getMavenExecutablePathDetector()
|
||||
{
|
||||
std::shared_ptr<CombinedPathDetector> combinedDetector = std::make_shared<CombinedPathDetector>();
|
||||
if (QSysInfo::windowsVersion() != QSysInfo::WV_None)
|
||||
{
|
||||
combinedDetector->addDetector(std::make_shared<MavenPathDetectorWindows>());
|
||||
}
|
||||
else
|
||||
{
|
||||
combinedDetector->addDetector(std::make_shared<MavenPathDetectorUnix>());
|
||||
}
|
||||
|
||||
return combinedDetector;
|
||||
}
|
||||
|
||||
std::shared_ptr<CombinedPathDetector> utility::getCxxVsHeaderPathDetector()
|
||||
{
|
||||
std::shared_ptr<CombinedPathDetector> combinedDetector = std::make_shared<CombinedPathDetector>();
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
namespace utility
|
||||
{
|
||||
std::shared_ptr<CombinedPathDetector> getJavaRuntimePathDetector();
|
||||
std::shared_ptr<CombinedPathDetector> getMavenExecutablePathDetector();
|
||||
|
||||
std::shared_ptr<CombinedPathDetector> getCxxVsHeaderPathDetector();
|
||||
std::shared_ptr<CombinedPathDetector> getCxxHeaderPathDetector();
|
||||
|
||||
Reference in New Issue
Block a user