[Gradle, JS] Do not duplicate target initialization
This commit is contained in:
+2
@@ -117,6 +117,7 @@ open class KotlinJsProjectExtension :
|
|||||||
compiler: JsCompilerType = defaultJsCompilerType,
|
compiler: JsCompilerType = defaultJsCompilerType,
|
||||||
body: KotlinJsTargetDsl.() -> Unit
|
body: KotlinJsTargetDsl.() -> Unit
|
||||||
) {
|
) {
|
||||||
|
if (_target == null) {
|
||||||
val target: KotlinJsTargetDsl = when (compiler) {
|
val target: KotlinJsTargetDsl = when (compiler) {
|
||||||
legacy -> legacyPreset
|
legacy -> legacyPreset
|
||||||
.also { it.irPreset = null }
|
.also { it.irPreset = null }
|
||||||
@@ -140,6 +141,7 @@ open class KotlinJsProjectExtension :
|
|||||||
this._target = target
|
this._target = target
|
||||||
|
|
||||||
target.project.components.addAll(target.components)
|
target.project.components.addAll(target.components)
|
||||||
|
}
|
||||||
|
|
||||||
target.run(body)
|
target.run(body)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user