From 885543443028a5e044eb4c103d6afb3e842d2d86 Mon Sep 17 00:00:00 2001 From: Mykhailo Lytvyn Date: Fri, 3 Nov 2023 12:14:11 +0100 Subject: [PATCH] Ignore `addontestsrc` directory for `web` sub-module --- CHANGELOG.md | 1 + src/com/intellij/idea/plugin/hybris/common/HybrisConstants.kt | 1 + .../configurators/impl/DefaultContentRootConfigurator.java | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ccfb7860..2ea82bb23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Improved classpath configuration for OOTB modules and readonly mode [#783](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/783) - Adjusted `platformservices` source directories in readonly mode [#792](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/792) - Register `web.addonsrc` as source directories for `?.web - Web Classes` library [#796](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/796) +- Ignore `addontestsrc` directory for `web` sub-module [#797](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/797) ### `Cockpit NG` enhancements - Extend config schema namespace with `editors` type [#784](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/784) diff --git a/src/com/intellij/idea/plugin/hybris/common/HybrisConstants.kt b/src/com/intellij/idea/plugin/hybris/common/HybrisConstants.kt index aeee1aaa0..b85389ebd 100644 --- a/src/com/intellij/idea/plugin/hybris/common/HybrisConstants.kt +++ b/src/com/intellij/idea/plugin/hybris/common/HybrisConstants.kt @@ -132,6 +132,7 @@ object HybrisConstants { const val COMMON_WEB_MODULE_DIRECTORY = "commonweb" const val ADDON_SRC_DIRECTORY = "addonsrc" + const val ADDON_TESTSRC_DIRECTORY = "addontestsrc" const val TEST_CLASSES_DIRECTORY = "testclasses" const val CLASSES_DIRECTORY = "classes" const val JAR_MODELS = "models.jar" diff --git a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultContentRootConfigurator.java b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultContentRootConfigurator.java index 0376d7169..c0a01f209 100644 --- a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultContentRootConfigurator.java +++ b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/DefaultContentRootConfigurator.java @@ -109,7 +109,7 @@ protected void configureCommonRoots( if (customModuleDescriptor || !rootProjectDescriptor.isImportOotbModulesInReadOnlyMode()) { addSourceRoots(contentEntry, moduleDescriptor.getModuleRootDirectory(), dirsToIgnore, appSettings, SRC_DIR_NAMES, JavaSourceRootType.SOURCE); - if (!customModuleDescriptor && !rootProjectDescriptor.isExcludeTestSources()) { + if (customModuleDescriptor || !rootProjectDescriptor.isExcludeTestSources()) { addSourceRoots(contentEntry, moduleDescriptor.getModuleRootDirectory(), dirsToIgnore, appSettings, TEST_SRC_DIR_NAMES, JavaSourceRootType.TEST_SOURCE); } @@ -241,7 +241,7 @@ protected void configureWebModuleRoots( excludeSubDirectories( contentEntry, moduleDescriptor.getModuleRootDirectory(), - Arrays.asList(ADDON_SRC_DIRECTORY, TEST_CLASSES_DIRECTORY, COMMON_WEB_SRC_DIRECTORY) + Arrays.asList(ADDON_SRC_DIRECTORY, ADDON_TESTSRC_DIRECTORY, COMMON_WEB_SRC_DIRECTORY, TEST_CLASSES_DIRECTORY) ); configureWebInf(contentEntry, moduleDescriptor); }