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. */
|
/** Base class for both interop and compiler tasks. */
|
||||||
abstract class KonanBuildingTask: KonanArtifactWithLibrariesTask(), KonanBuildingSpec {
|
abstract class KonanBuildingTask: KonanArtifactWithLibrariesTask(), KonanBuildingSpec {
|
||||||
|
|
||||||
@get:Internal
|
|
||||||
internal abstract val toolRunner: KonanToolRunner
|
|
||||||
|
|
||||||
override fun init(config: KonanBuildingConfig<*>, destinationDir: File, artifactName: String, target: KonanTarget) {
|
override fun init(config: KonanBuildingConfig<*>, destinationDir: File, artifactName: String, target: KonanTarget) {
|
||||||
super.init(config, destinationDir, artifactName, target)
|
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 {
|
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
|
abstract val produce: CompilerOutputKind
|
||||||
@Internal get
|
@Internal get
|
||||||
|
|
||||||
@@ -331,11 +328,15 @@ abstract class KonanCompileTask @Inject constructor(private val layout: ProjectL
|
|||||||
}
|
}
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
@get:Internal
|
||||||
|
val isolatedClassLoadersService = KonanCliRunnerIsolatedClassLoadersService.attachingToTask(this)
|
||||||
|
|
||||||
override fun run() {
|
override fun run() {
|
||||||
destinationDir.mkdirs()
|
destinationDir.mkdirs()
|
||||||
if (dumpParameters) {
|
if (dumpParameters) {
|
||||||
dumpProperties(this)
|
dumpProperties(this)
|
||||||
}
|
}
|
||||||
|
val toolRunner = KonanCliCompilerRunner(project, isolatedClassLoadersService, project.konanExtension.jvmArgs)
|
||||||
if (enableTwoStageCompilation) {
|
if (enableTwoStageCompilation) {
|
||||||
logger.info("Start two-stage compilation")
|
logger.info("Start two-stage compilation")
|
||||||
val intermediateDir = konanBuildRoot
|
val intermediateDir = konanBuildRoot
|
||||||
|
|||||||
+6
-7
@@ -28,11 +28,6 @@ import javax.inject.Inject
|
|||||||
|
|
||||||
abstract class KonanInteropTask @Inject constructor(private val workerExecutor: WorkerExecutor) : KonanBuildingTask(), KonanInteropSpec {
|
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) {
|
override fun init(config: KonanBuildingConfig<*>, destinationDir: File, artifactName: String, target: KonanTarget) {
|
||||||
super.init(config, destinationDir, artifactName, target)
|
super.init(config, destinationDir, artifactName, target)
|
||||||
this.notCompatibleWithConfigurationCache("Unsupported inputs")
|
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() {
|
override fun run() {
|
||||||
|
val interopRunner = KonanCliInteropRunner(project, isolatedClassLoadersService, project.konanExtension.jvmArgs)
|
||||||
interopRunner.init(target)
|
interopRunner.init(target)
|
||||||
|
|
||||||
destinationDir.mkdirs()
|
destinationDir.mkdirs()
|
||||||
@@ -193,13 +192,13 @@ abstract class KonanInteropTask @Inject constructor(private val workerExecutor:
|
|||||||
val args = buildArgs()
|
val args = buildArgs()
|
||||||
if (enableParallel) {
|
if (enableParallel) {
|
||||||
val workQueue = workerExecutor.noIsolation()
|
val workQueue = workerExecutor.noIsolation()
|
||||||
interchangeBox[this.path] = toolRunner
|
interchangeBox[this.path] = interopRunner
|
||||||
workQueue.submit(RunTool::class.java) {
|
workQueue.submit(RunTool::class.java) {
|
||||||
taskName = path
|
taskName = path
|
||||||
this.args = args
|
this.args = args
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
toolRunner.run(args)
|
interopRunner.run(args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user