reuse Gradle external system ID

This commit is contained in:
Dmitry Jemerov
2016-03-01 17:21:31 +01:00
parent 13f4053950
commit 828e53ce82
2 changed files with 4 additions and 3 deletions
@@ -18,11 +18,11 @@ package org.jetbrains.kotlin.idea;
import com.intellij.facet.Facet;
import com.intellij.facet.FacetManager;
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
import com.intellij.openapi.module.Module;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.idea.configuration.KotlinModuleTypeManager;
import org.jetbrains.kotlin.idea.framework.KotlinLibraryUtilKt;
public class KotlinModuleTypeManagerImpl extends KotlinModuleTypeManager {
@Override
@@ -41,6 +41,6 @@ public class KotlinModuleTypeManagerImpl extends KotlinModuleTypeManager {
@Override
public boolean isGradleModule(@NotNull Module module) {
return ExternalSystemApiUtil.isExternalSystemAwareModule(new ProjectSystemId("GRADLE"), module);
return ExternalSystemApiUtil.isExternalSystemAwareModule(KotlinLibraryUtilKt.getGRADLE_SYSTEM_ID(), module);
}
}
@@ -37,7 +37,8 @@ fun <LP : LibraryProperties<out Any>> getLibraryProperties(provider: LibraryPres
}
private val MAVEN_SYSTEM_ID = ProjectSystemId("MAVEN")
private val GRADLE_SYSTEM_ID = ProjectSystemId("GRADLE")
val GRADLE_SYSTEM_ID = ProjectSystemId("GRADLE")
private fun isExternalLibrary(library: Library): Boolean {
return ExternalSystemApiUtil.isExternalSystemLibrary(library, ProjectSystemId.IDE) ||
ExternalSystemApiUtil.isExternalSystemLibrary(library, GRADLE_SYSTEM_ID) ||