From a2f01945b8f02320963770f6457844e316e05edf Mon Sep 17 00:00:00 2001 From: Mykhailo Lytvyn Date: Mon, 14 Aug 2023 22:39:16 +0200 Subject: [PATCH] Improved detection of the Gradle modules --- CHANGELOG.md | 1 + .../services/impl/DefaultHybrisProjectService.java | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6f208e35..b5fa3f8d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ - Fixed Compact Middle Packages in the Project View [#568](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/568) - Fixed `commonweb` sources attaching [#572](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/572), [#573](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/573) - Added `hmc` sub-module dependency on `hmc.web` [#574](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/574) +- Improved detection of the Gradle modules [#575](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/575) ### Other - Adjusted inline documentation for Type System [#539](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/539) diff --git a/src/com/intellij/idea/plugin/hybris/project/services/impl/DefaultHybrisProjectService.java b/src/com/intellij/idea/plugin/hybris/project/services/impl/DefaultHybrisProjectService.java index 9a4d1fd40..ded6d9a01 100644 --- a/src/com/intellij/idea/plugin/hybris/project/services/impl/DefaultHybrisProjectService.java +++ b/src/com/intellij/idea/plugin/hybris/project/services/impl/DefaultHybrisProjectService.java @@ -1,6 +1,7 @@ /* - * This file is part of "hybris integration" plugin for Intellij IDEA. + * This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA. * Copyright (C) 2014-2016 Alexander Bartash + * Copyright (C) 2019-2023 EPAM Systems and contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -130,7 +131,8 @@ public boolean isGradleModule(final File file) { if (file.getAbsolutePath().contains(HybrisConstants.PLATFORM_MODULE_PREFIX)) { return false; } - return new File(file, HybrisConstants.GRADLE_SETTINGS).isFile(); + return new File(file, HybrisConstants.GRADLE_SETTINGS).isFile() + || new File(file, HybrisConstants.GRADLE_BUILD).isFile(); } @Override @@ -139,7 +141,8 @@ public boolean isGradleKtsModule(final File file) { if (file.getAbsolutePath().contains(HybrisConstants.PLATFORM_MODULE_PREFIX)) { return false; } - return new File(file, HybrisConstants.GRADLE_SETTINGS_KTS).isFile(); + return new File(file, HybrisConstants.GRADLE_SETTINGS_KTS).isFile() + || new File(file, HybrisConstants.GRADLE_BUILD_KTS).isFile(); } @Override