Pill: Disable Kotlin IDE plugin artifact building if not in cooperative mode

This commit is contained in:
Yan Zhulanow
2021-10-12 19:31:26 +09:00
committed by TeamCityServer
parent 5627bbb535
commit 099a44283f
3 changed files with 12 additions and 5 deletions
+3 -1
View File
@@ -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
@@ -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<PDependency> {
val result = mutableListOf<PDependency>()
@@ -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)
}