reuse Gradle external system ID
This commit is contained in:
@@ -18,11 +18,11 @@ package org.jetbrains.kotlin.idea;
|
|||||||
|
|
||||||
import com.intellij.facet.Facet;
|
import com.intellij.facet.Facet;
|
||||||
import com.intellij.facet.FacetManager;
|
import com.intellij.facet.FacetManager;
|
||||||
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
|
|
||||||
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
|
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil;
|
||||||
import com.intellij.openapi.module.Module;
|
import com.intellij.openapi.module.Module;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.idea.configuration.KotlinModuleTypeManager;
|
import org.jetbrains.kotlin.idea.configuration.KotlinModuleTypeManager;
|
||||||
|
import org.jetbrains.kotlin.idea.framework.KotlinLibraryUtilKt;
|
||||||
|
|
||||||
public class KotlinModuleTypeManagerImpl extends KotlinModuleTypeManager {
|
public class KotlinModuleTypeManagerImpl extends KotlinModuleTypeManager {
|
||||||
@Override
|
@Override
|
||||||
@@ -41,6 +41,6 @@ public class KotlinModuleTypeManagerImpl extends KotlinModuleTypeManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isGradleModule(@NotNull Module module) {
|
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 MAVEN_SYSTEM_ID = ProjectSystemId("MAVEN")
|
||||||
private val GRADLE_SYSTEM_ID = ProjectSystemId("GRADLE")
|
val GRADLE_SYSTEM_ID = ProjectSystemId("GRADLE")
|
||||||
|
|
||||||
private fun isExternalLibrary(library: Library): Boolean {
|
private fun isExternalLibrary(library: Library): Boolean {
|
||||||
return ExternalSystemApiUtil.isExternalSystemLibrary(library, ProjectSystemId.IDE) ||
|
return ExternalSystemApiUtil.isExternalSystemLibrary(library, ProjectSystemId.IDE) ||
|
||||||
ExternalSystemApiUtil.isExternalSystemLibrary(library, GRADLE_SYSTEM_ID) ||
|
ExternalSystemApiUtil.isExternalSystemLibrary(library, GRADLE_SYSTEM_ID) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user