[Gradle, JS] Use experimental dce annotation
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.targets.js.dsl
|
||||
|
||||
@Experimental
|
||||
@Target(AnnotationTarget.FUNCTION)
|
||||
annotation class ExperimentalDce
|
||||
+3
@@ -61,7 +61,10 @@ interface KotlinJsBrowserDsl : KotlinJsSubTargetDsl {
|
||||
}
|
||||
}
|
||||
|
||||
@ExperimentalDce
|
||||
fun dceTask(body: KotlinJsDce.() -> Unit)
|
||||
|
||||
@ExperimentalDce
|
||||
fun dceTask(fn: Closure<*>) {
|
||||
dceTask {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
|
||||
+2
@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation
|
||||
import org.jetbrains.kotlin.gradle.targets.js.KotlinJsTarget
|
||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.BuildVariant
|
||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.BuildVariantKind
|
||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalDce
|
||||
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBrowserDsl
|
||||
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.npmProject
|
||||
@@ -56,6 +57,7 @@ open class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
|
||||
(project.tasks.getByName(webpackTaskName) as KotlinWebpack).body()
|
||||
}
|
||||
|
||||
@ExperimentalDce
|
||||
override fun dceTask(body: KotlinJsDce.() -> Unit) {
|
||||
dceConfigurations.add(body)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user