diff --git a/plugins/kotlin/base/jps/src/org/jetbrains/kotlin/idea/jps/SetupKotlinJpsPluginBeforeCompileTask.kt b/plugins/kotlin/base/jps/src/org/jetbrains/kotlin/idea/jps/SetupKotlinJpsPluginBeforeCompileTask.kt index fc0ba473f772..f418f15b64df 100644 --- a/plugins/kotlin/base/jps/src/org/jetbrains/kotlin/idea/jps/SetupKotlinJpsPluginBeforeCompileTask.kt +++ b/plugins/kotlin/base/jps/src/org/jetbrains/kotlin/idea/jps/SetupKotlinJpsPluginBeforeCompileTask.kt @@ -29,7 +29,7 @@ class SetupKotlinJpsPluginBeforeCompileTask : CompileTask { onUnsupportedVersion = { context.addErrorWithReferenceToKotlincXml(it) } ) ?: return true - LOG.debug("Attempting to download non-bundled JPS version: $jpsVersion") + LOG.debug("Attempting to lazy download JPS version: $jpsVersion") return KotlinArtifactsDownloader.lazyDownloadMissingJpsPluginDependencies( project = project, diff --git a/plugins/kotlin/base/plugin/src/org/jetbrains/kotlin/idea/compiler/configuration/LazyKotlinJpsPluginClasspathDownloader.kt b/plugins/kotlin/base/plugin/src/org/jetbrains/kotlin/idea/compiler/configuration/LazyKotlinJpsPluginClasspathDownloader.kt index 40ff7fa2b315..2c145ae916ee 100644 --- a/plugins/kotlin/base/plugin/src/org/jetbrains/kotlin/idea/compiler/configuration/LazyKotlinJpsPluginClasspathDownloader.kt +++ b/plugins/kotlin/base/plugin/src/org/jetbrains/kotlin/idea/compiler/configuration/LazyKotlinJpsPluginClasspathDownloader.kt @@ -1,6 +1,7 @@ // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.kotlin.idea.compiler.configuration +import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.progress.ProgressIndicator import com.intellij.openapi.project.Project import org.jetbrains.kotlin.idea.base.plugin.KotlinBasePluginBundle @@ -11,6 +12,8 @@ import java.io.File private val VERSION_UNTIL_OLD_FAT_JAR_IS_AVAILABLE = IdeKotlinVersion.get("1.7.20") +private val LOG = logger() + class LazyKotlinJpsPluginClasspathDownloader(private val version: String) : LazyFileOutputProducer { @@ -40,14 +43,20 @@ class LazyKotlinJpsPluginClasspathDownloader(private val version: String) : ?: emptyList() } - fun getDownloadedIfUpToDateOrEmpty() = - if (IdeKotlinVersion.get(version).isStandaloneCompilerVersion) { + fun getDownloadedIfUpToDateOrEmpty(): List { + LOG.debug("Requested download for version $version") + LOG.debug("Found standalone compiler version ${KotlinPluginLayout.standaloneCompilerVersion}") + + return if (IdeKotlinVersion.get(version).isStandaloneCompilerVersion) { + LOG.debug("Using standalone compiler version ${KotlinPluginLayout.standaloneCompilerVersion}") KotlinPluginLayout.jpsPluginClasspath } else { + LOG.debug("Starting download for version $version") newDownloader.getDownloadedIfUpToDateOrEmpty().takeIf { it.isNotEmpty() } ?: oldDownloader?.getDownloadedIfUpToDateOrEmpty() ?: emptyList() } + } fun lazyDownload(computationContext: Context) = lazyProduceOutput(Unit, computationContext)