mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-104500 Gradle: Allow to reuse common logic for other external systems
1. Remove external-system-impl -> openapi dependency; 2. Correct gradle classpath construction; 3. Don't provide 'external-system-impl' at the platform impl classes;
This commit is contained in:
@@ -66,7 +66,8 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
|
||||
"dom-impl",
|
||||
"execution-impl",
|
||||
"jsp-spi",
|
||||
"idea-ui"
|
||||
"idea-ui",
|
||||
"external-system-impl"
|
||||
].flatten()
|
||||
|
||||
ant.patternset(id: "resources.included") {
|
||||
|
||||
@@ -276,8 +276,7 @@ binding.setVariable("platformImplementationModules", [
|
||||
"spellchecker",
|
||||
"images",
|
||||
"RegExpSupport",
|
||||
"dvcs",
|
||||
"external-system-impl"
|
||||
"dvcs"
|
||||
])
|
||||
|
||||
binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
|
||||
|
||||
+20
-2
@@ -19,14 +19,21 @@ public class ModuleData extends AbstractNamedData implements Named {
|
||||
|
||||
@NotNull private final Map<ExternalSystemSourceType, String> myCompileOutputPaths = ContainerUtilRt.newHashMap();
|
||||
|
||||
@NotNull private final String myModuleTypeId;
|
||||
@NotNull private String myModuleFilePath;
|
||||
private boolean myInheritProjectCompileOutputPath = true;
|
||||
|
||||
public ModuleData(@NotNull ProjectSystemId owner, @NotNull String name, @NotNull String moduleFileDirectoryPath) {
|
||||
public ModuleData(@NotNull ProjectSystemId owner, @NotNull String typeId, @NotNull String name, @NotNull String moduleFileDirectoryPath) {
|
||||
super(owner, name);
|
||||
myModuleTypeId = typeId;
|
||||
setModuleFileDirectoryPath(moduleFileDirectoryPath);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getModuleTypeId() {
|
||||
return myModuleTypeId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getModuleFilePath() {
|
||||
return myModuleFilePath;
|
||||
@@ -65,7 +72,18 @@ public class ModuleData extends AbstractNamedData implements Named {
|
||||
myCompileOutputPaths.put(type, ExternalSystemApiUtil.toCanonicalPath(path));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 31 * super.hashCode() + myModuleTypeId.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!super.equals(o)) {
|
||||
return false;
|
||||
}
|
||||
return myModuleTypeId.equals(((ModuleData)o).myModuleTypeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
+20
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.externalSystem.util;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.externalSystem.ExternalSystemManager;
|
||||
import com.intellij.openapi.externalSystem.model.DataNode;
|
||||
@@ -32,6 +33,7 @@ import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.BooleanFunction;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.PathsList;
|
||||
import com.intellij.util.containers.ContainerUtilRt;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -330,4 +332,22 @@ public class ExternalSystemApiUtil {
|
||||
UIUtil.invokeLaterIfNeeded(wrappedTask);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures given classpath to reference target i18n bundle file(s).
|
||||
*
|
||||
* @param classPath process classpath
|
||||
* @param bundlePath path to the target bundle file
|
||||
* @param contextClass class from the same content root as the target bundle file
|
||||
*/
|
||||
public static void addBundle(@NotNull PathsList classPath, @NotNull String bundlePath, @NotNull Class<?> contextClass) {
|
||||
String pathToUse = bundlePath.replace('.', '/');
|
||||
if (!pathToUse.endsWith(".properties")) {
|
||||
pathToUse += ".properties";
|
||||
}
|
||||
if (!pathToUse.startsWith("/")) {
|
||||
pathToUse = '/' + pathToUse;
|
||||
}
|
||||
classPath.add(PathManager.getResourceRoot(contextClass, pathToUse));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="idea-ui" />
|
||||
<orderEntry type="module" module-name="external-system-api" />
|
||||
<orderEntry type="module" module-name="openapi" />
|
||||
<orderEntry type="module" module-name="projectModel-impl" />
|
||||
<orderEntry type="module" module-name="compiler-openapi" />
|
||||
<orderEntry type="module" module-name="platform-impl" />
|
||||
|
||||
+4
-5
@@ -31,16 +31,15 @@ import com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemPr
|
||||
import com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemFacadeWrapper;
|
||||
import com.intellij.openapi.externalSystem.settings.ExternalSystemSettingsManager;
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemUtil;
|
||||
import com.intellij.openapi.externalSystem.util.IntegrationKey;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectBundle;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.projectRoots.*;
|
||||
import com.intellij.openapi.roots.DependencyScope;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.ShutDownTracker;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.PsiBundle;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.PathUtil;
|
||||
@@ -148,18 +147,18 @@ public class ExternalSystemFacadeManager {
|
||||
|
||||
// IDE jars.
|
||||
classPath.addAll(PathManager.getUtilClassPath());
|
||||
ContainerUtil.addIfNotNull(PathUtil.getJarPathForClass(LanguageLevel.class), classPath);
|
||||
ContainerUtil.addIfNotNull(PathUtil.getJarPathForClass(ProjectBundle.class), classPath);
|
||||
ExternalSystemApiUtil.addBundle(params.getClassPath(), "messages.ProjectBundle", ProjectBundle.class);
|
||||
ContainerUtil.addIfNotNull(PathUtil.getJarPathForClass(PsiBundle.class), classPath);
|
||||
ContainerUtil.addIfNotNull(PathUtil.getJarPathForClass(Alarm.class), classPath);
|
||||
ContainerUtil.addIfNotNull(PathUtil.getJarPathForClass(DependencyScope.class), classPath);
|
||||
ContainerUtil.addIfNotNull(PathUtil.getJarPathForClass(JavaSdkVersion.class), classPath);
|
||||
ContainerUtil.addIfNotNull(PathUtil.getJarPathForClass(ExtensionPointName.class), classPath);
|
||||
ContainerUtil.addIfNotNull(PathUtil.getJarPathForClass(OpenProjectFileChooserDescriptor.class), classPath);
|
||||
ContainerUtil.addIfNotNull(PathUtil.getJarPathForClass(ExternalSystemTaskNotificationListener.class), classPath);
|
||||
|
||||
// External system module jars
|
||||
ContainerUtil.addIfNotNull(PathUtil.getJarPathForClass(getClass()), classPath);
|
||||
ExternalSystemUtil.addBundle(params.getClassPath(), "messages.CommonBundle", CommonBundle.class);
|
||||
ExternalSystemApiUtil.addBundle(params.getClassPath(), "messages.CommonBundle", CommonBundle.class);
|
||||
params.getClassPath().addAll(classPath);
|
||||
|
||||
params.setMainClass(MAIN_CLASS_NAME);
|
||||
|
||||
-2
@@ -5,13 +5,11 @@ import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ContentEntry;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.roots.OrderEntry;
|
||||
import com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable;
|
||||
import com.intellij.openapi.roots.libraries.LibraryTable;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
+2
-2
@@ -12,7 +12,6 @@ import com.intellij.openapi.externalSystem.service.project.ProjectStructureHelpe
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.module.StdModuleTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.*;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
@@ -93,7 +92,8 @@ public class ModuleDataService implements ProjectDataService<ModuleData> {
|
||||
}
|
||||
|
||||
private void importModule(@NotNull ModuleManager moduleManager, @NotNull DataNode<ModuleData> module) {
|
||||
final Module created = moduleManager.newModule(module.getData().getModuleFilePath(), StdModuleTypes.JAVA.getId());
|
||||
ModuleData data = module.getData();
|
||||
final Module created = moduleManager.newModule(data.getModuleFilePath(), data.getModuleTypeId());
|
||||
|
||||
// Ensure that the dependencies are clear (used to be not clear when manually removing the module and importing it via gradle)
|
||||
ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(created);
|
||||
|
||||
-7
@@ -25,8 +25,6 @@ import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.projectRoots.JavaSdk;
|
||||
import com.intellij.openapi.projectRoots.SdkTypeId;
|
||||
import com.intellij.openapi.roots.ex.ProjectRootManagerEx;
|
||||
import com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
@@ -315,11 +313,6 @@ public abstract class AbstractExternalProjectImportBuilder<C extends AbstractExt
|
||||
return myExternalProjectNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuitableSdkType(SdkTypeId sdk) {
|
||||
return sdk == JavaSdk.getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies gradle-plugin-specific settings like project files location etc to the given context.
|
||||
*
|
||||
|
||||
-25
@@ -20,7 +20,6 @@ import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.actionSystem.DataKey;
|
||||
import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -38,10 +37,6 @@ import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.JavaSdk;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.ProjectJdkTable;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.roots.LibraryOrderEntry;
|
||||
import com.intellij.openapi.roots.ModuleOrderEntry;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
@@ -60,8 +55,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
import javax.swing.*;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Denis Zhdanov
|
||||
@@ -182,24 +175,6 @@ public class ExternalSystemUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures given classpath to reference target i18n bundle file(s).
|
||||
*
|
||||
* @param classPath process classpath
|
||||
* @param bundlePath path to the target bundle file
|
||||
* @param contextClass class from the same content root as the target bundle file
|
||||
*/
|
||||
public static void addBundle(@NotNull PathsList classPath, @NotNull String bundlePath, @NotNull Class<?> contextClass) {
|
||||
String pathToUse = bundlePath.replace('.', '/');
|
||||
if (!pathToUse.endsWith(".properties")) {
|
||||
pathToUse += ".properties";
|
||||
}
|
||||
if (!pathToUse.startsWith("/")) {
|
||||
pathToUse = '/' + pathToUse;
|
||||
}
|
||||
classPath.add(PathManager.getResourceRoot(contextClass, pathToUse));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link RemoteUtil#unwrap(Throwable) unwraps} given exception if possible and builds error message for it.
|
||||
*
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
<library.presentationProvider implementation="org.jetbrains.plugins.gradle.config.GradleLibraryPresentationProvider" order="last"/>
|
||||
<java.elementFinder implementation="org.jetbrains.plugins.gradle.config.GradleClassFinder"/>
|
||||
<!--<projectOpenProcessor implementation="com.intellij.openapi.externalSystem.service.project.wizard.ExternalProjectOpenProcessor"/>-->
|
||||
<colorAndFontPanelFactory implementation="org.jetbrains.plugins.gradle.config.GradleColorAndFontPanelFactory"/>
|
||||
<colorAndFontDescriptorProvider implementation="org.jetbrains.plugins.gradle.config.GradleColorAndFontDescriptorsProvider"/>
|
||||
|
||||
<externalSystemManager implementation="org.jetbrains.plugins.gradle.GradleManager"/>
|
||||
<postStartupActivity implementation="org.jetbrains.plugins.gradle.sync.GradleStartupActivity"/>
|
||||
@@ -112,7 +110,6 @@
|
||||
<actions>
|
||||
|
||||
<!-- Tool window toolbar actions -->
|
||||
<action id="Gradle.LinkToProject" class="org.jetbrains.plugins.gradle.action.GradleLinkToProjectAction"/>
|
||||
<action id="Gradle.RefreshProject" class="org.jetbrains.plugins.gradle.action.GradleRefreshProjectAction" icon="AllIcons.Actions.Refresh"/>
|
||||
<action id="Gradle.OpenScript" class="org.jetbrains.plugins.gradle.action.GradleOpenScriptAction" icon="GradleIcons.GradleNavigate"/>
|
||||
<action id="Gradle.Help.ToolWindow" class="org.jetbrains.plugins.gradle.action.GradleToolWindowHelpAction" icon="AllIcons.Actions.Help"/>
|
||||
@@ -122,33 +119,6 @@
|
||||
<reference id="Gradle.Help.ToolWindow"/>
|
||||
</group>
|
||||
|
||||
<!-- 'Sync project structure' tree nodes actions -->
|
||||
<action id="Gradle.ImportEntity" class="org.jetbrains.plugins.gradle.action.GradleImportEntityAction" icon="GradleIcons.GradleImport"/>
|
||||
<action id="Gradle.ShowConflict" class="org.jetbrains.plugins.gradle.action.GradleShowConflictDetailsAction" icon="AllIcons.Actions.Diff"/>
|
||||
<action id="Gradle.RemoveEntity" class="org.jetbrains.plugins.gradle.action.GradleRemoveIdeEntityAction" icon="AllIcons.General.Remove"/>
|
||||
<action id="Gradle.SyncOutdatedLibrary" class="org.jetbrains.plugins.gradle.action.GradleSyncAction" icon="GradleIcons.GradleSync"/>
|
||||
<group id="Gradle.SyncTreeGroup">
|
||||
<reference id="Gradle.ImportEntity"/>
|
||||
<reference id="Gradle.RemoveEntity"/>
|
||||
<reference id="Gradle.ShowConflict"/>
|
||||
<reference id="Gradle.SyncOutdatedLibrary"/>
|
||||
</group>
|
||||
|
||||
<!-- 'Sync project structure' tree filters -->
|
||||
<action id="Gradle.SyncTreeFilter.None" class="org.jetbrains.plugins.gradle.action.GradleResetTreeFiltersAction"/>
|
||||
<action id="Gradle.SyncTreeFilter.GradleLocal" class="org.jetbrains.plugins.gradle.action.GradleLocalSyncTreeFilterAction"/>
|
||||
<action id="Gradle.SyncTreeFilter.IntellijLocal" class="org.jetbrains.plugins.gradle.action.IntellijLocalSyncTreeFilterAction"/>
|
||||
<action id="Gradle.SyncTreeFilter.Conflict" class="org.jetbrains.plugins.gradle.action.GradleConflictSyncTreeFilterAction"/>
|
||||
<action id="Gradle.SyncTreeFilter.Outdated" class="org.jetbrains.plugins.gradle.action.GradleOutdatedSyncTreeFilterAction"/>
|
||||
<group id="Gradle.SyncTreeFilter">
|
||||
<reference id="Gradle.SyncTreeFilter.GradleLocal"/>
|
||||
<reference id="Gradle.SyncTreeFilter.IntellijLocal"/>
|
||||
<reference id="Gradle.SyncTreeFilter.Conflict"/>
|
||||
<reference id="Gradle.SyncTreeFilter.Outdated"/>
|
||||
<reference id="Gradle.SyncTreeFilter.None"/>
|
||||
</group>
|
||||
|
||||
<action id="Gradle.RebuildChangesTree" class="org.jetbrains.plugins.gradle.action.GradleRebuildStructureChangesTreeAction"/>
|
||||
<group id="Gradle.TasksGroup">
|
||||
<reference ref="RunContextGroup"/>
|
||||
</group>
|
||||
|
||||
@@ -25,12 +25,17 @@ import com.intellij.openapi.externalSystem.build.ExternalSystemBuildManager;
|
||||
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
|
||||
import com.intellij.openapi.externalSystem.service.project.ExternalSystemProjectResolver;
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemUtil;
|
||||
import com.intellij.openapi.module.EmptyModuleType;
|
||||
import com.intellij.openapi.module.JavaModuleType;
|
||||
import com.intellij.openapi.module.ModuleType;
|
||||
import com.intellij.openapi.module.StdModuleTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NotNullLazyValue;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.PathsList;
|
||||
import com.intellij.util.containers.ContainerUtilRt;
|
||||
import org.gradle.tooling.ProjectConnection;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -152,8 +157,10 @@ public class GradleManager
|
||||
|
||||
@Override
|
||||
public void enhanceParameters(@NotNull SimpleJavaParameters parameters) throws ExecutionException {
|
||||
PathsList classPath = parameters.getClassPath();
|
||||
|
||||
// Gradle i18n bundle.
|
||||
ExternalSystemUtil.addBundle(parameters.getClassPath(), GradleBundle.PATH_TO_BUNDLE, GradleBundle.class);
|
||||
ExternalSystemApiUtil.addBundle(classPath, GradleBundle.PATH_TO_BUNDLE, GradleBundle.class);
|
||||
|
||||
// Gradle tool jars.
|
||||
String toolingApiPath = PathManager.getJarPathForClass(ProjectConnection.class);
|
||||
@@ -173,12 +180,18 @@ public class GradleManager
|
||||
throw new ExecutionException("Can't find gradle libraries at " + gradleJarsDir.getAbsolutePath());
|
||||
}
|
||||
for (String jar : gradleJars) {
|
||||
parameters.getClassPath().add(new File(gradleJarsDir, jar).getAbsolutePath());
|
||||
classPath.add(new File(gradleJarsDir, jar).getAbsolutePath());
|
||||
}
|
||||
|
||||
String path = PathUtil.getJarPathForClass(JavaProjectData.class);
|
||||
if (!StringUtil.isEmpty(path)) {
|
||||
parameters.getClassPath().add(path);
|
||||
|
||||
List<String> additionalEntries = ContainerUtilRt.newArrayList();
|
||||
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(JavaProjectData.class));
|
||||
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(LanguageLevel.class));
|
||||
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(StdModuleTypes.class));
|
||||
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(JavaModuleType.class));
|
||||
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(ModuleType.class));
|
||||
ContainerUtilRt.addIfNotNull(additionalEntries, PathUtil.getJarPathForClass(EmptyModuleType.class));
|
||||
for (String entry : additionalEntries) {
|
||||
classPath.add(entry);
|
||||
}
|
||||
|
||||
for (GradleProjectResolverExtension extension : RESOLVER_EXTENSIONS.getValue()) {
|
||||
|
||||
+4
-1
@@ -8,6 +8,7 @@ import com.intellij.openapi.externalSystem.model.project.*;
|
||||
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId;
|
||||
import com.intellij.openapi.externalSystem.service.project.ExternalSystemProjectResolver;
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
|
||||
import com.intellij.openapi.module.StdModuleTypes;
|
||||
import com.intellij.openapi.roots.DependencyScope;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
@@ -141,7 +142,9 @@ public class GradleProjectResolver implements ExternalSystemProjectResolver<Grad
|
||||
throw new IllegalStateException("Module with undefined name detected: " + gradleModule);
|
||||
}
|
||||
ProjectData projectData = ideProject.getData();
|
||||
ModuleData ideModule = new ModuleData(GradleConstants.SYSTEM_ID, moduleName, projectData.getProjectFileDirectoryPath());
|
||||
ModuleData ideModule = new ModuleData(
|
||||
GradleConstants.SYSTEM_ID, StdModuleTypes.JAVA.getId(), moduleName, projectData.getProjectFileDirectoryPath()
|
||||
);
|
||||
Pair<DataNode<ModuleData>, IdeaModule> previouslyParsedModule = result.get(moduleName);
|
||||
if (previouslyParsedModule != null) {
|
||||
throw new IllegalStateException(
|
||||
|
||||
+6
-4
@@ -25,10 +25,7 @@ import com.intellij.openapi.externalSystem.settings.ExternalSystemSettingsManage
|
||||
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.projectRoots.JavaSdk;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.ProjectJdkTable;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.projectRoots.*;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import icons.GradleIcons;
|
||||
@@ -144,4 +141,9 @@ public class GradleProjectImportBuilder extends AbstractExternalProjectImportBui
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSuitableSdkType(SdkTypeId sdk) {
|
||||
return sdk == JavaSdk.getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user