LazyKotlincDistDownloaderAndUnpacker: put js.engines.jar from bundled dist

GitOrigin-RevId: bde338ae3d8c57589303effaea17827f80b3efe9
This commit is contained in:
Nikita Bobko
2022-05-27 16:19:30 +00:00
committed by intellij-monorepo-bot
parent 84c76075b0
commit afeb7745fd
2 changed files with 6 additions and 0 deletions
@@ -29,6 +29,10 @@ sealed class KotlinPluginLayout {
*/
abstract val jpsPluginClasspath: List<File>
val jsEngines by lazy {
kotlinc.resolve("lib").resolve("js.engines.jar").also { check(it.exists()) { "$it doesn't exist" } }
}
/**
* Version of the stand-alone compiler (artifacts in the 'kotlinc/' directory of the Kotlin plugin).
* Stand-alone compiler is always stable in 'master' and release branches. It is used for compilation with JPS.
@@ -62,6 +62,8 @@ private class LazyDistDirLayoutProducer(version: String, private val unpackedDis
for (jarInMavenRepo in input) {
jarInMavenRepo.copyTo(lib.resolve(getDistJarNameFromMavenJar(jarInMavenRepo) ?: continue))
}
val jsEngines = KotlinPluginLayout.instance.jsEngines
jsEngines.copyTo(lib.resolve(jsEngines.name)) // js.engines is required to avoid runtime errors when compiling kts via JPS
return listOf(unpackedDistDestination)
}