[Gradle, JS] Add methods with string definition of compiler

This commit is contained in:
Ilya Goncharov
2020-02-19 16:31:14 +03:00
parent 203ca018e5
commit 92291c03e8
@@ -27,6 +27,19 @@ interface KotlinTargetContainerWithJsPresetFunctions :
configure configure
) )
fun js(
name: String,
compiler: String,
configure: KotlinJsTargetDsl.() -> Unit = { }
) = js(
name = name,
compiler = KotlinJsCompilerType.byArgument(compiler)
?: throw IllegalArgumentException(
"Unable to find $compiler setting. Use [${KotlinJsCompilerType.values().toList().joinToString()}]"
),
configure = configure
)
fun js( fun js(
name: String = "js", name: String = "js",
configure: KotlinJsTargetDsl.() -> Unit = { } configure: KotlinJsTargetDsl.() -> Unit = { }
@@ -42,4 +55,26 @@ interface KotlinTargetContainerWithJsPresetFunctions :
fun js(name: String, configure: Closure<*>) = js(name = name) { ConfigureUtil.configure(configure, this) } fun js(name: String, configure: Closure<*>) = js(name = name) { ConfigureUtil.configure(configure, this) }
fun js(compiler: KotlinJsCompilerType, configure: Closure<*>) = js(compiler = compiler) { ConfigureUtil.configure(configure, this) } fun js(compiler: KotlinJsCompilerType, configure: Closure<*>) = js(compiler = compiler) { ConfigureUtil.configure(configure, this) }
fun js(configure: Closure<*>) = js { ConfigureUtil.configure(configure, this) } fun js(configure: Closure<*>) = js { ConfigureUtil.configure(configure, this) }
fun js(
name: String,
compiler: KotlinJsCompilerType,
configure: Closure<*>
) = js(
name = name,
compiler = compiler
) {
ConfigureUtil.configure(configure, this)
}
fun js(
name: String,
compiler: String,
configure: Closure<*>
) = js(
name = name,
compiler = compiler
) {
ConfigureUtil.configure(configure, this)
}
} }