[Gradle, JS] Add string sompiler setting in js plugin
#KT-38485 fixed
This commit is contained in:
+16
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user