[Gradle, JS] Add string sompiler setting in js plugin

#KT-38485 fixed
This commit is contained in:
Ilya Goncharov
2020-04-21 18:41:38 +03:00
parent dfb8fea2c7
commit c7f7f2bcbb
@@ -162,6 +162,17 @@ open class KotlinJsProjectExtension :
body: KotlinJsTargetDsl.() -> Unit = { }
): KotlinJsTargetDsl = jsInternal(compiler, body)
fun js(
compiler: String,
body: KotlinJsTargetDsl.() -> Unit = { }
): KotlinJsTargetDsl = js(
KotlinJsCompilerType.byArgument(compiler)
?: throw IllegalArgumentException(
"Unable to find $compiler setting. Use [${KotlinJsCompilerType.values().toList().joinToString()}]"
),
body
)
fun js(
body: KotlinJsTargetDsl.() -> Unit = { }
) = jsInternal(body = body)
@@ -173,6 +184,11 @@ open class KotlinJsProjectExtension :
ConfigureUtil.configure(configure, this)
}
fun js(compiler: String, configure: Closure<*>) =
js(compiler = compiler) {
ConfigureUtil.configure(configure, this)
}
fun js(configure: Closure<*>) = jsInternal {
ConfigureUtil.configure(configure, this)
}