Add only non-jdk classpath entries from the compiler to script
remove unnecessary manifest classpath entries in the saved compiled script jar
This commit is contained in:
+4
-1
@@ -11,6 +11,8 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.NoScopeRecordCliBindingTrace
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM
|
||||
import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot
|
||||
import org.jetbrains.kotlin.cli.jvm.config.JvmContentRoot
|
||||
import org.jetbrains.kotlin.cli.jvm.config.jvmClasspathRoots
|
||||
import org.jetbrains.kotlin.codegen.ClassBuilderFactories
|
||||
import org.jetbrains.kotlin.codegen.KotlinCodegenFacade
|
||||
@@ -126,7 +128,8 @@ private fun compileImpl(
|
||||
// performed with the expected classpath
|
||||
// TODO: make this logic obsolete by injecting classpath earlier in the pipeline
|
||||
val depsFromConfiguration = get(dependencies)?.flatMapTo(HashSet()) { (it as? JvmDependency)?.classpath ?: emptyList() }
|
||||
val depsFromCompiler = context.environment.configuration.jvmClasspathRoots
|
||||
val depsFromCompiler = context.environment.configuration.getList(CLIConfigurationKeys.CONTENT_ROOTS)
|
||||
.mapNotNull { if (it is JvmClasspathRoot && !it.isSdkRoot) it.file else null }
|
||||
if (!depsFromConfiguration.isNullOrEmpty()) {
|
||||
val missingDeps = depsFromCompiler.filter { !depsFromConfiguration.contains(it) }
|
||||
if (missingDeps.isNotEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user