[Gradle, JS] Fix once initialization of produceExecutable

#KT-38055 fixed
This commit is contained in:
Ilya Goncharov
2020-04-06 20:38:14 +03:00
parent c3ee2c81ed
commit 626e7d14ec
4 changed files with 23 additions and 9 deletions
@@ -81,13 +81,13 @@ class Kotlin2JsIrGradlePluginIT : AbstractKotlin2JsGradlePluginIT(true) {
val appProject = transformProjectWithPluginsDsl(
projectName = "app",
directoryPrefix = rootProjectName,
wrapperVersion = GradleVersionRequired.AtLeast("5.3")
wrapperVersion = GradleVersionRequired.AtLeast("5.5")
)
val libProject = transformProjectWithPluginsDsl(
projectName = "lib",
directoryPrefix = rootProjectName,
wrapperVersion = GradleVersionRequired.AtLeast("5.3")
wrapperVersion = GradleVersionRequired.AtLeast("5.5")
)
libProject.gradleProperties().appendText(jsCompilerType(KotlinJsCompilerType.IR))
@@ -8,10 +8,17 @@ repositories {
mavenCentral()
}
kotlin.js {
binaries.executable()
nodejs()
browser()
kotlin {
js {
nodejs()
binaries.executable()
}
}
kotlin {
js {
browser()
binaries.executable()
}
}
tasks.named("browserTest") {
@@ -57,9 +57,12 @@ abstract class KotlinJsIrSubTarget(
}
}
internal val produceExecutable: () -> Unit by lazy {
private val produceExecutable: Unit by lazy {
configureMain()
return@lazy { Unit }
}
internal fun produceExecutable() {
produceExecutable
}
override fun testTask(body: KotlinJsTest.() -> Unit) {
@@ -42,10 +42,14 @@ abstract class KotlinJsSubTarget(
protected val taskGroupName = "Kotlin $disambiguationClassifier"
internal open fun produceExecutable() {
private val produceExecutable: Unit by lazy {
configureMain()
}
internal fun produceExecutable() {
produceExecutable
}
internal fun configure() {
NpmResolverPlugin.apply(project)