Skip to content

Commit

Permalink
[Gradle, JS] Return back deprecated methods for compatibility
Browse files Browse the repository at this point in the history
^KT-59604 fixed

(cherry picked from commit 0b912b0)
  • Loading branch information
ilgonmic committed Jun 28, 2023
1 parent 2427b51 commit 0ec7678
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
Expand Up @@ -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>)
}
Expand Up @@ -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>) {
Expand Down
Expand Up @@ -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>) {
Expand Down

0 comments on commit 0ec7678

Please sign in to comment.