[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 = { }
|
body: KotlinJsTargetDsl.() -> Unit = { }
|
||||||
): KotlinJsTargetDsl = jsInternal(compiler, body)
|
): 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(
|
fun js(
|
||||||
body: KotlinJsTargetDsl.() -> Unit = { }
|
body: KotlinJsTargetDsl.() -> Unit = { }
|
||||||
) = jsInternal(body = body)
|
) = jsInternal(body = body)
|
||||||
@@ -173,6 +184,11 @@ open class KotlinJsProjectExtension :
|
|||||||
ConfigureUtil.configure(configure, this)
|
ConfigureUtil.configure(configure, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun js(compiler: String, configure: Closure<*>) =
|
||||||
|
js(compiler = compiler) {
|
||||||
|
ConfigureUtil.configure(configure, this)
|
||||||
|
}
|
||||||
|
|
||||||
fun js(configure: Closure<*>) = jsInternal {
|
fun js(configure: Closure<*>) = jsInternal {
|
||||||
ConfigureUtil.configure(configure, this)
|
ConfigureUtil.configure(configure, this)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user