Postpone KonanCliCompilerRunner creation to workaround issues when consuming native dist
Required for KTI-1553
This commit is contained in:
committed by
Space Team
parent
bfbdf79207
commit
bbbe5027f4
-4
@@ -17,10 +17,6 @@ import org.jetbrains.kotlin.gradle.plugin.konan.KonanToolRunner
|
||||
|
||||
/** Base class for both interop and compiler tasks. */
|
||||
abstract class KonanBuildingTask: KonanArtifactWithLibrariesTask(), KonanBuildingSpec {
|
||||
|
||||
@get:Internal
|
||||
internal abstract val toolRunner: KonanToolRunner
|
||||
|
||||
override fun init(config: KonanBuildingConfig<*>, destinationDir: File, artifactName: String, target: KonanTarget) {
|
||||
super.init(config, destinationDir, artifactName, target)
|
||||
}
|
||||
|
||||
+4
-3
@@ -21,9 +21,6 @@ import javax.inject.Inject
|
||||
*/
|
||||
abstract class KonanCompileTask @Inject constructor(private val layout: ProjectLayout): KonanBuildingTask(), KonanCompileSpec {
|
||||
|
||||
@get:Internal
|
||||
override val toolRunner = KonanCliCompilerRunner(project, KonanCliRunnerIsolatedClassLoadersService.attachingToTask(this), project.konanExtension.jvmArgs)
|
||||
|
||||
abstract val produce: CompilerOutputKind
|
||||
@Internal get
|
||||
|
||||
@@ -331,11 +328,15 @@ abstract class KonanCompileTask @Inject constructor(private val layout: ProjectL
|
||||
}
|
||||
// endregion
|
||||
|
||||
@get:Internal
|
||||
val isolatedClassLoadersService = KonanCliRunnerIsolatedClassLoadersService.attachingToTask(this)
|
||||
|
||||
override fun run() {
|
||||
destinationDir.mkdirs()
|
||||
if (dumpParameters) {
|
||||
dumpProperties(this)
|
||||
}
|
||||
val toolRunner = KonanCliCompilerRunner(project, isolatedClassLoadersService, project.konanExtension.jvmArgs)
|
||||
if (enableTwoStageCompilation) {
|
||||
logger.info("Start two-stage compilation")
|
||||
val intermediateDir = konanBuildRoot
|
||||
|
||||
+6
-7
@@ -28,11 +28,6 @@ import javax.inject.Inject
|
||||
|
||||
abstract class KonanInteropTask @Inject constructor(private val workerExecutor: WorkerExecutor) : KonanBuildingTask(), KonanInteropSpec {
|
||||
|
||||
private val interopRunner = KonanCliInteropRunner(project, KonanCliRunnerIsolatedClassLoadersService.attachingToTask(this), project.konanExtension.jvmArgs)
|
||||
|
||||
@get:Internal
|
||||
override val toolRunner: KonanToolRunner = interopRunner
|
||||
|
||||
override fun init(config: KonanBuildingConfig<*>, destinationDir: File, artifactName: String, target: KonanTarget) {
|
||||
super.init(config, destinationDir, artifactName, target)
|
||||
this.notCompatibleWithConfigurationCache("Unsupported inputs")
|
||||
@@ -183,7 +178,11 @@ abstract class KonanInteropTask @Inject constructor(private val workerExecutor:
|
||||
}
|
||||
}
|
||||
|
||||
@get:Internal
|
||||
val isolatedClassLoadersService = KonanCliRunnerIsolatedClassLoadersService.attachingToTask(this)
|
||||
|
||||
override fun run() {
|
||||
val interopRunner = KonanCliInteropRunner(project, isolatedClassLoadersService, project.konanExtension.jvmArgs)
|
||||
interopRunner.init(target)
|
||||
|
||||
destinationDir.mkdirs()
|
||||
@@ -193,13 +192,13 @@ abstract class KonanInteropTask @Inject constructor(private val workerExecutor:
|
||||
val args = buildArgs()
|
||||
if (enableParallel) {
|
||||
val workQueue = workerExecutor.noIsolation()
|
||||
interchangeBox[this.path] = toolRunner
|
||||
interchangeBox[this.path] = interopRunner
|
||||
workQueue.submit(RunTool::class.java) {
|
||||
taskName = path
|
||||
this.args = args
|
||||
}
|
||||
} else {
|
||||
toolRunner.run(args)
|
||||
interopRunner.run(args)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user