diff --git a/CMakeLists.txt b/CMakeLists.txt index dca9c119..3b5773c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,17 @@ cmake_minimum_required(VERSION 3.1) -#set (CMAKE_VERBOSE_MAKEFILE ON) -set (BINARY_DIR ${CMAKE_BINARY_DIR}) +set(BUILD_CXX_LANGUAGE_PACKAGE OFF CACHE BOOL "Add C and C++ support to the Sourcetrail indexer.") +set(BUILD_JAVA_LANGUAGE_PACKAGE OFF CACHE BOOL "Add Java support to the Sourcetrail indexer.") +set(BUILD_PYTHON_LANGUAGE_PACKAGE OFF CACHE BOOL "Add Python support to the Sourcetrail indexer.") + + +configure_file( + "${CMAKE_SOURCE_DIR}/cmake/language_packages.h.in" + "${CMAKE_BINARY_DIR}/src/lib/language_packages.h" +) + +#set (CMAKE_VERBOSE_MAKEFILE ON) include(cmake/add_files.cmake) include(cmake/create_source_groups.cmake) @@ -13,9 +22,9 @@ include(cmake/licenses.cmake) # prohibit in-source-builds IF(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) - MESSAGE(STATUS "In-source-builds are not allowed") - MESSAGE(STATUS "Clean your source directory (e.g. delete the CMakeCache.txt file)") - MESSAGE(FATAL_ERROR "Please create a separate build directory and call CMake again") + MESSAGE(STATUS "In-source-builds are not allowed") + MESSAGE(STATUS "Clean your source directory (e.g. delete the CMakeCache.txt file)") + MESSAGE(FATAL_ERROR "Please create a separate build directory and call CMake again") ENDIF(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) @@ -92,26 +101,30 @@ endif() # Clang ------------------------------------------------------------------------ -if (UNIX AND APPLE) - if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") - find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build_release/lib/cmake/llvm" NO_DEFAULT_PATH) +if (BUILD_CXX_LANGUAGE_PACKAGE) + + if (UNIX AND APPLE) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") + find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build_release/lib/cmake/llvm" NO_DEFAULT_PATH) + else() + find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build_debug/lib/cmake/llvm" NO_DEFAULT_PATH) + endif() + elseif(UNIX) + find_package(LLVM REQUIRED PATHS "$ENV{LLVM_DIR}/lib/cmake" ) else() - find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build_debug/lib/cmake/llvm" NO_DEFAULT_PATH) - endif() -elseif(UNIX) - find_package(LLVM REQUIRED PATHS "$ENV{LLVM_DIR}/lib/cmake" ) -else() - if(${WINXXBITS} STREQUAL "Win32") - find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build_win32/lib/cmake/llvm") - else() - find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build_win64/lib/cmake/llvm") + if(${WINXXBITS} STREQUAL "Win32") + find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build_win32/lib/cmake/llvm") + else() + find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build_win64/lib/cmake/llvm") + endif() endif() + + find_package(CLANG REQUIRED PATHS "${CMAKE_SOURCE_DIR}/cmake" NO_DEFAULT_PATH) + + add_definitions(${CLANG_DEFINITIONS}) + endif() -find_package(CLANG REQUIRED PATHS "${CMAKE_SOURCE_DIR}/cmake" NO_DEFAULT_PATH) - -add_definitions(${CLANG_DEFINITIONS}) - # Boost ------------------------------------------------------------------------ @@ -299,6 +312,7 @@ set_property( "${LIB_UTILITY_INCLUDE_PATHS}" "${LIB_CXX_INCLUDE_PATHS}" "${LIB_JAVA_INCLUDE_PATHS}" + "${CMAKE_BINARY_DIR}/src/lib" ) target_include_directories(${LIB_PROJECT_NAME} SYSTEM @@ -312,116 +326,138 @@ target_link_libraries(${LIB_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${Boost_LI # Lib Cxx ---------------------------------------------------------------------- -add_library(${LIB_CXX_PROJECT_NAME} ${LIB_CXX_FILES}) +if (BUILD_CXX_LANGUAGE_PACKAGE) -create_source_groups(${LIB_CXX_FILES}) + add_library(${LIB_CXX_PROJECT_NAME} ${LIB_CXX_FILES}) -set_property( - TARGET ${LIB_CXX_PROJECT_NAME} - PROPERTY INCLUDE_DIRECTORIES - "${LIB_CXX_INCLUDE_PATHS}" - "${LIB_UTILITY_INCLUDE_PATHS}" - "${LIB_INCLUDE_PATHS}" -) + create_source_groups(${LIB_CXX_FILES}) -target_include_directories(${LIB_CXX_PROJECT_NAME} SYSTEM - PUBLIC ${LLVM_INCLUDE_DIRS} - ${CLANG_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - "${EXTERNAL_INCLUDE_PATHS}" - "${EXTERNAL_C_INCLUDE_PATHS}" -) + set_property( + TARGET ${LIB_CXX_PROJECT_NAME} + PROPERTY INCLUDE_DIRECTORIES + "${LIB_CXX_INCLUDE_PATHS}" + "${LIB_UTILITY_INCLUDE_PATHS}" + "${LIB_INCLUDE_PATHS}" + "${CMAKE_BINARY_DIR}/src/lib" + ) -link_directories(${LLVM_LIBRARY_DIRS} ${CLANG_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS}) -llvm_map_components_to_libnames(REQ_LLVM_LIBS - support core libdriver passes - x86asmparser x86codegen - aarch64asmparser aarch64codegen - amdgpuasmparser amdgpucodegen - armasmparser armcodegen - bpfasmparser bpfcodegen - hexagonasmparser hexagoncodegen - lanaiasmparser lanaicodegen - mipsasmparser mipscodegen - msp430asmparser msp430codegen - nvptxcodegen - powerpcasmparser powerpccodegen - sparcasmparser sparccodegen - systemzasmparser systemzcodegen - webassemblyasmparser webassemblycodegen - xcorecodegen -) + target_include_directories(${LIB_CXX_PROJECT_NAME} SYSTEM + PUBLIC ${LLVM_INCLUDE_DIRS} + ${CLANG_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + "${EXTERNAL_INCLUDE_PATHS}" + "${EXTERNAL_C_INCLUDE_PATHS}" + ) -target_link_libraries(${LIB_CXX_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${CLANG_LIBRARIES} ${REQ_LLVM_LIBS}) + link_directories(${LLVM_LIBRARY_DIRS} ${CLANG_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS}) + llvm_map_components_to_libnames(REQ_LLVM_LIBS + support core libdriver passes + x86asmparser x86codegen + aarch64asmparser aarch64codegen + amdgpuasmparser amdgpucodegen + armasmparser armcodegen + bpfasmparser bpfcodegen + hexagonasmparser hexagoncodegen + lanaiasmparser lanaicodegen + mipsasmparser mipscodegen + msp430asmparser msp430codegen + nvptxcodegen + powerpcasmparser powerpccodegen + sparcasmparser sparccodegen + systemzasmparser systemzcodegen + webassemblyasmparser webassemblycodegen + xcorecodegen + ) + + target_link_libraries(${LIB_CXX_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${CLANG_LIBRARIES} ${REQ_LLVM_LIBS}) + + if (WIN32) + target_link_libraries(${LIB_CXX_PROJECT_NAME} version) + endif() + +else() + + message(STATUS "Building the Cxx indexer will be skipped. You can enable building this target by setting 'BUILD_CXX_LANGUAGE_PACKAGE' to 'ON'.") -if (WIN32) - target_link_libraries(${LIB_CXX_PROJECT_NAME} version) endif() # Lib Java --------------------------------------------------------------------- -find_package(JNI) +if (BUILD_JAVA_LANGUAGE_PACKAGE) -add_library(${LIB_JAVA_PROJECT_NAME} ${LIB_JAVA_FILES}) + find_package(JNI) -create_source_groups(${LIB_JAVA_FILES}) + add_library(${LIB_JAVA_PROJECT_NAME} ${LIB_JAVA_FILES}) -set_property( - TARGET ${LIB_JAVA_PROJECT_NAME} - PROPERTY INCLUDE_DIRECTORIES - "${LIB_JAVA_INCLUDE_PATHS}" - "${LIB_UTILITY_INCLUDE_PATHS}" - "${LIB_INCLUDE_PATHS}" - "${LIB_GUI_INCLUDE_PATHS}" -) + create_source_groups(${LIB_JAVA_FILES}) -target_include_directories(${LIB_JAVA_PROJECT_NAME} SYSTEM - PUBLIC ${JNI_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} -) + set_property( + TARGET ${LIB_JAVA_PROJECT_NAME} + PROPERTY INCLUDE_DIRECTORIES + "${LIB_JAVA_INCLUDE_PATHS}" + "${LIB_UTILITY_INCLUDE_PATHS}" + "${LIB_INCLUDE_PATHS}" + "${LIB_GUI_INCLUDE_PATHS}" + "${CMAKE_BINARY_DIR}/src/lib" + ) -link_directories(${Boost_LIBRARY_DIRS}) + target_include_directories(${LIB_JAVA_PROJECT_NAME} SYSTEM + PUBLIC ${JNI_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ) -target_link_libraries(${LIB_JAVA_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${LIB_PROJECT_NAME}) + link_directories(${Boost_LIBRARY_DIRS}) -add_custom_command( - TARGET ${LIB_JAVA_PROJECT_NAME} - PRE_BUILD - COMMAND ${PROJECT_SOURCE_DIR}/script/update_java_indexer.sh - COMMENT "updating java indexer jars" -) + target_link_libraries(${LIB_JAVA_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${LIB_PROJECT_NAME}) + + add_custom_command( + TARGET ${LIB_JAVA_PROJECT_NAME} + PRE_BUILD + COMMAND ${PROJECT_SOURCE_DIR}/script/update_java_indexer.sh + COMMENT "updating java indexer jars" + ) + +else() + + message(STATUS "Building the Java indexer will be skipped. You can enable building this target by setting 'BUILD_JAVA_LANGUAGE_PACKAGE' to 'ON'.") + +endif() # Lib Python --------------------------------------------------------------------- -add_library(${LIB_PYTHON_PROJECT_NAME} ${LIB_PYTHON_FILES}) +if (BUILD_PYTHON_LANGUAGE_PACKAGE) -create_source_groups(${LIB_PYTHON_FILES}) + add_library(${LIB_PYTHON_PROJECT_NAME} ${LIB_PYTHON_FILES}) -set_property( - TARGET ${LIB_PYTHON_PROJECT_NAME} - PROPERTY INCLUDE_DIRECTORIES - "${LIB_PYTHON_INCLUDE_PATHS}" - "${LIB_UTILITY_INCLUDE_PATHS}" - "${LIB_INCLUDE_PATHS}" -# "${LIB_GUI_INCLUDE_PATHS}" -) + create_source_groups(${LIB_PYTHON_FILES}) -#target_include_directories(${LIB_PYTHON_PROJECT_NAME} SYSTEM -# PUBLIC ${Boost_INCLUDE_DIRS} -#) + set_property( + TARGET ${LIB_PYTHON_PROJECT_NAME} + PROPERTY INCLUDE_DIRECTORIES + "${LIB_PYTHON_INCLUDE_PATHS}" + "${LIB_UTILITY_INCLUDE_PATHS}" + "${LIB_INCLUDE_PATHS}" + "${CMAKE_BINARY_DIR}/src/lib" + ) -#link_directories(${Boost_LIBRARY_DIRS}) + #link_directories(${Boost_LIBRARY_DIRS}) -target_link_libraries(${LIB_PYTHON_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${LIB_PROJECT_NAME}) + target_link_libraries(${LIB_PYTHON_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${LIB_PROJECT_NAME}) -add_custom_command( - TARGET ${LIB_PYTHON_PROJECT_NAME} - PRE_BUILD - COMMAND ${PROJECT_SOURCE_DIR}/script/download_python_indexer.sh - COMMENT "download python indexer" -) + add_custom_command( + TARGET ${LIB_PYTHON_PROJECT_NAME} + PRE_BUILD + COMMAND ${PROJECT_SOURCE_DIR}/script/download_python_indexer.sh + COMMENT "download python indexer" + ) + +else() + + message(STATUS "Building the Python indexer will be skipped. You can enable building this target by setting 'BUILD_PYTHON_LANGUAGE_PACKAGE' to 'ON'.") + +endif() # Lib Gui ---------------------------------------------------------------------- @@ -465,10 +501,11 @@ set_property( "${LIB_GUI_INCLUDE_PATHS}" "${LIB_UTILITY_INCLUDE_PATHS}" "${LIB_INCLUDE_PATHS}" - "${LIB_CXX_INCLUDE_PATHS}" - "${LIB_JAVA_INCLUDE_PATHS}" - "${LIB_PYTHON_INCLUDE_PATHS}" # required for QtProjectWizardContentPathsSource::getFilePaths() "${CMAKE_BINARY_DIR}/src/lib_gui" + "${CMAKE_BINARY_DIR}/src/lib" + $<$:${LIB_CXX_INCLUDE_PATHS}> + $<$:${LIB_JAVA_INCLUDE_PATHS}> + $<$:${LIB_PYTHON_INCLUDE_PATHS}> ) # include external header without warnings @@ -528,9 +565,9 @@ target_link_libraries( ${APP_INDEXER_NAME} ${LIB_PROJECT_NAME} ${LIB_GUI_PROJECT_NAME} - ${LIB_CXX_PROJECT_NAME} - ${LIB_JAVA_PROJECT_NAME} - ${LIB_PYTHON_PROJECT_NAME} + $<$:${LIB_CXX_PROJECT_NAME}> + $<$:${LIB_JAVA_PROJECT_NAME}> + $<$:${LIB_PYTHON_PROJECT_NAME}> ) if (APPLE) @@ -545,10 +582,11 @@ set_property( "${LIB_INCLUDE_PATHS}" "${LIB_UTILITY_INCLUDE_PATHS}" "${LIB_GUI_INCLUDE_PATHS}" - "${LIB_CXX_INCLUDE_PATHS}" - "${LIB_JAVA_INCLUDE_PATHS}" - "${LIB_PYTHON_INCLUDE_PATHS}" "${CMAKE_BINARY_DIR}/src/lib_gui" + "${CMAKE_BINARY_DIR}/src/lib" + $<$:${LIB_CXX_INCLUDE_PATHS}> + $<$:${LIB_JAVA_INCLUDE_PATHS}> + $<$:${LIB_PYTHON_INCLUDE_PATHS}> ) @@ -608,9 +646,9 @@ target_link_libraries( ${APP_PROJECT_NAME} ${LIB_PROJECT_NAME} ${LIB_GUI_PROJECT_NAME} - ${LIB_CXX_PROJECT_NAME} - ${LIB_JAVA_PROJECT_NAME} - ${LIB_PYTHON_PROJECT_NAME} + $<$:${LIB_CXX_PROJECT_NAME}> + $<$:${LIB_JAVA_PROJECT_NAME}> + $<$:${LIB_PYTHON_PROJECT_NAME}> ) set_property( @@ -620,10 +658,11 @@ set_property( "${LIB_INCLUDE_PATHS}" "${LIB_UTILITY_INCLUDE_PATHS}" "${LIB_GUI_INCLUDE_PATHS}" - "${LIB_CXX_INCLUDE_PATHS}" - "${LIB_JAVA_INCLUDE_PATHS}" - "${LIB_PYTHON_INCLUDE_PATHS}" "${CMAKE_BINARY_DIR}/src/lib_gui" + "${CMAKE_BINARY_DIR}/src/lib" + $<$:${LIB_CXX_INCLUDE_PATHS}> + $<$:${LIB_JAVA_INCLUDE_PATHS}> + $<$:${LIB_PYTHON_INCLUDE_PATHS}> ) target_include_directories(${APP_PROJECT_NAME} SYSTEM @@ -709,7 +748,13 @@ add_executable (${TEST_PROJECT_NAME} ${TEST_FILES}) create_source_groups(${TEST_FILES}) -target_link_libraries(${TEST_PROJECT_NAME} ${LIB_CXX_PROJECT_NAME} ${LIB_JAVA_PROJECT_NAME} ${LIB_PROJECT_NAME} ${LIB_GUI_PROJECT_NAME}) +target_link_libraries( + ${TEST_PROJECT_NAME} + ${LIB_PROJECT_NAME} + ${LIB_GUI_PROJECT_NAME} + $<$:${LIB_CXX_PROJECT_NAME}> + $<$:${LIB_JAVA_PROJECT_NAME}> +) set_property( TARGET ${TEST_PROJECT_NAME} @@ -718,11 +763,12 @@ set_property( "${LIB_INCLUDE_PATHS}" "${LIB_UTILITY_INCLUDE_PATHS}" "${LIB_GUI_INCLUDE_PATHS}" - "${LIB_CXX_INCLUDE_PATHS}" - "${LIB_JAVA_INCLUDE_PATHS}" "${EXTERNAL_INCLUDE_PATHS}" "${EXTERNAL_C_INCLUDE_PATHS}" "${Boost_INCLUDE_DIRS}" + "${CMAKE_BINARY_DIR}/src/lib" + $<$:${LIB_CXX_INCLUDE_PATHS}> + $<$:${LIB_JAVA_INCLUDE_PATHS}> ) if (WIN32) diff --git a/bin/test/data/SettingsTestSuite/settings.xml b/bin/test/data/SettingsTestSuite/settings.xml index 8dd4f72a..f1017663 100644 --- a/bin/test/data/SettingsTestSuite/settings.xml +++ b/bin/test/data/SettingsTestSuite/settings.xml @@ -8,14 +8,11 @@ - C++ Source Group + Custom Command Source Group - data + src + test - - data/ - src/ - diff --git a/cmake/language_packages.h.in b/cmake/language_packages.h.in new file mode 100644 index 00000000..6a8e17c1 --- /dev/null +++ b/cmake/language_packages.h.in @@ -0,0 +1,8 @@ +#ifndef LANGUAGE_PACKAGES_H +#define LANGUAGE_PACKAGES_H + +#cmakedefine01 BUILD_CXX_LANGUAGE_PACKAGE +#cmakedefine01 BUILD_JAVA_LANGUAGE_PACKAGE +#cmakedefine01 BUILD_PYTHON_LANGUAGE_PACKAGE + +#endif // LANGUAGE_PACKAGES_H diff --git a/src/app/main.cpp b/src/app/main.cpp index 1af55f63..cc7ccdcd 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -3,14 +3,14 @@ #include #include +#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()); - SourceGroupFactory::getInstance()->addModule(std::make_shared()); - SourceGroupFactory::getInstance()->addModule(std::make_shared()); SourceGroupFactory::getInstance()->addModule(std::make_shared()); +#if BUILD_CXX_LANGUAGE_PACKAGE + SourceGroupFactory::getInstance()->addModule(std::make_shared()); +#endif // BUILD_CXX_LANGUAGE_PACKAGE + +#if BUILD_JAVA_LANGUAGE_PACKAGE + SourceGroupFactory::getInstance()->addModule(std::make_shared()); +#endif // BUILD_JAVA_LANGUAGE_PACKAGE + +#if BUILD_PYTHON_LANGUAGE_PACKAGE + SourceGroupFactory::getInstance()->addModule(std::make_shared()); +#endif // BUILD_PYTHON_LANGUAGE_PACKAGE + +#if BUILD_CXX_LANGUAGE_PACKAGE LanguagePackageManager::getInstance()->addPackage(std::make_shared()); +#endif // BUILD_CXX_LANGUAGE_PACKAGE + +#if BUILD_JAVA_LANGUAGE_PACKAGE LanguagePackageManager::getInstance()->addPackage(std::make_shared()); +#endif // BUILD_JAVA_LANGUAGE_PACKAGE } QCoreApplication* createApplication(int &argc, char *argv[], bool noGUI = false) diff --git a/src/indexer/main.cpp b/src/indexer/main.cpp index db5bfce0..e4246d9b 100644 --- a/src/indexer/main.cpp +++ b/src/indexer/main.cpp @@ -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()); +#endif // BUILD_CXX_LANGUAGE_PACKAGE + +#if BUILD_JAVA_LANGUAGE_PACKAGE LanguagePackageManager::getInstance()->addPackage(std::make_shared()); +#endif // BUILD_JAVA_LANGUAGE_PACKAGE InterprocessIndexer indexer(instanceUuid, processId); indexer.work(); diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index cca4a898..a6e4cf23 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -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 diff --git a/src/lib/data/indexer/IndexerCommandType.cpp b/src/lib/data/indexer/IndexerCommandType.cpp index d0272d10..0a96ba93 100644 --- a/src/lib/data/indexer/IndexerCommandType.cpp +++ b/src/lib/data/indexer/IndexerCommandType.cpp @@ -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; } diff --git a/src/lib/data/indexer/IndexerCommandType.h b/src/lib/data/indexer/IndexerCommandType.h index 24f425cd..87203716 100644 --- a/src/lib/data/indexer/IndexerCommandType.h +++ b/src/lib/data/indexer/IndexerCommandType.h @@ -1,14 +1,22 @@ #ifndef INDEXER_COMMAND_TYPE_H #define INDEXER_COMMAND_TYPE_H +#include "language_packages.h" + #include 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 }; diff --git a/src/lib/data/indexer/TaskExecuteCustomCommands.cpp b/src/lib/data/indexer/TaskExecuteCustomCommands.cpp index 2813cf2f..e34b22c6 100644 --- a/src/lib/data/indexer/TaskExecuteCustomCommands.cpp +++ b/src/lib/data/indexer/TaskExecuteCustomCommands.cpp @@ -52,11 +52,12 @@ void TaskExecuteCustomCommands::doEnter(std::shared_ptr 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()) { diff --git a/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.cpp b/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.cpp index 7a3fae73..8916aa17 100644 --- a/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.cpp +++ b/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.cpp @@ -10,6 +10,7 @@ void SharedIndexerCommand::fromLocal(IndexerCommand* indexerCommand) { setSourceFilePath(indexerCommand->getSourceFilePath()); +#if BUILD_CXX_LANGUAGE_PACKAGE if (dynamic_cast(indexerCommand) != nullptr) { IndexerCommandCxx* cmd = dynamic_cast(indexerCommand); @@ -20,29 +21,34 @@ void SharedIndexerCommand::fromLocal(IndexerCommand* indexerCommand) setIncludeFilters(cmd->getIncludeFilters()); setWorkingDirectory(cmd->getWorkingDirectory()); setCompilerFlags(cmd->getCompilerFlags()); + return; } - else if (dynamic_cast(indexerCommand) != nullptr) +#endif // BUILD_CXX_LANGUAGE_PACKAGE +#if BUILD_JAVA_LANGUAGE_PACKAGE + if (dynamic_cast(indexerCommand) != nullptr) { IndexerCommandJava* cmd = dynamic_cast(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 SharedIndexerCommand::fromShared(const SharedIndexerCommand& indexerCommand) { - if (indexerCommand.getType() == CXX) + switch (indexerCommand.getType()) { - std::shared_ptr command = std::make_shared( +#if BUILD_CXX_LANGUAGE_PACKAGE + case CXX: + return std::make_shared( indexerCommand.getSourceFilePath(), indexerCommand.getIndexedPaths(), indexerCommand.getExcludeFilters(), @@ -50,18 +56,16 @@ std::shared_ptr 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( 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 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 SharedIndexerCommand::getIndexedPaths() const { std::set 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 SharedIndexerCommand::getCompilerFlags() const { std::vector result; @@ -215,6 +215,20 @@ void SharedIndexerCommand::setCompilerFlags(const std::vector& 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 SharedIndexerCommand::getClassPaths() const { std::vector result; @@ -241,6 +255,8 @@ void SharedIndexerCommand::setClassPaths(const std::vector& classPaths } } +#endif // BUILD_JAVA_LANGUAGE_PACKAGE + SharedIndexerCommand::Type SharedIndexerCommand::getType() const { return m_type; diff --git a/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.h b/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.h index 6a9c3010..f6e4910a 100644 --- a/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.h +++ b/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.h @@ -3,6 +3,8 @@ #include +#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 getIndexedPaths() const; void setIndexedPaths(const std::set& 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 getCompilerFlags() const; void setCompilerFlags(const std::vector& compilerFlags); +#endif // BUILD_CXX_LANGUAGE_PACKAGE +#if BUILD_JAVA_LANGUAGE_PACKAGE + + std::wstring getLanguageStandard() const; + void setLanguageStandard(const std::wstring& languageStandard); + std::vector getClassPaths() const; void setClassPaths(const std::vector& 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 m_indexedPaths; SharedMemory::Vector m_excludeFilters; SharedMemory::Vector m_includeFilters; - - // cxx SharedMemory::String m_workingDirectory; - SharedMemory::String m_languageStandard; SharedMemory::Vector m_compilerFlags; +#endif // BUILD_CXX_LANGUAGE_PACKAGE - // java +#if BUILD_JAVA_LANGUAGE_PACKAGE + SharedMemory::String m_languageStandard; SharedMemory::Vector m_classPaths; +#endif // BUILD_JAVA_LANGUAGE_PACKAGE }; #endif // SHARED_INDEXER_COMMAND_H diff --git a/src/lib/data/storage/sqlite/SqliteBookmarkStorage.cpp b/src/lib/data/storage/sqlite/SqliteBookmarkStorage.cpp index 2d7adbe2..34237cf8 100644 --- a/src/lib/data/storage/sqlite/SqliteBookmarkStorage.cpp +++ b/src/lib/data/storage/sqlite/SqliteBookmarkStorage.cpp @@ -30,10 +30,18 @@ void SqliteBookmarkStorage::migrateIfNecessary() std::shared_ptr 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"); diff --git a/src/lib/project/Project.cpp b/src/lib/project/Project.cpp index 293909ac..bda4d7c9 100644 --- a/src/lib/project/Project.cpp +++ b/src/lib/project/Project.cpp @@ -418,20 +418,32 @@ void Project::buildIndex(RefreshInfo info, std::shared_ptr 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 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: m_sourceGroups) { if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED) @@ -785,5 +803,6 @@ bool Project::hasCxxSourceGroup() const } } } +#endif // BUILD_CXX_LANGUAGE_PACKAGE return false; } diff --git a/src/lib/settings/LanguageType.cpp b/src/lib/settings/LanguageType.cpp index dff5edd2..ee8ebb21 100644 --- a/src/lib/settings/LanguageType.cpp +++ b/src/lib/settings/LanguageType.cpp @@ -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: diff --git a/src/lib/settings/LanguageType.h b/src/lib/settings/LanguageType.h index 2fb5844f..39d73b46 100644 --- a/src/lib/settings/LanguageType.h +++ b/src/lib/settings/LanguageType.h @@ -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 }; diff --git a/src/lib/settings/ProjectSettings.cpp b/src/lib/settings/ProjectSettings.cpp index 2f2d92a0..b34fbecf 100644 --- a/src/lib/settings/ProjectSettings.cpp +++ b/src/lib/settings/ProjectSettings.cpp @@ -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> ProjectSettings::getAllSourceG switch (type) { +#if BUILD_CXX_LANGUAGE_PACKAGE case SOURCE_GROUP_C_EMPTY: settings = std::make_shared(id, this); break; @@ -186,6 +188,8 @@ std::vector> ProjectSettings::getAllSourceG case SOURCE_GROUP_CXX_CODEBLOCKS: settings = std::make_shared(id, this); break; +#endif // BUILD_CXX_LANGUAGE_PACKAGE +#if BUILD_JAVA_LANGUAGE_PACKAGE case SOURCE_GROUP_JAVA_EMPTY: settings = std::make_shared(id, this); break; @@ -195,14 +199,17 @@ std::vector> ProjectSettings::getAllSourceG case SOURCE_GROUP_JAVA_GRADLE: settings = std::make_shared(id, this); break; +#endif // BUILD_JAVA_LANGUAGE_PACKAGE +#if BUILD_PYTHON_LANGUAGE_PACKAGE case SOURCE_GROUP_PYTHON_EMPTY: settings = std::make_shared(id, this); break; +#endif // BUILD_PYTHON_LANGUAGE_PACKAGE case SOURCE_GROUP_CUSTOM_COMMAND: settings = std::make_shared(id, this); break; default: - continue; + settings = std::make_shared(id, this); } if (settings) @@ -307,6 +314,7 @@ SettingsMigrator ProjectSettings::getMigrations() const const std::string language = migration->getValueFromSettings(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(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(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 : 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(key + "/source_paths/source_path", key + "/indexed_header_paths/indexed_header_path")); } +#endif // BUILD_CXX_LANGUAGE_PACKAGE } for (std::shared_ptr 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; } diff --git a/src/lib/settings/source_group/SourceGroupType.cpp b/src/lib/settings/source_group/SourceGroupType.cpp index 969f4931..94200955 100644 --- a/src/lib/settings/source_group/SourceGroupType.cpp +++ b/src/lib/settings/source_group/SourceGroupType.cpp @@ -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; } diff --git a/src/lib/settings/source_group/SourceGroupType.h b/src/lib/settings/source_group/SourceGroupType.h index 0df1ea54..c2ee41de 100644 --- a/src/lib/settings/source_group/SourceGroupType.h +++ b/src/lib/settings/source_group/SourceGroupType.h @@ -1,19 +1,27 @@ #ifndef SOURCE_GROUP_TYPE_H #define SOURCE_GROUP_TYPE_H +#include "language_packages.h" + #include 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 }; diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.cpp b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.cpp index ac81fa1b..5ee6bbeb 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.cpp +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.cpp @@ -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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.h b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.h index 8ba21da0..9c6f9c79 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.h +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.h @@ -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 #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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.cpp b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.cpp index 09c13d7b..f29c1338 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.cpp +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.cpp @@ -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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.h b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.h index 32815434..3e5bcda3 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.h +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.h @@ -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 #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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.cpp b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.cpp index 37682c85..2e1b212c 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.cpp +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.cpp @@ -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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.h b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.h index 3f928fef..a60b685c 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.h +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.h @@ -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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.cpp b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.cpp index d47fcd35..63e6f6b5 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.cpp +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.cpp @@ -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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.h b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.h index 2cfc29ba..62f99fda 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.h +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.h @@ -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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.cpp b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.cpp index 1b69dd74..cee76be5 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.cpp +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.cpp @@ -1,7 +1,8 @@ #include "SourceGroupSettingsWithCxxCrossCompilationOptions.h" -#include "ProjectSettings.h" +#if BUILD_CXX_LANGUAGE_PACKAGE +#include "ProjectSettings.h" std::vector 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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.h b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.h index 161d5880..14785f3a 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.h +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.h @@ -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 #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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.cpp b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.cpp index 0472dde1..cb32fb9b 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.cpp +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.cpp @@ -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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.h b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.h index 7bed50a2..ebcc0252 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.h +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.h @@ -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 #include "FilePath.h" @@ -35,4 +39,6 @@ private: std::vector m_compilerFlags; }; +#endif // BUILD_CXX_LANGUAGE_PACKAGE + #endif // SOURCE_GROUP_SETTINGS_WITH_CXX_PATHS_AND_FLAGS_H diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPchOptions.cpp b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPchOptions.cpp index aa44cdcf..013063bd 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPchOptions.cpp +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithCxxPchOptions.cpp @@ -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::vectorsetValues(key + "/indexed_header_paths/indexed_header_path", getIndexedHeaderPaths()); } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithIndexedHeaderPaths.h b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithIndexedHeaderPaths.h index a7d7fcf9..134a8672 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithIndexedHeaderPaths.h +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithIndexedHeaderPaths.h @@ -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 #include "SourceGroupSettingsComponent.h" @@ -27,4 +31,6 @@ private: std::vector m_indexedHeaderPaths; }; +#endif // BUILD_CXX_LANGUAGE_PACKAGE + #endif // SOURCE_GROUP_SETTINGS_WITH_INDEXED_HEADER_PATHS_H diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsC.h b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsC.h index 3769c391..81df76c2 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsC.h +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsC.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 diff --git a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsCpp.h b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsCpp.h index e70df9d9..80792f96 100644 --- a/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsCpp.h +++ b/src/lib/settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsCpp.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 diff --git a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithClasspath.cpp b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithClasspath.cpp index 35b3b51e..4b7dc8fd 100644 --- a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithClasspath.cpp +++ b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithClasspath.cpp @@ -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 diff --git a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithClasspath.h b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithClasspath.h index d6107a68..285f6e89 100644 --- a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithClasspath.h +++ b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithClasspath.h @@ -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 #include "FilePath.h" @@ -30,4 +34,6 @@ private: bool m_useJreSystemLibrary = true; }; +#endif // BUILD_JAVA_LANGUAGE_PACKAGE + #endif // SOURCE_GROUP_SETTINGS_WITH_CLASSPATH_H diff --git a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.cpp b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.cpp index b25dadb6..d76c4dc8 100644 --- a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.cpp +++ b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.cpp @@ -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 diff --git a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.h b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.h index eac6de62..457aaf09 100644 --- a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.h +++ b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.h @@ -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 diff --git a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.cpp b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.cpp index f6b5121b..1c6e0e9b 100644 --- a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.cpp +++ b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.cpp @@ -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 diff --git a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.h b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.h index df9d0077..30850895 100644 --- a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.h +++ b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.h @@ -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 diff --git a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.cpp b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.cpp index e46aa8dc..3550bb84 100644 --- a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.cpp +++ b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.cpp @@ -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 diff --git a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.h b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.h index 96e68744..ba91598d 100644 --- a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.h +++ b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.h @@ -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 #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 diff --git a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithSourceExtensionsJava.h b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithSourceExtensionsJava.h index 1379aea6..f89ead84 100644 --- a/src/lib/settings/source_group/component/java/SourceGroupSettingsWithSourceExtensionsJava.h +++ b/src/lib/settings/source_group/component/java/SourceGroupSettingsWithSourceExtensionsJava.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 diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsCEmpty.h b/src/lib/settings/source_group/type/SourceGroupSettingsCEmpty.h index 894cd3fd..2c46faae 100644 --- a/src/lib/settings/source_group/type/SourceGroupSettingsCEmpty.h +++ b/src/lib/settings/source_group/type/SourceGroupSettingsCEmpty.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 diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsCppEmpty.h b/src/lib/settings/source_group/type/SourceGroupSettingsCppEmpty.h index ed08452e..4e47fdfb 100644 --- a/src/lib/settings/source_group/type/SourceGroupSettingsCppEmpty.h +++ b/src/lib/settings/source_group/type/SourceGroupSettingsCppEmpty.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 diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdb.h b/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdb.h index 5ad26eb6..bc7133fb 100644 --- a/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdb.h +++ b/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdb.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 diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdbVs.h b/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdbVs.h index df61ef74..2888ea41 100644 --- a/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdbVs.h +++ b/src/lib/settings/source_group/type/SourceGroupSettingsCxxCdbVs.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 diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsCxxCodeblocks.h b/src/lib/settings/source_group/type/SourceGroupSettingsCxxCodeblocks.h index 795f6d5e..eef0c32b 100644 --- a/src/lib/settings/source_group/type/SourceGroupSettingsCxxCodeblocks.h +++ b/src/lib/settings/source_group/type/SourceGroupSettingsCxxCodeblocks.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 diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsJavaEmpty.h b/src/lib/settings/source_group/type/SourceGroupSettingsJavaEmpty.h index f03e8500..67b5dc7e 100644 --- a/src/lib/settings/source_group/type/SourceGroupSettingsJavaEmpty.h +++ b/src/lib/settings/source_group/type/SourceGroupSettingsJavaEmpty.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 diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsJavaGradle.h b/src/lib/settings/source_group/type/SourceGroupSettingsJavaGradle.h index 90d598f6..54ca9711 100644 --- a/src/lib/settings/source_group/type/SourceGroupSettingsJavaGradle.h +++ b/src/lib/settings/source_group/type/SourceGroupSettingsJavaGradle.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 diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsJavaMaven.h b/src/lib/settings/source_group/type/SourceGroupSettingsJavaMaven.h index bc6cbe40..addd1e43 100644 --- a/src/lib/settings/source_group/type/SourceGroupSettingsJavaMaven.h +++ b/src/lib/settings/source_group/type/SourceGroupSettingsJavaMaven.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 diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsPythonEmpty.h b/src/lib/settings/source_group/type/SourceGroupSettingsPythonEmpty.h index be75250e..6769d784 100644 --- a/src/lib/settings/source_group/type/SourceGroupSettingsPythonEmpty.h +++ b/src/lib/settings/source_group/type/SourceGroupSettingsPythonEmpty.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 diff --git a/src/lib/settings/source_group/type/SourceGroupSettingsUnloadable.h b/src/lib/settings/source_group/type/SourceGroupSettingsUnloadable.h new file mode 100644 index 00000000..d64b0d12 --- /dev/null +++ b/src/lib/settings/source_group/type/SourceGroupSettingsUnloadable.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 createCopy() const override + { + return std::make_shared(*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 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 values = config->getValuesOrDefaults(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> m_content; + +}; + +#endif // SOURCE_GROUP_SETTINGS_UNLOADABLE_H diff --git a/src/lib_gui/CMakeLists.txt b/src/lib_gui/CMakeLists.txt index 416bff2a..633da536 100644 --- a/src/lib_gui/CMakeLists.txt +++ b/src/lib_gui/CMakeLists.txt @@ -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 diff --git a/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp b/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp index a319ccee..cb21943c 100644 --- a/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp +++ b/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp @@ -7,6 +7,8 @@ #include #include +#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 expandedPaths; @@ -102,9 +109,13 @@ namespace } } +#endif // BUILD_CXX_LANGUAGE_PACKAGE + template std::vector> getSourceGroupWizardPages(); +#if BUILD_CXX_LANGUAGE_PACKAGE + template <> std::vector> getSourceGroupWizardPages() { @@ -310,6 +321,10 @@ namespace return pages; } +#endif // BUILD_CXX_LANGUAGE_PACKAGE + +#if BUILD_JAVA_LANGUAGE_PACKAGE + template<> std::vector> getSourceGroupWizardPages() { @@ -375,6 +390,8 @@ namespace return pages; } +#endif // BUILD_JAVA_LANGUAGE_PACKAGE +#if BUILD_PYTHON_LANGUAGE_PACKAGE template<> std::vector> getSourceGroupWizardPages() @@ -392,6 +409,8 @@ namespace return pages; } +#endif // BUILD_PYTHON_LANGUAGE_PACKAGE + template<> std::vector> getSourceGroupWizardPages() { @@ -407,6 +426,18 @@ namespace return pages; } + template<> + std::vector> getSourceGroupWizardPages() + { + std::vector> pages; + { + QtSourceGroupWizardPage page(""); + page.addContentCreatorWithSettings(WIZARD_CONTENT_CONTEXT_ALL); + pages.push_back(page); + } + return pages; + } + template void fillSummary(QtProjectWizardContentGroup* summary, std::shared_ptr 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(); @@ -482,6 +514,7 @@ void QtProjectWizard::newProjectFromCDB(const FilePath& filePath) sourceGroupSettings->setCompilationDatabasePath(filePath); executeSourceGroupSetup(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 settings = std::dynamic_pointer_cast(group)) + if (std::shared_ptr settings = std::dynamic_pointer_cast(group)) + { + fillSummary(summary, settings, this); + } + if (std::shared_ptr settings = std::dynamic_pointer_cast(group)) + { + fillSummary(summary, settings, this); + } +#if BUILD_CXX_LANGUAGE_PACKAGE + else if (std::shared_ptr settings = std::dynamic_pointer_cast(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 settings = std::dynamic_pointer_cast(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 settings = std::dynamic_pointer_cast(group)) { fillSummary(summary, settings, this); } - else if (std::shared_ptr settings = std::dynamic_pointer_cast(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 settings = std::make_shared(sourceGroupId, m_projectSettings.get()); @@ -1037,6 +1081,8 @@ void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType) executeSourceGroupSetup(settings); } break; +#endif // BUILD_CXX_LANGUAGE_PACKAGE +#if BUILD_JAVA_LANGUAGE_PACKAGE case SOURCE_GROUP_JAVA_EMPTY: { std::shared_ptr settings = std::make_shared(sourceGroupId, m_projectSettings.get()); @@ -1055,12 +1101,15 @@ void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType) executeSourceGroupSetup(settings); } break; +#endif // BUILD_JAVA_LANGUAGE_PACKAGE +#if BUILD_PYTHON_LANGUAGE_PACKAGE case SOURCE_GROUP_PYTHON_EMPTY: { std::shared_ptr settings = std::make_shared(sourceGroupId, m_projectSettings.get()); executeSourceGroupSetup(settings); } break; +#endif // BUILD_PYTHON_LANGUAGE_PACKAGE case SOURCE_GROUP_CUSTOM_COMMAND: { std::shared_ptr settings = std::make_shared(sourceGroupId, m_projectSettings.get()); diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.cpp index fc2b0d9a..e2641982 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentCStandard.h" +#if BUILD_CXX_LANGUAGE_PACKAGE + #include #include @@ -46,3 +48,5 @@ void QtProjectWizardContentCStandard::save() m_sourceGroupSettings->setCStandard(m_standard->currentText().toStdWString()); } } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.h index f708a72e..39dd9c28 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.cpp index ebf15bc3..4c6ccedc 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentCppStandard.h" +#if BUILD_CXX_LANGUAGE_PACKAGE + #include #include @@ -46,3 +48,5 @@ void QtProjectWizardContentCppStandard::save() m_sourceGroupSettings->setCppStandard(m_standard->currentText().toStdWString()); } } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.h index 7779dcb0..81ae0d88 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp index 19756178..635e3062 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentCrossCompilationOptions.h" +#if BUILD_CXX_LANGUAGE_PACKAGE + #include #include #include @@ -165,3 +167,5 @@ void QtProjectWizardContentCrossCompilationOptions::updateTargetOptionsEnabled() m_sys->setEnabled(useTargetOptions); m_abi->setEnabled(useTargetOptions); } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.h index 70e4d824..41494505 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp index 083876ad..b4729626 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentCxxPchFlags.h" +#if BUILD_CXX_LANGUAGE_PACKAGE + #include #include @@ -83,3 +85,5 @@ bool QtProjectWizardContentCxxPchFlags::check() return true; } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.h index fcfd72a5..2c876bf2 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp index 18e9e36c..18ebd5d0 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentFlags.h" +#if BUILD_CXX_LANGUAGE_PACKAGE + #include #include @@ -69,3 +71,5 @@ bool QtProjectWizardContentFlags::check() return true; } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.h index f61355c9..996e3cd8 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentJavaStandard.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentJavaStandard.cpp index 3b36dc77..9b670541 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentJavaStandard.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentJavaStandard.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentJavaStandard.h" +#if BUILD_JAVA_LANGUAGE_PACKAGE + #include #include @@ -46,3 +48,5 @@ void QtProjectWizardContentJavaStandard::save() m_sourceGroupSettings->setJavaStandard(m_standard->currentText().toStdWString()); } } + +#endif // BUILD_JAVA_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentJavaStandard.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentJavaStandard.h index eab2b63a..90374d25 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentJavaStandard.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentJavaStandard.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp index 1a3b393e..a434c6cf 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp @@ -48,6 +48,7 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row) // define which kind of source groups are available for each language std::map> 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] = "

