[Gradle, JS] Add methods with string definition of compiler
This commit is contained in:
+35
@@ -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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user