[Gradle] GradleKotlinCompilerRunner: Be lenient to isolated classpaths
^KT-50592
This commit is contained in:
committed by
Space
parent
56fa2655b7
commit
6c55e8cc58
+14
-5
@@ -16,7 +16,6 @@ import org.gradle.workers.WorkQueue
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildMetricsReporter
|
||||
import org.jetbrains.kotlin.build.report.metrics.BuildTime
|
||||
import org.jetbrains.kotlin.build.report.metrics.measure
|
||||
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||
import org.jetbrains.kotlin.cli.common.arguments.*
|
||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||
import org.jetbrains.kotlin.daemon.client.CompileServiceSession
|
||||
@@ -32,8 +31,7 @@ import org.jetbrains.kotlin.gradle.plugin.internal.state.TaskLoggers
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinWithJavaTarget
|
||||
import org.jetbrains.kotlin.gradle.plugin.statistics.KotlinBuildStatsService
|
||||
import org.jetbrains.kotlin.gradle.tasks.*
|
||||
import org.jetbrains.kotlin.gradle.tasks.InspectClassesForMultiModuleIC
|
||||
import org.jetbrains.kotlin.gradle.tasks.TaskOutputsBackup
|
||||
import org.jetbrains.kotlin.gradle.utils.IsolatedKotlinClasspathClassCastException
|
||||
import org.jetbrains.kotlin.gradle.utils.archivePathCompatible
|
||||
import org.jetbrains.kotlin.gradle.utils.newTmpFile
|
||||
import org.jetbrains.kotlin.gradle.utils.relativeOrCanonical
|
||||
@@ -273,8 +271,19 @@ internal open class GradleCompilerRunner(
|
||||
|
||||
gradle.taskGraph.allTasks.forEach { task ->
|
||||
val project = task.project
|
||||
// TODO REVIEW: Should this fail or be lenient on isolated classpaths (and therefore failing cast)?
|
||||
if (project.multiplatformExtensionOrNull != null) {
|
||||
|
||||
/*
|
||||
Ignoring isolated classpath:
|
||||
An inaccessible project is not a fatal issue here. Missing information will "only" lead to non-incremental
|
||||
compilation. We expect the user to be warned about this misconfiguration during configuration phase.
|
||||
*/
|
||||
val multiplatformExtension = try {
|
||||
project.multiplatformExtensionOrNull
|
||||
} catch (e: IsolatedKotlinClasspathClassCastException) {
|
||||
null
|
||||
}
|
||||
|
||||
if (multiplatformExtension != null) {
|
||||
// Just record this, we'll process them later
|
||||
val tasksInProject = multiplatformProjectTasks[project] ?: mutableSetOf()
|
||||
tasksInProject.add(task.name)
|
||||
|
||||
Reference in New Issue
Block a user