diff --git a/plugins/pill/pill-importer/build.gradle.kts b/plugins/pill/pill-importer/build.gradle.kts index ddf23ea8ef1..47f1d90b518 100644 --- a/plugins/pill/pill-importer/build.gradle.kts +++ b/plugins/pill/pill-importer/build.gradle.kts @@ -29,7 +29,9 @@ fun runPillTask(taskName: String) { val platformDir = IntellijRootUtils.getIntellijRootDir(project) val resourcesDir = File(project.projectDir, "resources") - runMethod.invoke(null, project.rootProject, taskName, platformDir, resourcesDir) + val isIdePluginAttached = project.rootProject.intellijSdkVersionForIde() != null + + runMethod.invoke(null, project.rootProject, taskName, platformDir, resourcesDir, isIdePluginAttached) } val jar: Jar by tasks diff --git a/plugins/pill/pill-importer/src/JpsCompatiblePluginTasks.kt b/plugins/pill/pill-importer/src/JpsCompatiblePluginTasks.kt index a5540de34c4..ca294f4a1b2 100644 --- a/plugins/pill/pill-importer/src/JpsCompatiblePluginTasks.kt +++ b/plugins/pill/pill-importer/src/JpsCompatiblePluginTasks.kt @@ -27,7 +27,12 @@ import kotlin.collections.HashMap const val EMBEDDED_CONFIGURATION_NAME = "embedded" -class JpsCompatiblePluginTasks(private val rootProject: Project, private val platformDir: File, private val resourcesDir: File) { +class JpsCompatiblePluginTasks( + private val rootProject: Project, + private val platformDir: File, + private val resourcesDir: File, + private val isIdePluginAttached: Boolean +) { companion object { private val DIST_LIBRARIES = listOf( ":kotlin-annotations-jvm", @@ -111,7 +116,7 @@ class JpsCompatiblePluginTasks(private val rootProject: Project, private val pla removeJpsAndPillRunConfigurations() removeArtifactConfigurations() - if (variant.includes.contains(PillExtensionMirror.Variant.BASE)) { + if (isIdePluginAttached && variant.includes.contains(PillExtensionMirror.Variant.BASE)) { val artifactDependencyMapper = object : ArtifactDependencyMapper { override fun map(dependency: PDependency): List { val result = mutableListOf() diff --git a/plugins/pill/pill-importer/src/PillImporter.kt b/plugins/pill/pill-importer/src/PillImporter.kt index 33d6aab9693..f63daaf6cca 100644 --- a/plugins/pill/pill-importer/src/PillImporter.kt +++ b/plugins/pill/pill-importer/src/PillImporter.kt @@ -16,8 +16,8 @@ object PillImporter { ) @JvmStatic - fun run(rootProject: Project, taskName: String, platformDir: File, resourcesDir: File) { - val tasks = JpsCompatiblePluginTasks(rootProject, platformDir, resourcesDir) + fun run(rootProject: Project, taskName: String, platformDir: File, resourcesDir: File, isIdePluginAttached: Boolean) { + val tasks = JpsCompatiblePluginTasks(rootProject, platformDir, resourcesDir, isIdePluginAttached) val task = TASKS[taskName] ?: error("Unknown task $taskName, available tasks: " + TASKS.keys.joinToString()) task(tasks) }