Skip to content

Commit

Permalink
#1243 | API | Migrate Gradle project import API
Browse files Browse the repository at this point in the history
  • Loading branch information
mlytvyn authored Oct 20, 2024
1 parent 1541598 commit dda22a9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
- Use `IDE` modality [#1232](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1232)
- Resource bundle fallback message [#1233](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1233)
- AnAction text in toolbar configuration [#1236](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1236)
- Omit usage of the internal Java Compiler API [#1242](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1242)
- Migrate Gradle project import API [#1243](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/1243)

## [2024.2.4]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,24 @@ package com.intellij.idea.plugin.hybris.project.configurators

import com.intellij.idea.plugin.hybris.project.descriptors.impl.GradleModuleDescriptor
import com.intellij.openapi.project.Project
import org.jetbrains.plugins.gradle.service.project.open.linkAndRefreshGradleProject
import com.intellij.platform.backend.observation.launchTracked
import kotlinx.coroutines.CoroutineScope
import org.jetbrains.plugins.gradle.service.project.open.linkAndSyncGradleProject
import org.jetbrains.plugins.gradle.settings.GradleSettings

class GradleConfigurator {
class GradleConfigurator(private val coroutineScope: CoroutineScope) {

fun configure(
project: Project,
gradleModules: List<GradleModuleDescriptor>
) {
gradleModules
.mapNotNull { it.gradleFile.path }
.forEach { linkAndRefreshGradleProject(it, project) }
.forEach { externalProjectPath ->
coroutineScope.launchTracked {
linkAndSyncGradleProject(project, externalProjectPath)
}
}
}

fun clearLinkedProjectSettings(project: Project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
import com.intellij.openapi.fileChooser.FileTypeDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
Expand Down Expand Up @@ -61,11 +60,11 @@ public DomGenPanel(final Project project) {

private void createUIComponents() {
mySchemaLocation = new TextFieldWithBrowseButton();
final String title = "Choose XSD or DTD schema";
mySchemaLocation.addBrowseFolderListener(
myProject,
new FileTypeDescriptor(title, "xsd", "dtd")
.withTitle(title)
FileChooserDescriptorFactory.createSingleFileDescriptor()
.withExtensionFilter("Files (.xsd, .dtd)", "xsd", "dtd")
.withTitle("Choose XSD or DTD Schema")
.withDescription("Make sure there are only necessary schemes in directory where your XSD or DTD schema is located")
);
mySchemaLocation.getTextField().setEditable(false);
Expand Down

0 comments on commit dda22a9

Please sign in to comment.