Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: ability to skip adding source directories if the directories do not exist #511

Merged

Conversation

viktor-yengovatov
Copy link

@viktor-yengovatov viktor-yengovatov commented Jul 6, 2023

By this feature non exiting source directories like kotlintestsrc are excluded from source directories.

The feature is disabled by default.

Signed-off-by: Your Real Name [email protected]

@mlytvyn mlytvyn added this to the Release 2023.2.3 milestone Jul 6, 2023
@mlytvyn mlytvyn changed the base branch from main to release/2023.2.4 July 6, 2023 18:58
@mlytvyn
Copy link
Collaborator

mlytvyn commented Jul 6, 2023

Hello @viktor-yengovatov , thank you very much for your efforts and contribution!!!
It would be great if you could also update CHANGELOG.md file with something like:

## [2023.2.4]

### Features
- Added possibility to skip non-existing source directories during project import [#511](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/511) 

@viktor-yengovatov viktor-yengovatov changed the title Feature: ability to skip adding source directories if the directories… Feature: ability to skip adding source directories if the directories do not exist Jul 6, 2023
@viktor-yengovatov viktor-yengovatov force-pushed the fix/omit-empty-sources branch from d4ee3e0 to 17f16f3 Compare July 6, 2023 19:06
@@ -328,6 +330,10 @@ private static <P extends JpsElement> void addSourceFolderIfNotIgnored(
@NotNull final List<File> dirsToIgnore
) {
if (dirsToIgnore.stream().noneMatch(it -> FileUtil.isAncestor(it, testSrcDir, false))) {
final boolean ignoreEmpty = HybrisApplicationSettingsComponent.getInstance().getState().getIgnoreNonExistingSourceDirectories();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@viktor-yengovatov , what do you think if we can refactor this part slightly and pass state of the HybrisApplicationSettingsComponent to this class -> methods from the ImportProjectProgressModalWindow
by that we will get appSettings only once during import of all java modules?

variable can be declared in the public synchronized void run(@NotNull final ProgressIndicator indicator) { of the ImportProjectProgressModalWindow and then passed to createJavaModule then to configuratorFactory.getContentRootConfigurator(moduleDescriptor).configure and so on

Copy link
Author

@viktor-yengovatov viktor-yengovatov Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @mlytvyn
I have created separate pull request for the refactoring: #512 .
I hope it fits.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, just take into account different target branch, I'll also change target branch for your PR #512

@mlytvyn mlytvyn merged commit 7e8d683 into epam:release/2023.2.4 Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants