Skip to content

Commit 0ec7678

Browse files
committed
[Gradle, JS] Return back deprecated methods for compatibility
^KT-59604 fixed (cherry picked from commit 0b912b0)
1 parent 2427b51 commit 0ec7678

File tree

3 files changed

+55
-4
lines changed

3 files changed

+55
-4
lines changed

libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/js/dsl/KotlinJsTargetDsl.kt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,76 @@ interface KotlinJsTargetDsl : KotlinTarget {
7575
}
7676

7777
interface KotlinJsSubTargetDsl {
78+
@Deprecated("Please use distribution(Action)")
79+
@ExperimentalDistributionDsl
80+
fun distribution(body: Distribution.() -> Unit) {
81+
distribution(Action {
82+
it.body()
83+
})
84+
}
85+
7886
@ExperimentalDistributionDsl
7987
fun distribution(body: Action<Distribution>)
8088

89+
@Deprecated("Please use testTask(Action)")
90+
fun testTask(body: KotlinJsTest.() -> Unit) {
91+
testTask(Action {
92+
it.body()
93+
})
94+
}
95+
8196
fun testTask(body: Action<KotlinJsTest>)
8297

8398
val testRuns: NamedDomainObjectContainer<KotlinJsPlatformTestRun>
8499
}
85100

86101
interface KotlinJsBrowserDsl : KotlinJsSubTargetDsl {
102+
@Deprecated("Please use commonWebpackConfig(Action)")
103+
fun commonWebpackConfig(body: KotlinWebpackConfig.() -> Unit) {
104+
commonWebpackConfig(Action {
105+
it.body()
106+
})
107+
}
108+
87109
fun commonWebpackConfig(body: Action<KotlinWebpackConfig>)
88110

111+
@Deprecated("Please use runTask(Action)")
112+
fun runTask(body: KotlinWebpack.() -> Unit) {
113+
runTask(Action {
114+
it.body()
115+
})
116+
}
117+
89118
fun runTask(body: Action<KotlinWebpack>)
90119

120+
@Deprecated("Please use webpackTask(Action)")
121+
fun webpackTask(body: KotlinWebpack.() -> Unit) {
122+
webpackTask(Action {
123+
it.body()
124+
})
125+
}
126+
91127
fun webpackTask(body: Action<KotlinWebpack>)
92128

129+
@Deprecated("Please use dceTask(Action)")
130+
@ExperimentalDceDsl
131+
fun dceTask(body: KotlinJsDce.() -> Unit) {
132+
dceTask(Action {
133+
it.body()
134+
})
135+
}
136+
93137
@ExperimentalDceDsl
94138
fun dceTask(body: Action<KotlinJsDce>)
95139
}
96140

97141
interface KotlinJsNodeDsl : KotlinJsSubTargetDsl {
142+
@Deprecated("Please use runTask(Action)")
143+
fun runTask(body: NodeJsExec.() -> Unit) {
144+
runTask(Action {
145+
it.body()
146+
})
147+
}
148+
98149
fun runTask(body: Action<NodeJsExec>)
99150
}

libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/js/ir/KotlinBrowserJsIr.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ abstract class KotlinBrowserJsIr @Inject constructor(target: KotlinJsIrTarget) :
8484
runTaskConfigurations.add {
8585
it.webpackConfigApplier(body)
8686
}
87-
testTask {
87+
testTask(Action {
8888
it.onTestFrameworkSet {
8989
if (it is KotlinKarma) {
9090
body.execute(it.webpackConfig)
9191
}
9292
}
93-
}
93+
})
9494
}
9595

9696
override fun runTask(body: Action<KotlinWebpack>) {

libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/js/subtargets/KotlinBrowserJs.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ abstract class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
6666
runTaskConfigurations.add {
6767
it.webpackConfigApplier(body)
6868
}
69-
testTask {
69+
testTask(Action {
7070
it.onTestFrameworkSet {
7171
if (it is KotlinKarma) {
7272
body.execute(it.webpackConfig)
7373
}
7474
}
75-
}
75+
})
7676
}
7777

7878
override fun runTask(body: Action<KotlinWebpack>) {

0 commit comments

Comments
 (0)