Create a new Source Group from an existing Code::Blocks project file.

" "

Note: A \".cbp\" file will also get generated by the Qt Creator if a CMakeLists file is imported.

"; +#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] = "

Create a new Source Group by defining which Python files will be indexed. This Source Group type uses the " "SourcetrailPythonIndexer " + pythonIndexerVersion + "in the " @@ -99,6 +116,7 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row) "

Note: Python support is still in its beta 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.

"; +#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 SourcetrailDB binaries that add " "custom language support to Sourcetrail.

Current Database Version: " + std::to_string(SqliteIndexStorage::getStorageVersion()); diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.h index e2f0fc2b..5742f923 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp new file mode 100644 index 00000000..2ba117e6 --- /dev/null +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp @@ -0,0 +1,44 @@ +#include "QtProjectWizardContentUnloadable.h" + +#include +#include +#include +#include + +#include "FileSystem.h" +#include "ProjectSettings.h" +#include "SourceGroupSettingsCustomCommand.h" +#include "SqliteIndexStorage.h" + +QtProjectWizardContentUnloadable::QtProjectWizardContentUnloadable( + std::shared_ptr 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( + "

The selected item uses a Source Group type that is not supportetd by this version of Sourcetrail.

" + ); + infoLabel->setObjectName("info"); + infoLabel->setWordWrap(true); + layoutHorz->addWidget(infoLabel); + + layoutHorz->addSpacing(40); + + row++; +} diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.h new file mode 100644 index 00000000..72b8ebc6 --- /dev/null +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.h @@ -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 settings, + QtProjectWizardWindow* window); + + // QtProjectWizardContent implementation + void populate(QGridLayout* layout, int& row) override; + +private: + std::shared_ptr m_settings; +}; + +#endif // QT_PROJECT_WIZARD_CONTENT_UNLOADABLE_H diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp index 85f16217..d7bad794 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.h index db98a783..c740b343 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp index 20112faf..ef4b8a23 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp @@ -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 QtProjectWizardContentPathCDB::getSourceGro { return m_settings; } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.h b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.h index f6bf8e4c..d51dedf7 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.h +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.h @@ -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> m_filePaths; }; +#endif // BUILD_CXX_LANGUAGE_PACKAGE + #endif // QT_PROJECT_WIZARD_CONTENT_PATH_CDB_H diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.cpp index 46db3757..a0811236 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.cpp +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.cpp @@ -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 QtProjectWizardContentPathCodeblocksProject { return m_settings; } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.h b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.h index 00b340a9..a3e45c4b 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.h +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.h @@ -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> m_filePaths; }; +#endif // BUILD_CXX_LANGUAGE_PACKAGE + #endif // QT_PROJECT_WIZARD_CONTENT_PATH_CODE_BLOCKS_PROJECT_H diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp index aafa1dfe..3e92dbec 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentPathCxxPch.h" +#if BUILD_CXX_LANGUAGE_PACKAGE + #include #include "IndexerCommandCxx.h" @@ -108,3 +110,5 @@ std::shared_ptr QtProjectWizardContentPathCxxPch::getSource { return m_settings; } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.h b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.h index 17568e0e..dd65a77b 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.h +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.h @@ -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 m_settingsCxxPch; }; +#endif // BUILD_CXX_LANGUAGE_PACKAGE + #endif // QT_PROJECT_WIZARD_CONTENT_PATH_CXX_PCH_H diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.cpp index 22b123bb..bbd9d69d 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.cpp +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.cpp @@ -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 QtProjectWizardContentPathPythonEnvironment { return m_settings; } + +#endif // BUILD_PYTHON_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.h b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.h index 2104229b..0c031c7a 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.h +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.cpp index 6d6245ff..afb18d6a 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.cpp +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentPathSourceGradle.h" +#if BUILD_JAVA_LANGUAGE_PACKAGE + #include #include "Application.h" @@ -71,3 +73,5 @@ std::shared_ptr QtProjectWizardContentPathSourceGradle::get { return m_settings; } + +#endif // BUILD_JAVA_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.h b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.h index e85301c5..33767048 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.h +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.cpp index 14888593..101b590b 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.cpp +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentPathSourceMaven.h" +#if BUILD_JAVA_LANGUAGE_PACKAGE + #include #include "Application.h" @@ -101,3 +103,5 @@ std::shared_ptr QtProjectWizardContentPathSourceMaven::getS { return m_settings; } + +#endif // BUILD_JAVA_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.h b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.h index 749524bc..37ee9af7 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.h +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.cpp index dda9c484..78f9bb92 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentPathsClassJava.h" +#if BUILD_JAVA_LANGUAGE_PACKAGE + #include #include "SourceGroupSettings.h" @@ -54,3 +56,5 @@ void QtProjectWizardContentPathsClassJava::save() settings->setUseJreSystemLibrary(m_useJreSystemLibraryCheckBox->isChecked()); } } + +#endif // BUILD_JAVA_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.h index b35e441f..8783176d 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.h +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp index e3d6bec4..5554edca 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.h index 1685832a..bbb438a5 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.h +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp index b51e4613..faa9e31c 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.h index 97d1bf1f..df906809 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.h +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp index ccea3235..ace6f1a6 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentPathsHeaderSearch.h" +#if BUILD_CXX_LANGUAGE_PACKAGE + #include #include @@ -397,3 +399,5 @@ void QtProjectWizardContentPathsHeaderSearch::showValidationResult(const std::ve connect(m_filesDialog.get(), &QtTextEditDialog::canceled, this, &QtProjectWizardContentPathsHeaderSearch::closedFilesDialog); } } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.h index b14d35dd..422c1c6d 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.h +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp index 097869fb..10e5901e 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentPathsHeaderSearchGlobal.h" +#if BUILD_CXX_LANGUAGE_PACKAGE + #include #include "ApplicationSettings.h" @@ -110,3 +112,5 @@ void QtProjectWizardContentPathsHeaderSearchGlobal::setPaths(const std::vectoraddPaths({ ResourcePaths::getCxxCompilerHeaderPath() }, true); m_list->addPaths(paths); } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.h index 88ef0b0a..7c538445 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.h +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.h @@ -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& paths); }; +#endif // BUILD_CXX_LANGUAGE_PACKAGE + #endif // QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_GLOBAL_H diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp index f036bf7c..47f7fe54 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentPathsIndexedHeaders.h" +#if BUILD_CXX_LANGUAGE_PACKAGE + #include #include "CodeblocksProject.h" @@ -251,3 +253,5 @@ void QtProjectWizardContentPathsIndexedHeaders::savedFilesDialog() m_list->setPaths(dynamic_cast(m_filesDialog.get())->getPathsList()); closedFilesDialog(); } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.h index bc2893af..45f75425 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.h +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp index 8b77b60d..b5eb115a 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp @@ -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 settings, QtProjectWizardWindow* window ) @@ -50,19 +61,29 @@ void QtProjectWizardContentPathsSource::save() std::vector QtProjectWizardContentPathsSource::getFilePaths() const { std::set allSourceFilePaths; + +#if BUILD_CXX_LANGUAGE_PACKAGE if (std::dynamic_pointer_cast(m_settings)) { allSourceFilePaths = SourceGroupCxxEmpty(m_settings).getAllSourceFilePaths(); } - else if (std::shared_ptr settings = std::dynamic_pointer_cast(m_settings)) +#endif // BUILD_CXX_LANGUAGE_PACKAGE + +#if BUILD_JAVA_LANGUAGE_PACKAGE + if (std::shared_ptr settings = std::dynamic_pointer_cast(m_settings)) { allSourceFilePaths = SourceGroupJavaEmpty(settings).getAllSourceFilePaths(); } - else if (std::shared_ptr settings = std::dynamic_pointer_cast(m_settings)) +#endif // BUILD_JAVA_LANGUAGE_PACKAGE + +#if BUILD_PYTHON_LANGUAGE_PACKAGE + if (std::shared_ptr settings = std::dynamic_pointer_cast(m_settings)) { allSourceFilePaths = SourceGroupPythonEmpty(settings).getAllSourceFilePaths(); } - else if (std::shared_ptr settings = std::dynamic_pointer_cast(m_settings)) +#endif // BUILD_PYTHON_LANGUAGE_PACKAGE + + if (std::shared_ptr settings = std::dynamic_pointer_cast(m_settings)) { allSourceFilePaths = SourceGroupCustomCommand(settings).getAllSourceFilePaths(); } diff --git a/src/lib_gui/qt/window/QtPreferencesWindow.cpp b/src/lib_gui/qt/window/QtPreferencesWindow.cpp index a32852e2..7a97b173 100644 --- a/src/lib_gui/qt/window/QtPreferencesWindow.cpp +++ b/src/lib_gui/qt/window/QtPreferencesWindow.cpp @@ -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); diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp index b6ee2225..f49c4ff5 100644 --- a/src/lib_gui/qt/window/QtStartScreen.cpp +++ b/src/lib_gui/qt/window/QtStartScreen.cpp @@ -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; diff --git a/src/test/CxxIncludeProcessingTestSuite.cpp b/src/test/CxxIncludeProcessingTestSuite.cpp index 54d46894..d7d84325 100644 --- a/src/test/CxxIncludeProcessingTestSuite.cpp +++ b/src/test/CxxIncludeProcessingTestSuite.cpp @@ -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 diff --git a/src/test/CxxIndexSampleProjectsTestSuite.cpp b/src/test/CxxIndexSampleProjectsTestSuite.cpp index 527ac27c..54447ece 100644 --- a/src/test/CxxIndexSampleProjectsTestSuite.cpp +++ b/src/test/CxxIndexSampleProjectsTestSuite.cpp @@ -1,5 +1,9 @@ #include "catch.hpp" +#include "language_packages.h" + +#if BUILD_CXX_LANGUAGE_PACKAGE + #include #include "ApplicationSettings.h" @@ -219,3 +223,4 @@ TEST_CASE("index bullet3 project") #endif // _WIN32 } +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/test/CxxParserTestSuite.cpp b/src/test/CxxParserTestSuite.cpp index a50df072..54d863cb 100644 --- a/src/test/CxxParserTestSuite.cpp +++ b/src/test/CxxParserTestSuite.cpp @@ -1,4 +1,9 @@ #include "catch.hpp" + +#include "language_packages.h" + +#if BUILD_CXX_LANGUAGE_PACKAGE + #include "TextAccess.h" #include "utility.h" #include "utilityString.h" @@ -4722,3 +4727,5 @@ void _test_TEST() ); int ofo = 0; } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/test/CxxTypeNameTestSuite.cpp b/src/test/CxxTypeNameTestSuite.cpp index 2d0336db..bb942dd4 100644 --- a/src/test/CxxTypeNameTestSuite.cpp +++ b/src/test/CxxTypeNameTestSuite.cpp @@ -1,5 +1,9 @@ #include "catch.hpp" +#include "language_packages.h" + +#if BUILD_CXX_LANGUAGE_PACKAGE + #include "CxxTypeName.h" TEST_CASE("type name created with name has no qualifiers or modifiers") @@ -37,3 +41,5 @@ TEST_CASE("type name created with name and pointer pointer modifier has pointer typeName.addModifier(CxxTypeName::Modifier(L"*")); REQUIRE(L"int * *" == typeName.toString()); } + +#endif // BUILD_CXX_LANGUAGE_PACKAGE diff --git a/src/test/JavaIndexSampleProjectsTestSuite.cpp b/src/test/JavaIndexSampleProjectsTestSuite.cpp index f22ee847..09b73876 100644 --- a/src/test/JavaIndexSampleProjectsTestSuite.cpp +++ b/src/test/JavaIndexSampleProjectsTestSuite.cpp @@ -1,5 +1,9 @@ #include "catch.hpp" +#include "language_packages.h" + +#if BUILD_JAVA_LANGUAGE_PACKAGE + #include #include @@ -287,3 +291,5 @@ TEST_CASE("index javasymbolsolver 0 6 0 project") classpath ); } + +#endif // BUILD_JAVA_LANGUAGE_PACKAGE diff --git a/src/test/JavaParserTestSuite.cpp b/src/test/JavaParserTestSuite.cpp index e2d0f7b2..8ba9d7e5 100644 --- a/src/test/JavaParserTestSuite.cpp +++ b/src/test/JavaParserTestSuite.cpp @@ -1,5 +1,9 @@ #include "catch.hpp" +#include "language_packages.h" + +#if BUILD_JAVA_LANGUAGE_PACKAGE + #include "ApplicationSettings.h" #include "JavaEnvironmentFactory.h" #include "JavaParser.h" @@ -1881,3 +1885,5 @@ TEST_CASE("java parser finds bound type of type parameter") client->typeUses, L"A.T -> java.lang.Void <1:27 1:30>" )); } + +#endif // BUILD_JAVA_LANGUAGE_PACKAGE diff --git a/src/test/SettingsTestSuite.cpp b/src/test/SettingsTestSuite.cpp index 36d199a4..773bb7e3 100644 --- a/src/test/SettingsTestSuite.cpp +++ b/src/test/SettingsTestSuite.cpp @@ -1,5 +1,7 @@ #include "catch.hpp" +#include "language_packages.h" + #include "ProjectSettings.h" #include "Settings.h" #include "SourceGroupSettingsWithCxxPathsAndFlags.h" @@ -197,19 +199,7 @@ TEST_CASE("load source path from file") std::dynamic_pointer_cast(projectSettings.getAllSourceGroupSettings().front()); std::vector paths = sourceGroupSettings->getSourcePaths(); - REQUIRE(paths.size() == 1); - REQUIRE(paths[0].wstr() == L"data"); -} - -TEST_CASE("load header search paths from file") -{ - ProjectSettings projectSettings; - projectSettings.load(FilePath(L"data/SettingsTestSuite/settings.xml")); - std::shared_ptr sourceGroupSettings = - std::dynamic_pointer_cast(projectSettings.getAllSourceGroupSettings().front()); - std::vector paths = sourceGroupSettings->getHeaderSearchPaths(); - REQUIRE(paths.size() == 2); - REQUIRE(paths[0].wstr() == L"data/"); - REQUIRE(paths[1].wstr() == L"src/"); + REQUIRE(paths[0].wstr() == L"src"); + REQUIRE(paths[1].wstr() == L"test"); } diff --git a/src/test/SourceGroupTestSuite.cpp b/src/test/SourceGroupTestSuite.cpp index 8b787a14..04dad623 100644 --- a/src/test/SourceGroupTestSuite.cpp +++ b/src/test/SourceGroupTestSuite.cpp @@ -2,17 +2,10 @@ #include +#include "language_packages.h" + #include "IndexerCommandCustom.h" -#include "IndexerCommandCxx.h" -#include "IndexerCommandJava.h" -#include "JavaEnvironmentFactory.h" -#include "SourceGroupCxxEmpty.h" -#include "SourceGroupCxxCdb.h" -#include "SourceGroupCxxCodeblocks.h" #include "SourceGroupCustomCommand.h" -#include "SourceGroupJavaEmpty.h" -#include "SourceGroupJavaGradle.h" -#include "SourceGroupJavaMaven.h" #include "SourceGroupSettingsCEmpty.h" #include "SourceGroupSettingsCppEmpty.h" #include "SourceGroupSettingsCxxCdb.h" @@ -26,12 +19,27 @@ #include "FileSystem.h" #include "TextAccess.h" #include "AppPath.h" -#include "utilityJava.h" #include "utilityPathDetection.h" #include "utilityString.h" #include "Version.h" #include "Application.h" +#if BUILD_CXX_LANGUAGE_PACKAGE +#include "IndexerCommandCxx.h" +#include "SourceGroupCxxEmpty.h" +#include "SourceGroupCxxCdb.h" +#include "SourceGroupCxxCodeblocks.h" +#endif // BUILD_CXX_LANGUAGE_PACKAGE +#if BUILD_JAVA_LANGUAGE_PACKAGE +#include "IndexerCommandJava.h" +#include "JavaEnvironmentFactory.h" +#include "SourceGroupJavaEmpty.h" +#include "SourceGroupJavaGradle.h" +#include "SourceGroupJavaMaven.h" +#include "utilityJava.h" +#endif // BUILD_JAVA_LANGUAGE_PACKAGE + + #define REQUIRE_MESSAGE(msg, cond) do { INFO(msg); REQUIRE(cond); } while((void)0, 0) namespace @@ -48,6 +56,7 @@ namespace return FilePath(L"data/SourceGroupTestSuite/" + projectName + L"/expected_output").makeAbsolute().makeCanonical(); } +#if BUILD_JAVA_LANGUAGE_PACKAGE std::string setupJavaEnvironmentFactory() { if (!JavaEnvironmentFactory::getInstance()) @@ -81,7 +90,9 @@ namespace return ""; } +#endif // BUILD_JAVA_LANGUAGE_PACKAGE +#if BUILD_CXX_LANGUAGE_PACKAGE std::wstring indexerCommandCxxToString(std::shared_ptr indexerCommand, const FilePath& baseDirectory) { std::wstring result; @@ -105,7 +116,9 @@ namespace } return result; } +#endif // BUILD_CXX_LANGUAGE_PACKAGE +#if BUILD_JAVA_LANGUAGE_PACKAGE std::wstring indexerCommandJavaToString(std::shared_ptr indexerCommand, const FilePath& baseDirectory) { std::wstring result; @@ -117,6 +130,7 @@ namespace } return result; } +#endif // BUILD_JAVA_LANGUAGE_PACKAGE std::wstring indexerCommandCustomToString(std::shared_ptr indexerCommand, const FilePath& baseDirectory) { @@ -130,14 +144,18 @@ namespace { if (indexerCommand) { +#if BUILD_CXX_LANGUAGE_PACKAGE if (std::shared_ptr indexerCommandCxx = std::dynamic_pointer_cast(indexerCommand)) { return indexerCommandCxxToString(indexerCommandCxx, baseDirectory); } +#endif // BUILD_CXX_LANGUAGE_PACKAGE +#if BUILD_JAVA_LANGUAGE_PACKAGE if (std::shared_ptr indexerCommandJava = std::dynamic_pointer_cast(indexerCommand)) { return indexerCommandJavaToString(indexerCommandJava, baseDirectory); } +#endif // BUILD_JAVA_LANGUAGE_PACKAGE if (std::shared_ptr indexerCommandCustom = std::dynamic_pointer_cast(indexerCommand)) { return indexerCommandCustomToString(indexerCommandCustom, baseDirectory); @@ -208,6 +226,8 @@ namespace } } +#if BUILD_JAVA_LANGUAGE_PACKAGE + TEST_CASE("finds all jar dependencies") { for (const std::wstring& jarName : utility::getRequiredJarNames()) @@ -232,6 +252,8 @@ TEST_CASE("can setup environment factory") REQUIRE(JavaEnvironmentFactory::getInstance().use_count() >= 1); } +#endif // BUILD_JAVA_LANGUAGE_PACKAGE + TEST_CASE("can create application instance") { // required to query in SourceGroup for dialog view... this is not a very elegant solution. should be refactored to pass dialog view to SourceGroup on creation. @@ -239,6 +261,7 @@ TEST_CASE("can create application instance") REQUIRE(Application::getInstance().use_count() >= 1); } +#if BUILD_CXX_LANGUAGE_PACKAGE TEST_CASE("source group cxx c empty generates expected output") { const std::wstring projectName = L"cxx_c_empty"; @@ -385,6 +408,10 @@ TEST_CASE("source group cxx cdb generates expected output") applicationSettings->setFrameworkSearchPaths(storedFrameworkSearchPaths); } +#endif // BUILD_CXX_LANGUAGE_PACKAGE + +#if BUILD_JAVA_LANGUAGE_PACKAGE + TEST_CASE("sourcegroup java empty generates expected output") { const std::wstring projectName = L"java_empty"; @@ -480,6 +507,10 @@ TEST_CASE("sourcegroup java maven generates expected output") applicationSettings->setJreSystemLibraryPaths(storedJreSystemLibraryPaths); } +#endif // BUILD_JAVA_LANGUAGE_PACKAGE + +// fixme: test python source group here + TEST_CASE("source group custom command generates expected output") { const std::wstring projectName = L"custom_command"; diff --git a/src/test/UtilityMavenTestSuite.cpp b/src/test/UtilityMavenTestSuite.cpp index 320d283a..41ddbc3c 100644 --- a/src/test/UtilityMavenTestSuite.cpp +++ b/src/test/UtilityMavenTestSuite.cpp @@ -1,5 +1,9 @@ #include "catch.hpp" +#include "language_packages.h" + +#if BUILD_JAVA_LANGUAGE_PACKAGE + #include "FilePath.h" #include "utility.h" #include "utilityMaven.h" @@ -110,3 +114,5 @@ TEST_CASE("maven wrapper detects source and test directories of nested modules") )); } } + +#endif // BUILD_JAVA_LANGUAGE_PACKAGE