[Gradle, JS] Return back deprecated methods for compatibility

^KT-59604 fixed
This commit is contained in:
Ilya Goncharov
2023-06-28 17:14:52 +00:00
committed by Space Team
parent 16236936e5
commit 0b912b0200
3 changed files with 55 additions and 4 deletions
@@ -75,25 +75,76 @@ interface KotlinJsTargetDsl : KotlinTarget {
}
interface KotlinJsSubTargetDsl {
@Deprecated("Please use distribution(Action)")
@ExperimentalDistributionDsl
fun distribution(body: Distribution.() -> Unit) {
distribution(Action {
it.body()
})
}
@ExperimentalDistributionDsl
fun distribution(body: Action<Distribution>)
@Deprecated("Please use testTask(Action)")
fun testTask(body: KotlinJsTest.() -> Unit) {
testTask(Action {
it.body()
})
}
fun testTask(body: Action<KotlinJsTest>)
val testRuns: NamedDomainObjectContainer<KotlinJsPlatformTestRun>
}
interface KotlinJsBrowserDsl : KotlinJsSubTargetDsl {
@Deprecated("Please use commonWebpackConfig(Action)")
fun commonWebpackConfig(body: KotlinWebpackConfig.() -> Unit) {
commonWebpackConfig(Action {
it.body()
})
}
fun commonWebpackConfig(body: Action<KotlinWebpackConfig>)
@Deprecated("Please use runTask(Action)")
fun runTask(body: KotlinWebpack.() -> Unit) {
runTask(Action {
it.body()
})
}
fun runTask(body: Action<KotlinWebpack>)
@Deprecated("Please use webpackTask(Action)")
fun webpackTask(body: KotlinWebpack.() -> Unit) {
webpackTask(Action {
it.body()
})
}
fun webpackTask(body: Action<KotlinWebpack>)
@Deprecated("Please use dceTask(Action)")
@ExperimentalDceDsl
fun dceTask(body: KotlinJsDce.() -> Unit) {
dceTask(Action {
it.body()
})
}
@ExperimentalDceDsl
fun dceTask(body: Action<KotlinJsDce>)
}
interface KotlinJsNodeDsl : KotlinJsSubTargetDsl {
@Deprecated("Please use runTask(Action)")
fun runTask(body: NodeJsExec.() -> Unit) {
runTask(Action {
it.body()
})
}
fun runTask(body: Action<NodeJsExec>)
}
@@ -84,13 +84,13 @@ abstract class KotlinBrowserJsIr @Inject constructor(target: KotlinJsIrTarget) :
runTaskConfigurations.add {
it.webpackConfigApplier(body)
}
testTask {
testTask(Action {
it.onTestFrameworkSet {
if (it is KotlinKarma) {
body.execute(it.webpackConfig)
}
}
}
})
}
override fun runTask(body: Action<KotlinWebpack>) {
@@ -66,13 +66,13 @@ abstract class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
runTaskConfigurations.add {
it.webpackConfigApplier(body)
}
testTask {
testTask(Action {
it.onTestFrameworkSet {
if (it is KotlinKarma) {
body.execute(it.webpackConfig)
}
}
}
})
}
override fun runTask(body: Action<KotlinWebpack>) {