build: allow to disable language support in cmake

* in addition: add unloadable sourcegroup to visualize, load and save information when loading a project that contains source groups that are not supported by the build
This commit is contained in:
mlangkabel
2019-11-13 17:26:06 +01:00
parent 4cf852770e
commit c38117ab8b
111 changed files with 1165 additions and 242 deletions
+33 -8
View File
@@ -3,14 +3,14 @@
#include <csignal>
#include <iostream>
#include "language_packages.h"
#include "Application.h"
#include "ApplicationSettings.h"
#include "ApplicationSettingsPrefiller.h"
#include "CommandLineParser.h"
#include "ConsoleLogger.h"
#include "FileLogger.h"
#include "LanguagePackageCxx.h"
#include "LanguagePackageJava.h"
#include "LanguagePackageManager.h"
#include "logging.h"
#include "LogManager.h"
@@ -25,9 +25,6 @@
#include "ResourcePaths.h"
#include "ScopedFunctor.h"
#include "SourceGroupFactory.h"
#include "SourceGroupFactoryModuleCxx.h"
#include "SourceGroupFactoryModuleJava.h"
#include "SourceGroupFactoryModulePython.h"
#include "SourceGroupFactoryModuleCustom.h"
#include "TextAccess.h"
#include "UserPaths.h"
@@ -36,6 +33,20 @@
#include "utilityQt.h"
#include "Version.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "LanguagePackageCxx.h"
#include "SourceGroupFactoryModuleCxx.h"
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "LanguagePackageJava.h"
#include "SourceGroupFactoryModuleJava.h"
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
#include "SourceGroupFactoryModulePython.h"
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
void signalHandler(int signum)
{
std::cout << "interrupt indexing" << std::endl;
@@ -60,13 +71,27 @@ void setupLogging()
void addLanguagePackages()
{
SourceGroupFactory::getInstance()->addModule(std::make_shared<SourceGroupFactoryModuleCxx>());
SourceGroupFactory::getInstance()->addModule(std::make_shared<SourceGroupFactoryModuleJava>());
SourceGroupFactory::getInstance()->addModule(std::make_shared<SourceGroupFactoryModulePython>());
SourceGroupFactory::getInstance()->addModule(std::make_shared<SourceGroupFactoryModuleCustom>());
#if BUILD_CXX_LANGUAGE_PACKAGE
SourceGroupFactory::getInstance()->addModule(std::make_shared<SourceGroupFactoryModuleCxx>());
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
SourceGroupFactory::getInstance()->addModule(std::make_shared<SourceGroupFactoryModuleJava>());
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
SourceGroupFactory::getInstance()->addModule(std::make_shared<SourceGroupFactoryModulePython>());
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
#if BUILD_CXX_LANGUAGE_PACKAGE
LanguagePackageManager::getInstance()->addPackage(std::make_shared<LanguagePackageCxx>());
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
LanguagePackageManager::getInstance()->addPackage(std::make_shared<LanguagePackageJava>());
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
}
QCoreApplication* createApplication(int &argc, char *argv[], bool noGUI = false)
+16 -2
View File
@@ -1,7 +1,7 @@
#include "includes.h"
#include "LanguagePackageCxx.h"
#include "LanguagePackageJava.h"
#include "language_packages.h"
#include "LanguagePackageManager.h"
#include "InterprocessIndexer.h"
#include "ApplicationSettings.h"
@@ -11,6 +11,14 @@
#include "logging.h"
#include "LogManager.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "LanguagePackageCxx.h"
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "LanguagePackageJava.h"
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
void setupLogging(const FilePath& logFilePath)
{
LogManager* logManager = LogManager::getInstance().get();
@@ -83,8 +91,14 @@ int main(int argc, char *argv[])
LOG_INFO(L"appPath: " + AppPath::getAppPath().wstr());
LOG_INFO(L"userDataPath: " + UserPaths::getUserDataPath().wstr());
#if BUILD_CXX_LANGUAGE_PACKAGE
LanguagePackageManager::getInstance()->addPackage(std::make_shared<LanguagePackageCxx>());
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
LanguagePackageManager::getInstance()->addPackage(std::make_shared<LanguagePackageJava>());
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
InterprocessIndexer indexer(instanceUuid, processId);
indexer.work();
+1
View File
@@ -397,6 +397,7 @@ add_files(
settings/source_group/type/SourceGroupSettingsJavaGradle.h
settings/source_group/type/SourceGroupSettingsJavaMaven.h
settings/source_group/type/SourceGroupSettingsPythonEmpty.h
settings/source_group/type/SourceGroupSettingsUnloadable.h
settings/source_group/SourceGroupSettings.cpp
settings/source_group/SourceGroupSettings.h
@@ -4,12 +4,18 @@ std::string indexerCommandTypeToString(IndexerCommandType type)
{
switch(type)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
case INDEXER_COMMAND_CXX:
return "indexer_command_cxx";
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case INDEXER_COMMAND_JAVA:
return "indexer_command_java";
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
case INDEXER_COMMAND_PYTHON:
return "indexer_command_python";
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
case INDEXER_COMMAND_CUSTOM:
return "indexer_command_custom";
default:
@@ -20,8 +26,15 @@ std::string indexerCommandTypeToString(IndexerCommandType type)
IndexerCommandType stringToIndexerCommandType(const std::string& s)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
if (s == indexerCommandTypeToString(INDEXER_COMMAND_CXX)) return INDEXER_COMMAND_CXX;
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
if (s == indexerCommandTypeToString(INDEXER_COMMAND_JAVA)) return INDEXER_COMMAND_JAVA;
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
if (s == indexerCommandTypeToString(INDEXER_COMMAND_PYTHON)) return INDEXER_COMMAND_PYTHON;
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
if (s == indexerCommandTypeToString(INDEXER_COMMAND_CUSTOM)) return INDEXER_COMMAND_CUSTOM;
return INDEXER_COMMAND_UNKNOWN;
}
@@ -1,14 +1,22 @@
#ifndef INDEXER_COMMAND_TYPE_H
#define INDEXER_COMMAND_TYPE_H
#include "language_packages.h"
#include <string>
enum IndexerCommandType
{
INDEXER_COMMAND_UNKNOWN,
#if BUILD_CXX_LANGUAGE_PACKAGE
INDEXER_COMMAND_CXX,
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
INDEXER_COMMAND_JAVA,
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
INDEXER_COMMAND_PYTHON,
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
INDEXER_COMMAND_CUSTOM
};
@@ -52,11 +52,12 @@ void TaskExecuteCustomCommands::doEnter(std::shared_ptr<Blackboard> blackboard)
{
m_targetDatabaseFilePath = indexerCommand->getDatabaseFilePath();
}
#if BUILD_PYTHON_LANGUAGE_PACKAGE
if (indexerCommand->getIndexerCommandType() == INDEXER_COMMAND_PYTHON)
{
m_hasPythonCommands = true;
}
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
if (indexerCommand->getRunInParallel())
{
@@ -10,6 +10,7 @@ void SharedIndexerCommand::fromLocal(IndexerCommand* indexerCommand)
{
setSourceFilePath(indexerCommand->getSourceFilePath());
#if BUILD_CXX_LANGUAGE_PACKAGE
if (dynamic_cast<IndexerCommandCxx*>(indexerCommand) != nullptr)
{
IndexerCommandCxx* cmd = dynamic_cast<IndexerCommandCxx*>(indexerCommand);
@@ -20,29 +21,34 @@ void SharedIndexerCommand::fromLocal(IndexerCommand* indexerCommand)
setIncludeFilters(cmd->getIncludeFilters());
setWorkingDirectory(cmd->getWorkingDirectory());
setCompilerFlags(cmd->getCompilerFlags());
return;
}
else if (dynamic_cast<IndexerCommandJava*>(indexerCommand) != nullptr)
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
if (dynamic_cast<IndexerCommandJava*>(indexerCommand) != nullptr)
{
IndexerCommandJava* cmd = dynamic_cast<IndexerCommandJava*>(indexerCommand);
setType(JAVA);
setLanguageStandard(cmd->getLanguageStandard());
setClassPaths(cmd->getClassPath());
return;
}
else
{
LOG_ERROR(L"Trying to push unhandled type of IndexerCommand for file: " +
indexerCommand->getSourceFilePath().wstr() + L". Type string is: " +
utility::decodeFromUtf8(indexerCommandTypeToString(indexerCommand->getIndexerCommandType())) +
L". It will be ignored.");
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
LOG_ERROR(L"Trying to push unhandled type of IndexerCommand for file: " +
indexerCommand->getSourceFilePath().wstr() + L". Type string is: " +
utility::decodeFromUtf8(indexerCommandTypeToString(indexerCommand->getIndexerCommandType())) +
L". It will be ignored.");
}
std::shared_ptr<IndexerCommand> SharedIndexerCommand::fromShared(const SharedIndexerCommand& indexerCommand)
{
if (indexerCommand.getType() == CXX)
switch (indexerCommand.getType())
{
std::shared_ptr<IndexerCommand> command = std::make_shared<IndexerCommandCxx>(
#if BUILD_CXX_LANGUAGE_PACKAGE
case CXX:
return std::make_shared<IndexerCommandCxx>(
indexerCommand.getSourceFilePath(),
indexerCommand.getIndexedPaths(),
indexerCommand.getExcludeFilters(),
@@ -50,18 +56,16 @@ std::shared_ptr<IndexerCommand> SharedIndexerCommand::fromShared(const SharedInd
indexerCommand.getWorkingDirectory(),
indexerCommand.getCompilerFlags()
);
return command;
}
else if (indexerCommand.getType() == JAVA)
{
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case JAVA:
return std::make_shared<IndexerCommandJava>(
indexerCommand.getSourceFilePath(),
indexerCommand.getLanguageStandard(),
indexerCommand.getClassPaths()
);
}
else
{
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
default:
LOG_ERROR(L"Cannot convert shared IndexerCommand for file: " +
indexerCommand.getSourceFilePath().wstr() + L". The type is unknown.");
}
@@ -73,13 +77,17 @@ std::shared_ptr<IndexerCommand> SharedIndexerCommand::fromShared(const SharedInd
SharedIndexerCommand::SharedIndexerCommand(SharedMemory::Allocator* allocator)
: m_type(Type::UNKNOWN)
, m_sourceFilePath("", allocator)
#if BUILD_CXX_LANGUAGE_PACKAGE
, m_indexedPaths(allocator)
, m_excludeFilters(allocator)
, m_includeFilters(allocator)
, m_workingDirectory("", allocator)
, m_languageStandard("", allocator)
, m_compilerFlags(allocator)
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
, m_languageStandard("", allocator)
, m_classPaths(allocator)
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
{
}
@@ -97,6 +105,8 @@ void SharedIndexerCommand::setSourceFilePath(const FilePath& filePath)
m_sourceFilePath = utility::encodeToUtf8(filePath.wstr()).c_str();
}
#if BUILD_CXX_LANGUAGE_PACKAGE
std::set<FilePath> SharedIndexerCommand::getIndexedPaths() const
{
std::set<FilePath> result;
@@ -179,16 +189,6 @@ void SharedIndexerCommand::setWorkingDirectory(const FilePath& workingDirectory)
m_workingDirectory = utility::encodeToUtf8(workingDirectory.wstr()).c_str();
}
std::wstring SharedIndexerCommand::getLanguageStandard() const
{
return utility::decodeFromUtf8(m_languageStandard.c_str());
}
void SharedIndexerCommand::setLanguageStandard(const std::wstring& languageStandard)
{
m_languageStandard = utility::encodeToUtf8(languageStandard).c_str();
}
std::vector<std::wstring> SharedIndexerCommand::getCompilerFlags() const
{
std::vector<std::wstring> result;
@@ -215,6 +215,20 @@ void SharedIndexerCommand::setCompilerFlags(const std::vector<std::wstring>& com
}
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
std::wstring SharedIndexerCommand::getLanguageStandard() const
{
return utility::decodeFromUtf8(m_languageStandard.c_str());
}
void SharedIndexerCommand::setLanguageStandard(const std::wstring& languageStandard)
{
m_languageStandard = utility::encodeToUtf8(languageStandard).c_str();
}
std::vector<FilePath> SharedIndexerCommand::getClassPaths() const
{
std::vector<FilePath> result;
@@ -241,6 +255,8 @@ void SharedIndexerCommand::setClassPaths(const std::vector<FilePath>& classPaths
}
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
SharedIndexerCommand::Type SharedIndexerCommand::getType() const
{
return m_type;
@@ -3,6 +3,8 @@
#include <set>
#include "language_packages.h"
#include "FilePath.h"
#include "FilePathFilter.h"
#include "SharedMemory.h"
@@ -21,6 +23,8 @@ public:
FilePath getSourceFilePath() const;
void setSourceFilePath(const FilePath& filePath);
#if BUILD_CXX_LANGUAGE_PACKAGE
std::set<FilePath> getIndexedPaths() const;
void setIndexedPaths(const std::set<FilePath>& indexedPaths);
@@ -33,21 +37,30 @@ public:
FilePath getWorkingDirectory() const;
void setWorkingDirectory(const FilePath& workingDirectory);
std::wstring getLanguageStandard() const;
void setLanguageStandard(const std::wstring& languageStandard);
std::vector<std::wstring> getCompilerFlags() const;
void setCompilerFlags(const std::vector<std::wstring>& compilerFlags);
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
std::wstring getLanguageStandard() const;
void setLanguageStandard(const std::wstring& languageStandard);
std::vector<FilePath> getClassPaths() const;
void setClassPaths(const std::vector<FilePath>& classPaths);
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
private:
enum Type
{
UNKNOWN = 0,
#if BUILD_CXX_LANGUAGE_PACKAGE
CXX,
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
JAVA
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
};
Type getType() const;
@@ -57,17 +70,19 @@ private:
// indexer command
SharedMemory::String m_sourceFilePath;
#if BUILD_CXX_LANGUAGE_PACKAGE
SharedMemory::Vector<SharedMemory::String> m_indexedPaths;
SharedMemory::Vector<SharedMemory::String> m_excludeFilters;
SharedMemory::Vector<SharedMemory::String> m_includeFilters;
// cxx
SharedMemory::String m_workingDirectory;
SharedMemory::String m_languageStandard;
SharedMemory::Vector<SharedMemory::String> m_compilerFlags;
#endif // BUILD_CXX_LANGUAGE_PACKAGE
// java
#if BUILD_JAVA_LANGUAGE_PACKAGE
SharedMemory::String m_languageStandard;
SharedMemory::Vector<SharedMemory::String> m_classPaths;
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
};
#endif // SHARED_INDEXER_COMMAND_H
@@ -30,10 +30,18 @@ void SqliteBookmarkStorage::migrateIfNecessary()
std::shared_ptr<const Project> currentProject = Application::getInstance()->getCurrentProject();
{
LanguageType currentLanguage = ProjectSettings::getLanguageOfProject(currentProject->getProjectSettingsFilePath());
#if BUILD_JAVA_LANGUAGE_PACKAGE
if (currentLanguage == LANGUAGE_JAVA)
{
separator = ".";
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
if (currentLanguage == LANGUAGE_PYTHON)
{
separator = ".";
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
}
}
migration->executeStatementInStorage(storage, "UPDATE bookmarked_node SET serialized_node_name = '" + separator + "\tm' || serialized_node_name");
+29 -10
View File
@@ -418,20 +418,32 @@ void Project::buildIndex(RefreshInfo info, std::shared_ptr<DialogView> dialogVie
return;
}
if (info.mode != REFRESH_ALL_FILES && info.filesToClear.empty() && info.filesToIndex.empty())
{
if (m_hasGUI)
std::wstring message;
if (info.mode != REFRESH_ALL_FILES && info.filesToClear.empty() && info.filesToIndex.empty())
{
dialogView->clearDialogs();
message = L"Nothing to refresh, all files are up-to-date.";
}
else
else if (m_sourceGroups.empty())
{
MessageIndexingFinished().dispatch();
message = L"Nothing to refresh, no Source Groups loaded.";
}
MessageStatus(L"Nothing to refresh, all files are up-to-date.").dispatch();
m_refreshStage = RefreshStageType::NONE;
return;
if (!message.empty())
{
if (m_hasGUI)
{
dialogView->clearDialogs();
}
else
{
MessageIndexingFinished().dispatch();
}
MessageStatus(message).dispatch();
m_refreshStage = RefreshStageType::NONE;
return;
}
}
if (info.mode != REFRESH_ALL_FILES && (info.filesToClear.size() || info.nonIndexedFilesToClear.size()))
@@ -520,11 +532,16 @@ void Project::buildIndex(RefreshInfo info, std::shared_ptr<DialogView> dialogVie
{
if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED)
{
if (sourceGroup->getType() == SOURCE_GROUP_CUSTOM_COMMAND ||
sourceGroup->getType() == SOURCE_GROUP_PYTHON_EMPTY)
if (sourceGroup->getType() == SOURCE_GROUP_CUSTOM_COMMAND)
{
customIndexerCommandProvider->addProvider(sourceGroup->getIndexerCommandProvider(info));
}
#if BUILD_PYTHON_LANGUAGE_PACKAGE
else if (sourceGroup->getType() == SOURCE_GROUP_PYTHON_EMPTY)
{
customIndexerCommandProvider->addProvider(sourceGroup->getIndexerCommandProvider(info));
}
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
else
{
indexerCommandProvider->addProvider(sourceGroup->getIndexerCommandProvider(info));
@@ -775,6 +792,7 @@ void Project::discardTempStorage()
bool Project::hasCxxSourceGroup() const
{
#if BUILD_CXX_LANGUAGE_PACKAGE
for (const std::shared_ptr<SourceGroup>& sourceGroup: m_sourceGroups)
{
if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED)
@@ -785,5 +803,6 @@ bool Project::hasCxxSourceGroup() const
}
}
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
return false;
}
+22 -4
View File
@@ -4,14 +4,20 @@ std::string languageTypeToString(LanguageType t)
{
switch (t)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
case LANGUAGE_C:
return "C";
case LANGUAGE_CPP:
return "C++";
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case LANGUAGE_JAVA:
return "Java";
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
case LANGUAGE_PYTHON:
return "Python";
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
case LANGUAGE_CUSTOM:
return "Custom";
case LANGUAGE_UNKNOWN:
@@ -22,23 +28,29 @@ std::string languageTypeToString(LanguageType t)
LanguageType stringToLanguageType(std::string s)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
if (s == languageTypeToString(LANGUAGE_C))
{
return LANGUAGE_C;
}
else if (s == languageTypeToString(LANGUAGE_CPP))
if (s == languageTypeToString(LANGUAGE_CPP))
{
return LANGUAGE_CPP;
}
else if (s == languageTypeToString(LANGUAGE_JAVA))
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
if (s == languageTypeToString(LANGUAGE_JAVA))
{
return LANGUAGE_JAVA;
}
else if (s == languageTypeToString(LANGUAGE_PYTHON))
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
if (s == languageTypeToString(LANGUAGE_PYTHON))
{
return LANGUAGE_PYTHON;
}
else if (s == languageTypeToString(LANGUAGE_CUSTOM))
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
if (s == languageTypeToString(LANGUAGE_CUSTOM))
{
return LANGUAGE_CUSTOM;
}
@@ -49,6 +61,7 @@ LanguageType getLanguageTypeForSourceGroupType(SourceGroupType t)
{
switch (t)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
case SOURCE_GROUP_C_EMPTY:
return LANGUAGE_C;
case SOURCE_GROUP_CPP_EMPTY:
@@ -59,14 +72,19 @@ LanguageType getLanguageTypeForSourceGroupType(SourceGroupType t)
return LANGUAGE_CPP;
case SOURCE_GROUP_CXX_VS:
return LANGUAGE_CPP;
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case SOURCE_GROUP_JAVA_EMPTY:
return LANGUAGE_JAVA;
case SOURCE_GROUP_JAVA_MAVEN:
return LANGUAGE_JAVA;
case SOURCE_GROUP_JAVA_GRADLE:
return LANGUAGE_JAVA;
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_PYTHON_EMPTY:
return LANGUAGE_PYTHON;
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_CUSTOM_COMMAND:
return LANGUAGE_CUSTOM;
default:
+6
View File
@@ -7,10 +7,16 @@
enum LanguageType
{
#if BUILD_CXX_LANGUAGE_PACKAGE
LANGUAGE_CPP,
LANGUAGE_C,
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
LANGUAGE_JAVA,
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
LANGUAGE_PYTHON,
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
LANGUAGE_CUSTOM,
LANGUAGE_UNKNOWN
};
+19 -3
View File
@@ -12,6 +12,7 @@
#include "SourceGroupSettingsJavaMaven.h"
#include "SourceGroupSettingsJavaGradle.h"
#include "SourceGroupSettingsPythonEmpty.h"
#include "SourceGroupSettingsUnloadable.h"
#include "logging.h"
#include "utilityFile.h"
#include "utilityString.h"
@@ -174,6 +175,7 @@ std::vector<std::shared_ptr<SourceGroupSettings>> ProjectSettings::getAllSourceG
switch (type)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
case SOURCE_GROUP_C_EMPTY:
settings = std::make_shared<SourceGroupSettingsCEmpty>(id, this);
break;
@@ -186,6 +188,8 @@ std::vector<std::shared_ptr<SourceGroupSettings>> ProjectSettings::getAllSourceG
case SOURCE_GROUP_CXX_CODEBLOCKS:
settings = std::make_shared<SourceGroupSettingsCxxCodeblocks>(id, this);
break;
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case SOURCE_GROUP_JAVA_EMPTY:
settings = std::make_shared<SourceGroupSettingsJavaEmpty>(id, this);
break;
@@ -195,14 +199,17 @@ std::vector<std::shared_ptr<SourceGroupSettings>> ProjectSettings::getAllSourceG
case SOURCE_GROUP_JAVA_GRADLE:
settings = std::make_shared<SourceGroupSettingsJavaGradle>(id, this);
break;
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_PYTHON_EMPTY:
settings = std::make_shared<SourceGroupSettingsPythonEmpty>(id, this);
break;
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_CUSTOM_COMMAND:
settings = std::make_shared<SourceGroupSettingsCustomCommand>(id, this);
break;
default:
continue;
settings = std::make_shared<SourceGroupSettingsUnloadable>(id, this);
}
if (settings)
@@ -307,6 +314,7 @@ SettingsMigrator ProjectSettings::getMigrations() const
const std::string language = migration->getValueFromSettings<std::string>(settings, "language_settings/language", "");
SourceGroupType type = SOURCE_GROUP_UNKNOWN;
#if BUILD_CXX_LANGUAGE_PACKAGE
if (language == "C" || language == "C++")
{
const std::string cdbPath = migration->getValueFromSettings<std::string>(settings, sourceGroupKey + "/build_file_path/compilation_db_path", "");
@@ -323,7 +331,9 @@ SettingsMigrator ProjectSettings::getMigrations() const
type = SOURCE_GROUP_CPP_EMPTY;
}
}
else if (language == "Java")
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
if (language == "Java")
{
const std::string mavenProjectFilePath = migration->getValueFromSettings<std::string>(settings, sourceGroupKey + "/maven/project_file_path", "");
if (!mavenProjectFilePath.empty())
@@ -340,7 +350,7 @@ SettingsMigrator ProjectSettings::getMigrations() const
type = SOURCE_GROUP_JAVA_EMPTY;
}
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
migration->setValueInSettings(settings, sourceGroupKey + "/type", sourceGroupTypeToString(type));
}
));
@@ -357,11 +367,13 @@ SettingsMigrator ProjectSettings::getMigrations() const
for (std::shared_ptr<SourceGroupSettings> sourceGroupSettings : getAllSourceGroupSettings())
{
#if BUILD_CXX_LANGUAGE_PACKAGE
if (sourceGroupSettings->getType() == SOURCE_GROUP_CXX_CDB)
{
const std::string key = SourceGroupSettings::s_keyPrefix + sourceGroupSettings->getId();
migrator.addMigration(6, std::make_shared<SettingsMigrationMoveKey>(key + "/source_paths/source_path", key + "/indexed_header_paths/indexed_header_path"));
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
}
for (std::shared_ptr<SourceGroupSettings> sourceGroupSettings : getAllSourceGroupSettings())
@@ -369,15 +381,19 @@ SettingsMigrator ProjectSettings::getMigrations() const
std::string languageName;
switch (getLanguageTypeForSourceGroupType(sourceGroupSettings->getType()))
{
#if BUILD_CXX_LANGUAGE_PACKAGE
case LANGUAGE_C:
languageName = "c";
break;
case LANGUAGE_CPP:
languageName = "cpp";
break;
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case LANGUAGE_JAVA:
languageName = "java";
break;
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
default:
continue;
}
@@ -4,6 +4,7 @@ std::string sourceGroupTypeToString(SourceGroupType v)
{
switch (v)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
case SOURCE_GROUP_C_EMPTY:
return "C Source Group";
case SOURCE_GROUP_CPP_EMPTY:
@@ -14,14 +15,19 @@ std::string sourceGroupTypeToString(SourceGroupType v)
return "C/C++ from Code::Blocks";
case SOURCE_GROUP_CXX_VS:
return "C/C++ from Visual Studio";
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case SOURCE_GROUP_JAVA_EMPTY:
return "Java Source Group";
case SOURCE_GROUP_JAVA_MAVEN:
return "Java Source Group from Maven";
case SOURCE_GROUP_JAVA_GRADLE:
return "Java Source Group from Gradle";
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_PYTHON_EMPTY:
return "Python Source Group";
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_CUSTOM_COMMAND:
return "Custom Command Source Group";
case SOURCE_GROUP_UNKNOWN:
@@ -34,6 +40,7 @@ std::string sourceGroupTypeToProjectSetupString(SourceGroupType v)
{
switch (v)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
case SOURCE_GROUP_C_EMPTY:
return "Empty C Source Group";
case SOURCE_GROUP_CPP_EMPTY:
@@ -44,14 +51,19 @@ std::string sourceGroupTypeToProjectSetupString(SourceGroupType v)
return "C/C++ from Code::Blocks";
case SOURCE_GROUP_CXX_VS:
return "C/C++ from Visual Studio";
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case SOURCE_GROUP_JAVA_EMPTY:
return "Empty Java Source Group";
case SOURCE_GROUP_JAVA_MAVEN:
return "Java Source Group from Maven";
case SOURCE_GROUP_JAVA_GRADLE:
return "Java Source Group from Gradle";
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_PYTHON_EMPTY:
return "Empty Python Source Group";
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_CUSTOM_COMMAND:
return "Custom Command Source Group";
case SOURCE_GROUP_UNKNOWN:
@@ -62,43 +74,49 @@ std::string sourceGroupTypeToProjectSetupString(SourceGroupType v)
SourceGroupType stringToSourceGroupType(const std::string& v)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
if (v == sourceGroupTypeToString(SOURCE_GROUP_C_EMPTY))
{
return SOURCE_GROUP_C_EMPTY;
}
else if (v == sourceGroupTypeToString(SOURCE_GROUP_CPP_EMPTY))
if (v == sourceGroupTypeToString(SOURCE_GROUP_CPP_EMPTY))
{
return SOURCE_GROUP_CPP_EMPTY;
}
else if (v == sourceGroupTypeToString(SOURCE_GROUP_CXX_CDB))
if (v == sourceGroupTypeToString(SOURCE_GROUP_CXX_CDB))
{
return SOURCE_GROUP_CXX_CDB;
}
else if (v == sourceGroupTypeToString(SOURCE_GROUP_CXX_CODEBLOCKS))
if (v == sourceGroupTypeToString(SOURCE_GROUP_CXX_CODEBLOCKS))
{
return SOURCE_GROUP_CXX_CODEBLOCKS;
}
else if (v == sourceGroupTypeToString(SOURCE_GROUP_CXX_VS))
if (v == sourceGroupTypeToString(SOURCE_GROUP_CXX_VS))
{
return SOURCE_GROUP_CXX_VS;
}
else if (v == sourceGroupTypeToString(SOURCE_GROUP_JAVA_EMPTY))
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
if (v == sourceGroupTypeToString(SOURCE_GROUP_JAVA_EMPTY))
{
return SOURCE_GROUP_JAVA_EMPTY;
}
else if (v == sourceGroupTypeToString(SOURCE_GROUP_JAVA_MAVEN))
if (v == sourceGroupTypeToString(SOURCE_GROUP_JAVA_MAVEN))
{
return SOURCE_GROUP_JAVA_MAVEN;
}
else if (v == sourceGroupTypeToString(SOURCE_GROUP_JAVA_GRADLE))
if (v == sourceGroupTypeToString(SOURCE_GROUP_JAVA_GRADLE))
{
return SOURCE_GROUP_JAVA_GRADLE;
}
else if (v == sourceGroupTypeToString(SOURCE_GROUP_PYTHON_EMPTY))
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
if (v == sourceGroupTypeToString(SOURCE_GROUP_PYTHON_EMPTY))
{
return SOURCE_GROUP_PYTHON_EMPTY;
}
else if (v == sourceGroupTypeToString(SOURCE_GROUP_CUSTOM_COMMAND))
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
if (v == sourceGroupTypeToString(SOURCE_GROUP_CUSTOM_COMMAND))
{
return SOURCE_GROUP_CUSTOM_COMMAND;
}
@@ -1,19 +1,27 @@
#ifndef SOURCE_GROUP_TYPE_H
#define SOURCE_GROUP_TYPE_H
#include "language_packages.h"
#include <string>
enum SourceGroupType
{
#if BUILD_CXX_LANGUAGE_PACKAGE
SOURCE_GROUP_C_EMPTY,
SOURCE_GROUP_CPP_EMPTY,
SOURCE_GROUP_CXX_CDB,
SOURCE_GROUP_CXX_CODEBLOCKS,
SOURCE_GROUP_CXX_VS,
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
SOURCE_GROUP_JAVA_EMPTY,
SOURCE_GROUP_JAVA_MAVEN,
SOURCE_GROUP_JAVA_GRADLE,
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
SOURCE_GROUP_PYTHON_EMPTY,
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
SOURCE_GROUP_CUSTOM_COMMAND,
SOURCE_GROUP_UNKNOWN
};
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithCStandard.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "ProjectSettings.h"
std::wstring SourceGroupSettingsWithCStandard::getDefaultCStandardStatic()
@@ -67,3 +69,5 @@ std::wstring SourceGroupSettingsWithCStandard::getDefaultCStandard() const
{
return getDefaultCStandardStatic();
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_C_STANDARD_H
#define SOURCE_GROUP_SETTINGS_WITH_C_STANDARD_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <vector>
#include "SourceGroupSettingsComponent.h"
@@ -30,4 +34,6 @@ private:
std::wstring m_cStandard;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_C_STANDARD_H
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithCppStandard.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "ProjectSettings.h"
std::wstring SourceGroupSettingsWithCppStandard::getDefaultCppStandardStatic()
@@ -67,3 +69,5 @@ std::wstring SourceGroupSettingsWithCppStandard::getDefaultCppStandard() const
{
return getDefaultCppStandardStatic();
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CPP_STANDARD_H
#define SOURCE_GROUP_SETTINGS_WITH_CPP_STANDARD_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <vector>
#include "SourceGroupSettingsComponent.h"
@@ -30,4 +34,6 @@ private:
std::wstring m_cppStandard;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_CPP_STANDARD_H
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithCxxCdbPath.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "ProjectSettings.h"
#include "utilityFile.h"
@@ -39,3 +41,5 @@ void SourceGroupSettingsWithCxxCdbPath::save(ConfigManager* config, const std::s
{
config->setValue(key + "/build_file_path/compilation_db_path", getCompilationDatabasePath().wstr());
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_CDB_PATH_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_CDB_PATH_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "FilePath.h"
#include "SourceGroupSettingsComponent.h"
@@ -24,4 +28,6 @@ private:
FilePath m_compilationDatabasePath;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_CDB_PATH_H
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithCxxCodeblocksPath.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "ProjectSettings.h"
#include "utilityFile.h"
@@ -38,3 +40,5 @@ void SourceGroupSettingsWithCxxCodeblocksPath::save(ConfigManager* config, const
{
config->setValue(key + "/codeblocks_project_path", getCodeblocksProjectPath().wstr());
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_CODEBLOCKS_PATH_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_CODEBLOCKS_PATH_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "FilePath.h"
#include "SourceGroupSettingsComponent.h"
@@ -24,4 +28,6 @@ private:
FilePath m_codeblocksProjectPath;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_CODEBLOCKS_PATH_H
@@ -1,7 +1,8 @@
#include "SourceGroupSettingsWithCxxCrossCompilationOptions.h"
#include "ProjectSettings.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "ProjectSettings.h"
std::vector<std::wstring> SourceGroupSettingsWithCxxCrossCompilationOptions::getAvailableArchTypes()
{
@@ -232,3 +233,5 @@ void SourceGroupSettingsWithCxxCrossCompilationOptions::save(ConfigManager* conf
config->setValue(key + "/cross_compilation/target/sys", getTargetSys());
config->setValue(key + "/cross_compilation/target/abi", getTargetAbi());
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_CROSS_COMPILATION_OPTIONS_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_CROSS_COMPILATION_OPTIONS_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <vector>
#include "SourceGroupSettingsComponent.h"
@@ -47,4 +51,6 @@ private:
std::wstring m_targetAbi;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_CROSS_COMPILATION_OPTIONS_H
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithCxxPathsAndFlags.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "ProjectSettings.h"
#include "utility.h"
@@ -69,3 +71,5 @@ void SourceGroupSettingsWithCxxPathsAndFlags::save(ConfigManager* config, const
config->setValues(key + "/framework_search_paths/framework_search_path", getFrameworkSearchPaths());
config->setValues(key + "/compiler_flags/compiler_flag", getCompilerFlags());
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_PATHS_AND_FLAGS_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_PATHS_AND_FLAGS_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <vector>
#include "FilePath.h"
@@ -35,4 +39,6 @@ private:
std::vector<std::wstring> m_compilerFlags;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_PATHS_AND_FLAGS_H
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithCxxPchOptions.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "ProjectSettings.h"
#include "utility.h"
#include "utilityFile.h"
@@ -70,3 +72,5 @@ void SourceGroupSettingsWithCxxPchOptions::setPchFlags(const std::vector<std::ws
{
m_pchFlags = pchFlags;
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_PCH_OPTIONS_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_PCH_OPTIONS_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "FilePath.h"
#include "SourceGroupSettingsComponent.h"
@@ -34,4 +38,6 @@ private:
bool m_useCompilerFlags = true;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_PCH_OPTIONS_H
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithIndexedHeaderPaths.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "ProjectSettings.h"
#include "utility.h"
@@ -38,3 +40,5 @@ void SourceGroupSettingsWithIndexedHeaderPaths::save(ConfigManager* config, cons
{
config->setValues(key + "/indexed_header_paths/indexed_header_path", getIndexedHeaderPaths());
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_INDEXED_HEADER_PATHS_H
#define SOURCE_GROUP_SETTINGS_WITH_INDEXED_HEADER_PATHS_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <vector>
#include "SourceGroupSettingsComponent.h"
@@ -27,4 +31,6 @@ private:
std::vector<FilePath> m_indexedHeaderPaths;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_INDEXED_HEADER_PATHS_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_SOURCE_EXTENSIONS_C_H
#define SOURCE_GROUP_SETTINGS_WITH_SOURCE_EXTENSIONS_C_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithSourceExtensions.h"
class SourceGroupSettingsWithSourceExtensionsC
@@ -13,4 +17,6 @@ private:
}
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_SOURCE_EXTENSIONS_C_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_SOURCE_EXTENSIONS_CPP_H
#define SOURCE_GROUP_SETTINGS_WITH_SOURCE_EXTENSIONS_CPP_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithSourceExtensions.h"
class SourceGroupSettingsWithSourceExtensionsCpp
@@ -17,4 +21,6 @@ private:
}
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_SOURCE_EXTENSIONS_CPP_H
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithClasspath.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "ProjectSettings.h"
#include "utility.h"
@@ -50,3 +52,5 @@ void SourceGroupSettingsWithClasspath::save(ConfigManager* config, const std::st
config->setValues(key + "/class_paths/class_path", getClasspath());
config->setValue(key + "/use_jre_system_library", getUseJreSystemLibrary());
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CLASSPATH_H
#define SOURCE_GROUP_SETTINGS_WITH_CLASSPATH_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include <vector>
#include "FilePath.h"
@@ -30,4 +34,6 @@ private:
bool m_useJreSystemLibrary = true;
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_CLASSPATH_H
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithJavaGradle.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "ConfigManager.h"
#include "ProjectSettings.h"
#include "utilityFile.h"
@@ -56,3 +58,5 @@ void SourceGroupSettingsWithJavaGradle::save(ConfigManager* config, const std::s
config->setValue(key + "/gradle/project_file_path", getGradleProjectFilePath().wstr());
config->setValue(key + "/gradle/should_index_tests", getShouldIndexGradleTests());
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_JAVA_GRADLE_H
#define SOURCE_GROUP_SETTINGS_WITH_JAVA_GRADLE_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "FilePath.h"
#include "SourceGroupSettingsComponent.h"
@@ -30,4 +34,6 @@ private:
bool m_shouldIndexGradleTests = false;
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_JAVA_GRADLE_H
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithJavaMaven.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "ConfigManager.h"
#include "ProjectSettings.h"
#include "utilityFile.h"
@@ -56,3 +58,5 @@ void SourceGroupSettingsWithJavaMaven::save(ConfigManager* config, const std::st
config->setValue(key + "/maven/project_file_path", getMavenProjectFilePath().wstr());
config->setValue(key + "/maven/should_index_tests", getShouldIndexMavenTests());
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_JAVA_MAVEN_H
#define SOURCE_GROUP_SETTINGS_WITH_JAVA_MAVEN_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "FilePath.h"
#include "SourceGroupSettingsComponent.h"
@@ -30,4 +34,6 @@ private:
bool m_shouldIndexMavenTests = false;
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_JAVA_MAVEN_H
@@ -1,5 +1,7 @@
#include "SourceGroupSettingsWithJavaStandard.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "ProjectSettings.h"
std::wstring SourceGroupSettingsWithJavaStandard::getDefaultJavaStandardStatic()
@@ -50,3 +52,5 @@ std::wstring SourceGroupSettingsWithJavaStandard::getDefaultJavaStandard() const
{
return getDefaultJavaStandardStatic();
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_JAVA_STANDARD_H
#define SOURCE_GROUP_SETTINGS_WITH_JAVA_STANDARD_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include <vector>
#include "SourceGroupSettingsComponent.h"
@@ -30,4 +34,6 @@ private:
std::wstring m_javaStandard;
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_JAVA_STANDARD_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_SOURCE_EXTENSIONS_JAVA_H
#define SOURCE_GROUP_SETTINGS_WITH_SOURCE_EXTENSIONS_JAVA_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithSourceExtensions.h"
class SourceGroupSettingsWithSourceExtensionsJava
@@ -13,4 +17,6 @@ private:
}
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_WITH_SOURCE_EXTENSIONS_JAVA_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_C_EMPTY_H
#define SOURCE_GROUP_SETTINGS_C_EMPTY_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithComponents.h"
#include "SourceGroupSettingsWithCStandard.h"
#include "SourceGroupSettingsWithCxxCrossCompilationOptions.h"
@@ -32,4 +36,6 @@ public:
}
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_C_EMPTY_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_CPP_EMPTY_H
#define SOURCE_GROUP_SETTINGS_CPP_EMPTY_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithComponents.h"
#include "SourceGroupSettingsWithCppStandard.h"
#include "SourceGroupSettingsWithCxxCrossCompilationOptions.h"
@@ -32,4 +36,6 @@ public:
}
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_CPP_EMPTY_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_CXX_CDB_H
#define SOURCE_GROUP_SETTINGS_CXX_CDB_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithComponents.h"
#include "SourceGroupSettingsWithCxxCdbPath.h"
#include "SourceGroupSettingsWithCxxPathsAndFlags.h"
@@ -28,4 +32,6 @@ public:
}
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_CXX_CDB_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_CXX_CDB_VS_H
#define SOURCE_GROUP_SETTINGS_CXX_CDB_VS_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "SourceGroupSettingsCxxCdb.h"
class SourceGroupSettingsCxxCdbVs
@@ -9,4 +13,6 @@ class SourceGroupSettingsCxxCdbVs
using SourceGroupSettingsCxxCdb::SourceGroupSettingsCxxCdb;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_CXX_CDB_VS_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_CXX_CODEBLOCKS_H
#define SOURCE_GROUP_SETTINGS_CXX_CODEBLOCKS_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithComponents.h"
#include "SourceGroupSettingsWithCppStandard.h"
#include "SourceGroupSettingsWithCStandard.h"
@@ -32,4 +36,6 @@ public:
}
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_CXX_CODEBLOCKS_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_JAVA_EMPTY_H
#define SOURCE_GROUP_SETTINGS_JAVA_EMPTY_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithComponents.h"
#include "SourceGroupSettingsWithClasspath.h"
#include "SourceGroupSettingsWithExcludeFilters.h"
@@ -28,4 +32,6 @@ public:
}
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_JAVA_EMPTY_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_JAVA_GRADLE_H
#define SOURCE_GROUP_SETTINGS_JAVA_GRADLE_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithComponents.h"
#include "SourceGroupSettingsWithExcludeFilters.h"
#include "SourceGroupSettingsWithJavaGradle.h"
@@ -26,4 +30,6 @@ public:
}
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_JAVA_GRADLE_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_JAVA_MAVEN_H
#define SOURCE_GROUP_SETTINGS_JAVA_MAVEN_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithComponents.h"
#include "SourceGroupSettingsWithExcludeFilters.h"
#include "SourceGroupSettingsWithJavaMaven.h"
@@ -26,4 +30,6 @@ public:
}
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_JAVA_MAVEN_H
@@ -1,6 +1,10 @@
#ifndef SOURCE_GROUP_SETTINGS_PYTHON_EMPTY_H
#define SOURCE_GROUP_SETTINGS_PYTHON_EMPTY_H
#include "language_packages.h"
#if BUILD_PYTHON_LANGUAGE_PACKAGE
#include "SourceGroupSettingsWithComponents.h"
#include "SourceGroupSettingsWithExcludeFilters.h"
#include "SourceGroupSettingsWithPythonEnvironmentPath.h"
@@ -26,4 +30,6 @@ public:
}
};
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
#endif // SOURCE_GROUP_SETTINGS_PYTHON_EMPTY_H
@@ -0,0 +1,73 @@
#ifndef SOURCE_GROUP_SETTINGS_UNLOADABLE_H
#define SOURCE_GROUP_SETTINGS_UNLOADABLE_H
#include "SourceGroupSettings.h"
class SourceGroupSettingsUnloadable : public SourceGroupSettings
{
public:
SourceGroupSettingsUnloadable(const std::string& id, const ProjectSettings* projectSettings)
: SourceGroupSettings(SOURCE_GROUP_UNKNOWN, id, projectSettings)
{
}
std::shared_ptr<SourceGroupSettings> createCopy() const override
{
return std::make_shared<SourceGroupSettingsUnloadable>(*this);
}
void loadSettings(const ConfigManager* config) override
{
const std::string key = s_keyPrefix + getId();
SourceGroupSettings::load(config, key);
setStatus(SOURCE_GROUP_STATUS_DISABLED);
m_content.clear();
std::vector<std::string> unprocessedKeys = { key };
while (!unprocessedKeys.empty())
{
const std::string unprocessedKey = unprocessedKeys.back();
unprocessedKeys.pop_back();
for (const std::string& memberKey : config->getSublevelKeys(unprocessedKey))
{
const std::vector<std::string> values = config->getValuesOrDefaults<std::string>(memberKey, {});
if (!values.empty())
{
m_content[memberKey] = values;
}
else
{
unprocessedKeys.push_back(memberKey);
}
}
}
}
void saveSettings(ConfigManager* config) override
{
for (auto it : m_content)
{
config->setValues(it.first, it.second);
}
}
bool equalsSettings(const SourceGroupSettingsBase* other) override
{
if (!SourceGroupSettings::equals(other))
{
return false;
}
//compare values
return true;
}
private:
std::map<std::string, std::vector<std::string>> m_content;
};
#endif // SOURCE_GROUP_SETTINGS_UNLOADABLE_H
+2
View File
@@ -208,6 +208,8 @@ add_files(
qt/project_wizard/content/QtProjectWizardContentSourceGroupData.h
qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.cpp
qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.h
qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp
qt/project_wizard/content/QtProjectWizardContentUnloadable.h
qt/project_wizard/content/QtProjectWizardContentVS.cpp
qt/project_wizard/content/QtProjectWizardContentVS.h
@@ -7,6 +7,8 @@
#include <QSysInfo>
#include <QTimer>
#include "language_packages.h"
#include "QtProjectWizardContent.h"
#include "QtProjectWizardContentCppStandard.h"
#include "QtProjectWizardContentCrossCompilationOptions.h"
@@ -37,6 +39,7 @@
#include "QtProjectWizardContentSelect.h"
#include "QtProjectWizardContentSourceGroupData.h"
#include "QtProjectWizardContentSourceGroupInfoText.h"
#include "QtProjectWizardContentUnloadable.h"
#include "QtProjectWizardContentVS.h"
#include "QtSourceGroupWizardPage.h"
#include "SourceGroupSettingsCEmpty.h"
@@ -49,6 +52,7 @@
#include "SourceGroupSettingsJavaGradle.h"
#include "SourceGroupSettingsJavaMaven.h"
#include "SourceGroupSettingsPythonEmpty.h"
#include "SourceGroupSettingsUnloadable.h"
#include "MessageLoadProject.h"
#include "MessageStatus.h"
#include "ResourcePaths.h"
@@ -62,6 +66,9 @@
namespace
{
#if BUILD_CXX_LANGUAGE_PACKAGE
bool applicationSettingsContainVisualStudioHeaderSearchPaths()
{
std::vector<FilePath> expandedPaths;
@@ -102,9 +109,13 @@ namespace
}
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
template <typename SettingsType>
std::vector<QtSourceGroupWizardPage<SettingsType>> getSourceGroupWizardPages();
#if BUILD_CXX_LANGUAGE_PACKAGE
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCEmpty>> getSourceGroupWizardPages<SourceGroupSettingsCEmpty>()
{
@@ -310,6 +321,10 @@ namespace
return pages;
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
template<>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty>> getSourceGroupWizardPages<SourceGroupSettingsJavaEmpty>()
{
@@ -375,6 +390,8 @@ namespace
return pages;
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
template<>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsPythonEmpty>> getSourceGroupWizardPages<SourceGroupSettingsPythonEmpty>()
@@ -392,6 +409,8 @@ namespace
return pages;
}
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
template<>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCustomCommand>> getSourceGroupWizardPages<SourceGroupSettingsCustomCommand>()
{
@@ -407,6 +426,18 @@ namespace
return pages;
}
template<>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsUnloadable>> getSourceGroupWizardPages<SourceGroupSettingsUnloadable>()
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsUnloadable>> pages;
{
QtSourceGroupWizardPage<SourceGroupSettingsUnloadable> page("");
page.addContentCreatorWithSettings<QtProjectWizardContentUnloadable>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
return pages;
}
template <typename SettingsType>
void fillSummary(QtProjectWizardContentGroup* summary, std::shared_ptr<SettingsType> settings, QtProjectWizardWindow* window)
{
@@ -456,6 +487,7 @@ void QtProjectWizard::newProject()
void QtProjectWizard::newProjectFromCDB(const FilePath& filePath)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
if (!m_projectSettings)
{
m_projectSettings = std::make_shared<ProjectSettings>();
@@ -482,6 +514,7 @@ void QtProjectWizard::newProjectFromCDB(const FilePath& filePath)
sourceGroupSettings->setCompilationDatabasePath(filePath);
executeSourceGroupSetup<SourceGroupSettingsCxxCdbVs>(sourceGroupSettings);
#endif // BUILD_CXX_LANGUAGE_PACKAGE
}
void QtProjectWizard::editProject(const FilePath& settingsPath)
@@ -790,7 +823,16 @@ void QtProjectWizard::selectedSourceGroupChanged(int index)
summary->addContent(content);
summary->addSpace();
if (std::shared_ptr<SourceGroupSettingsCEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsCEmpty>(group))
if (std::shared_ptr<SourceGroupSettingsCustomCommand> settings = std::dynamic_pointer_cast<SourceGroupSettingsCustomCommand>(group))
{
fillSummary(summary, settings, this);
}
if (std::shared_ptr<SourceGroupSettingsUnloadable> settings = std::dynamic_pointer_cast<SourceGroupSettingsUnloadable>(group))
{
fillSummary(summary, settings, this);
}
#if BUILD_CXX_LANGUAGE_PACKAGE
else if (std::shared_ptr<SourceGroupSettingsCEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsCEmpty>(group))
{
fillSummary(summary, settings, this);
}
@@ -810,6 +852,8 @@ void QtProjectWizard::selectedSourceGroupChanged(int index)
{
fillSummary(summary, settings, this);
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
else if (std::shared_ptr<SourceGroupSettingsJavaEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaEmpty>(group))
{
fillSummary(summary, settings, this);
@@ -822,14 +866,13 @@ void QtProjectWizard::selectedSourceGroupChanged(int index)
{
fillSummary(summary, settings, this);
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
else if (std::shared_ptr<SourceGroupSettingsPythonEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsPythonEmpty>(group))
{
fillSummary(summary, settings, this);
}
else if (std::shared_ptr<SourceGroupSettingsCustomCommand> settings = std::dynamic_pointer_cast<SourceGroupSettingsCustomCommand>(group))
{
fillSummary(summary, settings, this);
}
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
setContent(summary);
@@ -1004,6 +1047,7 @@ void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType)
switch (sourceGroupType)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
case SOURCE_GROUP_C_EMPTY:
{
std::shared_ptr<SourceGroupSettingsCEmpty> settings = std::make_shared<SourceGroupSettingsCEmpty>(sourceGroupId, m_projectSettings.get());
@@ -1037,6 +1081,8 @@ void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType)
executeSourceGroupSetup<SourceGroupSettingsCxxCdbVs>(settings);
}
break;
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case SOURCE_GROUP_JAVA_EMPTY:
{
std::shared_ptr<SourceGroupSettingsJavaEmpty> settings = std::make_shared<SourceGroupSettingsJavaEmpty>(sourceGroupId, m_projectSettings.get());
@@ -1055,12 +1101,15 @@ void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType)
executeSourceGroupSetup<SourceGroupSettingsJavaGradle>(settings);
}
break;
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_PYTHON_EMPTY:
{
std::shared_ptr<SourceGroupSettingsPythonEmpty> settings = std::make_shared<SourceGroupSettingsPythonEmpty>(sourceGroupId, m_projectSettings.get());
executeSourceGroupSetup<SourceGroupSettingsPythonEmpty>(settings);
}
break;
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_CUSTOM_COMMAND:
{
std::shared_ptr<SourceGroupSettingsCustomCommand> settings = std::make_shared<SourceGroupSettingsCustomCommand>(sourceGroupId, m_projectSettings.get());
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentCStandard.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <QComboBox>
#include <QLabel>
@@ -46,3 +48,5 @@ void QtProjectWizardContentCStandard::save()
m_sourceGroupSettings->setCStandard(m_standard->currentText().toStdWString());
}
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_C_STANDARD
#define QT_PROJECT_WIZARD_CONTENT_C_STANDARD
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContent.h"
class QComboBox;
@@ -28,4 +32,6 @@ private:
QComboBox* m_standard;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_C_STANDARD
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentCppStandard.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <QComboBox>
#include <QLabel>
@@ -46,3 +48,5 @@ void QtProjectWizardContentCppStandard::save()
m_sourceGroupSettings->setCppStandard(m_standard->currentText().toStdWString());
}
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_CPP_STANDARD
#define QT_PROJECT_WIZARD_CONTENT_CPP_STANDARD
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContent.h"
class QComboBox;
@@ -28,4 +32,6 @@ private:
QComboBox* m_standard;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_CPP_STANDARD
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentCrossCompilationOptions.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <QCheckBox>
#include <QComboBox>
#include <QLabel>
@@ -165,3 +167,5 @@ void QtProjectWizardContentCrossCompilationOptions::updateTargetOptionsEnabled()
m_sys->setEnabled(useTargetOptions);
m_abi->setEnabled(useTargetOptions);
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_CROSS_COMPILATION_OPTIONS
#define QT_PROJECT_WIZARD_CONTENT_CROSS_COMPILATION_OPTIONS
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContent.h"
class QCheckBox;
@@ -38,4 +42,6 @@ private:
QComboBox* m_abi;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_CROSS_COMPILATION_OPTIONS
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentCxxPchFlags.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <QCheckBox>
#include <QMessageBox>
@@ -83,3 +85,5 @@ bool QtProjectWizardContentCxxPchFlags::check()
return true;
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_CXX_PCH_FLAGS_H
#define QT_PROJECT_WIZARD_CONTENT_CXX_PCH_FLAGS_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContent.h"
class QCheckBox;
@@ -34,4 +38,6 @@ private:
QtStringListBox* m_list;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_CXX_PCH_FLAGS_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentFlags.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <QFormLayout>
#include <QMessageBox>
@@ -69,3 +71,5 @@ bool QtProjectWizardContentFlags::check()
return true;
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_FLAGS_H
#define QT_PROJECT_WIZARD_CONTENT_FLAGS_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContent.h"
class QtStringListBox;
@@ -32,4 +36,6 @@ private:
QtStringListBox* m_list;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_FLAGS_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentJavaStandard.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include <QComboBox>
#include <QLabel>
@@ -46,3 +48,5 @@ void QtProjectWizardContentJavaStandard::save()
m_sourceGroupSettings->setJavaStandard(m_standard->currentText().toStdWString());
}
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_JAVA_STANDARD
#define QT_PROJECT_WIZARD_CONTENT_JAVA_STANDARD
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "QtProjectWizardContent.h"
class QComboBox;
@@ -28,4 +32,6 @@ private:
QComboBox* m_standard;
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_JAVA_STANDARD
@@ -48,6 +48,7 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
// define which kind of source groups are available for each language
std::map<LanguageType, std::vector<SourceGroupInfo>> sourceGroupInfos;
#if BUILD_CXX_LANGUAGE_PACKAGE
sourceGroupInfos[LANGUAGE_C].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_CDB, true));
sourceGroupInfos[LANGUAGE_C].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_VS));
sourceGroupInfos[LANGUAGE_C].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_CODEBLOCKS));
@@ -56,25 +57,37 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
sourceGroupInfos[LANGUAGE_CPP].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_VS));
sourceGroupInfos[LANGUAGE_CPP].push_back(SourceGroupInfo(SOURCE_GROUP_CXX_CODEBLOCKS));
sourceGroupInfos[LANGUAGE_CPP].push_back(SourceGroupInfo(SOURCE_GROUP_CPP_EMPTY));
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
sourceGroupInfos[LANGUAGE_JAVA].push_back(SourceGroupInfo(SOURCE_GROUP_JAVA_MAVEN));
sourceGroupInfos[LANGUAGE_JAVA].push_back(SourceGroupInfo(SOURCE_GROUP_JAVA_GRADLE));
sourceGroupInfos[LANGUAGE_JAVA].push_back(SourceGroupInfo(SOURCE_GROUP_JAVA_EMPTY));
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
sourceGroupInfos[LANGUAGE_PYTHON].push_back(SourceGroupInfo(SOURCE_GROUP_PYTHON_EMPTY));
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
sourceGroupInfos[LANGUAGE_CUSTOM].push_back(SourceGroupInfo(SOURCE_GROUP_CUSTOM_COMMAND));
// define which icons should be used for which kind of source group
#if BUILD_CXX_LANGUAGE_PACKAGE
m_sourceGroupTypeIconName[SOURCE_GROUP_C_EMPTY] = L"empty_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_CPP_EMPTY] = L"empty_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_CDB] = L"cdb_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_VS] = L"vs_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_CODEBLOCKS] = L"cbp_icon";
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_EMPTY] = L"empty_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_MAVEN] = L"mvn_icon";
m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_GRADLE] = L"gradle_icon";
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
m_sourceGroupTypeIconName[SOURCE_GROUP_PYTHON_EMPTY] = L"empty_icon";
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
m_sourceGroupTypeIconName[SOURCE_GROUP_CUSTOM_COMMAND] = L"empty_icon";
// define descriptions for each kind of Source Group
#if BUILD_CXX_LANGUAGE_PACKAGE
m_sourceGroupTypeDescriptions[SOURCE_GROUP_C_EMPTY] = "Create a new Source Group by defining which C files will be indexed.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CPP_EMPTY] = "Create a new Source Group by defining which C++ files will be indexed.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_CDB] =
@@ -89,9 +102,13 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_CODEBLOCKS] =
"<p>Create a new Source Group from an existing Code::Blocks project file.</p>"
"<p><b>Note</b>: A \".cbp\" file will also get generated by the <b>Qt Creator</b> if a CMakeLists file is imported.</p>";
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_EMPTY] = "Create a new Source Group by defining which Java files will be indexed.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_MAVEN] = "Create a new Source Group from an existing Maven project.";
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_GRADLE] = "Create a new Source Group from an existing Gradle project.";
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
m_sourceGroupTypeDescriptions[SOURCE_GROUP_PYTHON_EMPTY] =
"<p>Create a new Source Group by defining which Python files will be indexed. This Source Group type uses the "
"<a href=\"https://github.com/CoatiSoftware/SourcetrailPythonIndexer\">SourcetrailPythonIndexer</a> " + pythonIndexerVersion + "in the "
@@ -99,6 +116,7 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
"<p><b>Note</b>: Python support is still in its <b>beta</b> phase. If you want to update the version of the SourcetrailPythonIndexer which is used "
"by Sourcetrail, download the latest release package for your operating system from the linked repository and completely replace the contents of your "
"\"Sourcetrail/data/python\" folder with the contents of the downloaded package.</p>";
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CUSTOM_COMMAND] = "Create a new Source Group executing a custom command on each source file. "
"This Source Group type can be used on <a href=\"https://github.com/CoatiSoftware/SourcetrailDB\">SourcetrailDB</a> binaries that add "
"custom language support to Sourcetrail.<br /><br />Current Database Version: " + std::to_string(SqliteIndexStorage::getStorageVersion());
@@ -12,7 +12,7 @@ public:
QtProjectWizardContentSourceGroupInfoText(QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
void populate(QGridLayout* layout, int& row) override;
};
#endif // QT_PROJECT_WIZARD_CONTENT_SOURCE_GROUP_INFO_TEXT_H
@@ -0,0 +1,44 @@
#include "QtProjectWizardContentUnloadable.h"
#include <QCheckBox>
#include <QLineEdit>
#include <QMessageBox>
#include <boost/filesystem/path.hpp>
#include "FileSystem.h"
#include "ProjectSettings.h"
#include "SourceGroupSettingsCustomCommand.h"
#include "SqliteIndexStorage.h"
QtProjectWizardContentUnloadable::QtProjectWizardContentUnloadable(
std::shared_ptr<SourceGroupSettingsUnloadable> settings,
QtProjectWizardWindow* window
)
: QtProjectWizardContent(window)
, m_settings(settings)
{
}
void QtProjectWizardContentUnloadable::populate(QGridLayout* layout, int& row)
{
QHBoxLayout* layoutHorz = new QHBoxLayout();
layout->addLayout(
layoutHorz,
row, QtProjectWizardWindow::FRONT_COL,
1, 1 + QtProjectWizardWindow::BACK_COL - QtProjectWizardWindow::FRONT_COL,
Qt::AlignTop
);
layoutHorz->addSpacing(60);
QLabel* infoLabel = new QLabel(
"<p>The selected item uses a Source Group type that is not supportetd by this version of Sourcetrail.</p>"
);
infoLabel->setObjectName("info");
infoLabel->setWordWrap(true);
layoutHorz->addWidget(infoLabel);
layoutHorz->addSpacing(40);
row++;
}
@@ -0,0 +1,25 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_UNLOADABLE_H
#define QT_PROJECT_WIZARD_CONTENT_UNLOADABLE_H
#include "QtProjectWizardContent.h"
class SourceGroupSettingsUnloadable;
class QtProjectWizardContentUnloadable
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizardContentUnloadable(
std::shared_ptr<SourceGroupSettingsUnloadable> settings,
QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
void populate(QGridLayout* layout, int& row) override;
private:
std::shared_ptr<SourceGroupSettingsUnloadable> m_settings;
};
#endif // QT_PROJECT_WIZARD_CONTENT_UNLOADABLE_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentVS.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "MessageIDECreateCDB.h"
QtProjectWizardContentVS::QtProjectWizardContentVS(QtProjectWizardWindow* window)
@@ -44,3 +46,5 @@ void QtProjectWizardContentVS::handleVSCDBClicked()
{
MessageIDECreateCDB().dispatch();
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_VS_H
#define QT_PROJECT_WIZARD_CONTENT_VS_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContent.h"
class QtProjectWizardContentVS
@@ -17,4 +21,6 @@ private slots:
void handleVSCDBClicked();
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_VS_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathCDB.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPathsIndexedHeaders.h"
#include "SourceGroupCxxCdb.h"
#include "SourceGroupSettingsCxxCdb.h"
@@ -133,3 +135,5 @@ std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathCDB::getSourceGro
{
return m_settings;
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_CDB_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_CDB_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPath.h"
#include "SingleValueCache.h"
@@ -37,4 +41,6 @@ private:
mutable SingleValueCache<std::vector<FilePath>> m_filePaths;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_CDB_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathCodeblocksProject.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPathsIndexedHeaders.h"
#include "SourceGroupCxxCodeblocks.h"
#include "SourceGroupSettingsCxxCodeblocks.h"
@@ -113,3 +115,5 @@ std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathCodeblocksProject
{
return m_settings;
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_CODE_BLOCKS_PROJECT_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_CODE_BLOCKS_PROJECT_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPath.h"
#include "SingleValueCache.h"
@@ -37,4 +41,6 @@ private:
mutable SingleValueCache<std::vector<FilePath>> m_filePaths;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_CODE_BLOCKS_PROJECT_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathCxxPch.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <QMessageBox>
#include "IndexerCommandCxx.h"
@@ -108,3 +110,5 @@ std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathCxxPch::getSource
{
return m_settings;
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_CXX_PCH_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_CXX_PCH_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPath.h"
#include "SingleValueCache.h"
@@ -31,4 +35,6 @@ private:
std::shared_ptr<SourceGroupSettingsWithCxxPchOptions> m_settingsCxxPch;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_CXX_PCH_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathPythonEnvironment.h"
#if BUILD_PYTHON_LANGUAGE_PACKAGE
#include "ResourcePaths.h"
#include "SourceGroupSettingsPythonEmpty.h"
#include "utilityApp.h"
@@ -89,3 +91,5 @@ std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathPythonEnvironment
{
return m_settings;
}
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_PYTHON_ENVIRONMENT_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_PYTHON_ENVIRONMENT_H
#include "language_packages.h"
#if BUILD_PYTHON_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPath.h"
#include "QtThreadedFunctor.h"
@@ -27,4 +31,6 @@ private:
QLabel* m_resultLabel;
};
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_PYTHON_ENVIRONMENT_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathSourceGradle.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include <QCheckBox>
#include "Application.h"
@@ -71,3 +73,5 @@ std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathSourceGradle::get
{
return m_settings;
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_GRADLE_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_GRADLE_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPath.h"
class QCheckBox;
@@ -30,4 +34,6 @@ private:
QCheckBox* m_shouldIndexTests;
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_GRADLE_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathSourceMaven.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include <QCheckBox>
#include "Application.h"
@@ -101,3 +103,5 @@ std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathSourceMaven::getS
{
return m_settings;
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_MAVEN_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_MAVEN_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPath.h"
class QCheckBox;
@@ -30,4 +34,6 @@ private:
QCheckBox* m_shouldIndexTests;
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_MAVEN_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathsClassJava.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include <QCheckBox>
#include "SourceGroupSettings.h"
@@ -54,3 +56,5 @@ void QtProjectWizardContentPathsClassJava::save()
settings->setUseJreSystemLibrary(m_useJreSystemLibraryCheckBox->isChecked());
}
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_CLASS_JAVA_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_CLASS_JAVA_H
#include "language_packages.h"
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPaths.h"
class QCheckBox;
@@ -21,4 +25,6 @@ private:
QCheckBox* m_useJreSystemLibraryCheckBox;
};
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_CLASS_JAVA_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathsFrameworkSearch.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "SourceGroupSettings.h"
#include "SourceGroupSettingsWithCxxPathsAndFlags.h"
@@ -41,3 +43,5 @@ bool QtProjectWizardContentPathsFrameworkSearch::isScrollAble() const
{
return true;
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPaths.h"
class QtProjectWizardContentPathsFrameworkSearch
@@ -18,4 +22,6 @@ public:
virtual bool isScrollAble() const override;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathsFrameworkSearchGlobal.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "ApplicationSettings.h"
#include "utilityPathDetection.h"
@@ -32,3 +34,5 @@ void QtProjectWizardContentPathsFrameworkSearchGlobal::save()
ApplicationSettings::getInstance()->setFrameworkSearchPaths(m_list->getPathsAsDisplayed());
ApplicationSettings::getInstance()->save();
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_GLOBAL_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_GLOBAL_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPaths.h"
class QtProjectWizardContentPathsFrameworkSearchGlobal
@@ -15,4 +19,6 @@ public:
virtual void save() override;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_GLOBAL_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathsHeaderSearch.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <cmath>
#include <QMessageBox>
@@ -397,3 +399,5 @@ void QtProjectWizardContentPathsHeaderSearch::showValidationResult(const std::ve
connect(m_filesDialog.get(), &QtTextEditDialog::canceled, this, &QtProjectWizardContentPathsHeaderSearch::closedFilesDialog);
}
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "FilePathFilter.h"
#include "QtProjectWizardContentPaths.h"
@@ -39,4 +43,6 @@ private:
const bool m_indicateAsAdditional;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathsHeaderSearchGlobal.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <QMessageBox>
#include "ApplicationSettings.h"
@@ -110,3 +112,5 @@ void QtProjectWizardContentPathsHeaderSearchGlobal::setPaths(const std::vector<F
m_list->addPaths({ ResourcePaths::getCxxCompilerHeaderPath() }, true);
m_list->addPaths(paths);
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_GLOBAL_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_GLOBAL_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPaths.h"
class QtProjectWizardContentPathsHeaderSearchGlobal
@@ -23,4 +27,6 @@ private:
void setPaths(const std::vector<FilePath>& paths);
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_GLOBAL_H
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathsIndexedHeaders.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include <QMessageBox>
#include "CodeblocksProject.h"
@@ -251,3 +253,5 @@ void QtProjectWizardContentPathsIndexedHeaders::savedFilesDialog()
m_list->setPaths(dynamic_cast<QtSelectPathsDialog*>(m_filesDialog.get())->getPathsList());
closedFilesDialog();
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -1,6 +1,10 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_INDEXED_HEADER_PATHS_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_INDEXED_HEADER_PATHS_H
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "QtProjectWizardContentPaths.h"
class SourceGroupSettingsCxxCdb;
@@ -34,4 +38,6 @@ private:
const std::string m_projectKindName;
};
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_INDEXED_HEADER_PATHS_H
@@ -1,17 +1,28 @@
#include "QtProjectWizardContentPathsSource.h"
#include "language_packages.h"
#include "SourceGroupCustomCommand.h"
#include "SourceGroupCxxEmpty.h"
#include "SourceGroupJavaEmpty.h"
#include "SourceGroupPythonEmpty.h"
#include "SourceGroupSettingsCustomCommand.h"
#include "SourceGroupSettingsJavaEmpty.h"
#include "SourceGroupSettingsPythonEmpty.h"
#include "SourceGroupSettingsWithCxxPathsAndFlags.h"
#include "SourceGroupSettingsWithSourcePaths.h"
#include "utility.h"
#include "utilityFile.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "SourceGroupCxxEmpty.h"
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "SourceGroupJavaEmpty.h"
#include "SourceGroupSettingsJavaEmpty.h"
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
#include "SourceGroupPythonEmpty.h"
#include "SourceGroupSettingsPythonEmpty.h"
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
QtProjectWizardContentPathsSource::QtProjectWizardContentPathsSource(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window
)
@@ -50,19 +61,29 @@ void QtProjectWizardContentPathsSource::save()
std::vector<FilePath> QtProjectWizardContentPathsSource::getFilePaths() const
{
std::set<FilePath> allSourceFilePaths;
#if BUILD_CXX_LANGUAGE_PACKAGE
if (std::dynamic_pointer_cast<SourceGroupSettingsWithCxxPathsAndFlags>(m_settings))
{
allSourceFilePaths = SourceGroupCxxEmpty(m_settings).getAllSourceFilePaths();
}
else if (std::shared_ptr<SourceGroupSettingsJavaEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaEmpty>(m_settings))
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
if (std::shared_ptr<SourceGroupSettingsJavaEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaEmpty>(m_settings))
{
allSourceFilePaths = SourceGroupJavaEmpty(settings).getAllSourceFilePaths();
}
else if (std::shared_ptr<SourceGroupSettingsPythonEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsPythonEmpty>(m_settings))
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
if (std::shared_ptr<SourceGroupSettingsPythonEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsPythonEmpty>(m_settings))
{
allSourceFilePaths = SourceGroupPythonEmpty(settings).getAllSourceFilePaths();
}
else if (std::shared_ptr<SourceGroupSettingsCustomCommand> settings = std::dynamic_pointer_cast<SourceGroupSettingsCustomCommand>(m_settings))
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
if (std::shared_ptr<SourceGroupSettingsCustomCommand> settings = std::dynamic_pointer_cast<SourceGroupSettingsCustomCommand>(m_settings))
{
allSourceFilePaths = SourceGroupCustomCommand(settings).getAllSourceFilePaths();
}
@@ -1,5 +1,7 @@
#include "QtPreferencesWindow.h"
#include "language_packages.h"
#include "MessageLoadProject.h"
#include "MessagePluginPortChange.h"
#include "MessageRefreshUI.h"
@@ -32,11 +34,13 @@ QtPreferencesWindow::QtPreferencesWindow(QWidget* parent)
summary->setIsForm(true);
summary->addContent(new QtProjectWizardContentPreferences(this));
#if BUILD_CXX_LANGUAGE_PACKAGE
summary->addContent(new QtProjectWizardContentPathsHeaderSearchGlobal(this));
if (utility::getOsType() == OS_MAC)
{
summary->addContent(new QtProjectWizardContentPathsFrameworkSearchGlobal(this));
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
setPreferredSize(QSize(750, 500));
setContent(summary);
+10 -4
View File
@@ -107,18 +107,24 @@ void QtStartScreen::updateButtons()
LanguageType lang = ProjectSettings::getLanguageOfProject(recentProjects[i]);
switch (lang)
{
case LanguageType::LANGUAGE_C:
#if BUILD_CXX_LANGUAGE_PACKAGE
case LanguageType::LANGUAGE_C:
button->setIcon(m_cIcon);
break;
case LANGUAGE_CPP:
button->setIcon(m_cppIcon);
break;
case LANGUAGE_PYTHON:
button->setIcon(m_pythonIcon);
break;
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case LANGUAGE_JAVA:
button->setIcon(m_javaIcon);
break;
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
case LANGUAGE_PYTHON:
button->setIcon(m_pythonIcon);
break;
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
default:
button->setIcon(m_projectIcon);
break;
@@ -1,5 +1,9 @@
#include "catch.hpp"
#include "language_packages.h"
#if BUILD_CXX_LANGUAGE_PACKAGE
#include "TextAccess.h"
#include "IncludeDirective.h"
#include "IncludeProcessing.h"
@@ -143,3 +147,5 @@ TEST_CASE("header search path detection finds path included in future header sea
FilePath(L"data/CxxIncludeProcessingTestSuite/test_header_search_path_detection_finds_path_included_in_future_header_search_path/include_b").makeAbsolute()
));
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE

Some files were not shown because too many files have changed in this diff Show More