Remove deprecated ConfigureUtil usages in JS configuration DSL
^KT-46019 In Progress
This commit is contained in:
+4
-4
@@ -30,7 +30,7 @@ import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
||||
import org.jetbrains.kotlin.gradle.utils.setProperty
|
||||
import javax.inject.Inject
|
||||
|
||||
open class KotlinJsTarget
|
||||
abstract class KotlinJsTarget
|
||||
@Inject
|
||||
constructor(
|
||||
project: Project,
|
||||
@@ -70,9 +70,9 @@ constructor(
|
||||
if (irTarget == null)
|
||||
super.kotlinComponents
|
||||
else {
|
||||
val mainCompilation = compilations.getByName(KotlinCompilation.MAIN_COMPILATION_NAME)
|
||||
val mainCompilation = compilations.getByName(MAIN_COMPILATION_NAME)
|
||||
val usageContexts = createUsageContexts(mainCompilation) +
|
||||
irTarget!!.createUsageContexts(irTarget!!.compilations.getByName(KotlinCompilation.MAIN_COMPILATION_NAME))
|
||||
irTarget!!.createUsageContexts(irTarget!!.compilations.getByName(MAIN_COMPILATION_NAME))
|
||||
|
||||
val componentName =
|
||||
if (project.kotlinExtension is KotlinMultiplatformExtension)
|
||||
@@ -96,7 +96,7 @@ constructor(
|
||||
|
||||
return usageContexts +
|
||||
DefaultKotlinUsageContext(
|
||||
compilation = compilations.getByName(KotlinCompilation.MAIN_COMPILATION_NAME),
|
||||
compilation = compilations.getByName(MAIN_COMPILATION_NAME),
|
||||
usage = project.usageByName("java-api-jars"),
|
||||
dependencyConfigurationName = commonFakeApiElementsConfigurationName,
|
||||
overrideConfigurationArtifacts = project.setProperty { emptyList() }
|
||||
|
||||
+17
-18
@@ -5,10 +5,9 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.targets.js.dsl
|
||||
|
||||
import groovy.lang.Closure
|
||||
import org.gradle.api.Action
|
||||
import org.gradle.api.GradleException
|
||||
import org.gradle.api.NamedDomainObjectContainer
|
||||
import org.gradle.util.ConfigureUtil
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJsDce
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation
|
||||
@@ -39,17 +38,17 @@ interface KotlinJsTargetDsl : KotlinTarget {
|
||||
|
||||
fun browser() = browser { }
|
||||
fun browser(body: KotlinJsBrowserDsl.() -> Unit)
|
||||
fun browser(fn: Closure<*>) {
|
||||
fun browser(fn: Action<KotlinJsBrowserDsl>) {
|
||||
browser {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
fn.execute(this)
|
||||
}
|
||||
}
|
||||
|
||||
fun nodejs() = nodejs { }
|
||||
fun nodejs(body: KotlinJsNodeDsl.() -> Unit)
|
||||
fun nodejs(fn: Closure<*>) {
|
||||
fun nodejs(fn: Action<KotlinJsNodeDsl>) {
|
||||
nodejs {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
fn.execute(this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,16 +76,16 @@ interface KotlinJsSubTargetDsl {
|
||||
fun distribution(body: Distribution.() -> Unit)
|
||||
|
||||
@ExperimentalDistributionDsl
|
||||
fun distribution(fn: Closure<*>) {
|
||||
fun distribution(fn: Action<Distribution>) {
|
||||
distribution {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
fn.execute(this)
|
||||
}
|
||||
}
|
||||
|
||||
fun testTask(body: KotlinJsTest.() -> Unit)
|
||||
fun testTask(fn: Closure<*>) {
|
||||
fun testTask(fn: Action<KotlinJsTest>) {
|
||||
testTask {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
fn.execute(this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,23 +94,23 @@ interface KotlinJsSubTargetDsl {
|
||||
|
||||
interface KotlinJsBrowserDsl : KotlinJsSubTargetDsl {
|
||||
fun commonWebpackConfig(body: KotlinWebpackConfig.() -> Unit)
|
||||
fun commonWebpackConfig(fn: Closure<*>) {
|
||||
fun commonWebpackConfig(fn: Action<KotlinWebpackConfig>) {
|
||||
commonWebpackConfig {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
fn.execute(this)
|
||||
}
|
||||
}
|
||||
|
||||
fun runTask(body: KotlinWebpack.() -> Unit)
|
||||
fun runTask(fn: Closure<*>) {
|
||||
fun runTask(fn: Action<KotlinWebpack>) {
|
||||
runTask {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
fn.execute(this)
|
||||
}
|
||||
}
|
||||
|
||||
fun webpackTask(body: KotlinWebpack.() -> Unit)
|
||||
fun webpackTask(fn: Closure<*>) {
|
||||
fun webpackTask(fn: Action<KotlinWebpack>) {
|
||||
webpackTask {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
fn.execute(this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,9 +118,9 @@ interface KotlinJsBrowserDsl : KotlinJsSubTargetDsl {
|
||||
fun dceTask(body: KotlinJsDce.() -> Unit)
|
||||
|
||||
@ExperimentalDceDsl
|
||||
fun dceTask(fn: Closure<*>) {
|
||||
fun dceTask(fn: Action<KotlinJsDce>) {
|
||||
dceTask {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
fn.execute(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-6
@@ -5,8 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.gradle.targets.js.dsl
|
||||
|
||||
import groovy.lang.Closure
|
||||
import org.gradle.util.ConfigureUtil
|
||||
import org.gradle.api.Action
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
|
||||
import org.jetbrains.kotlin.gradle.targets.js.binaryen.BinaryenExec
|
||||
import org.jetbrains.kotlin.gradle.targets.js.d8.D8Exec
|
||||
@@ -24,17 +23,17 @@ interface KotlinWasmSubTargetContainerDsl : KotlinTarget {
|
||||
interface KotlinWasmTargetDsl : KotlinJsTargetDsl {
|
||||
fun d8() = d8 { }
|
||||
fun d8(body: KotlinWasmD8Dsl.() -> Unit)
|
||||
fun d8(fn: Closure<*>) {
|
||||
fun d8(fn: Action<KotlinWasmD8Dsl>) {
|
||||
d8 {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
fn.execute(this)
|
||||
}
|
||||
}
|
||||
|
||||
fun applyBinaryen() = applyBinaryen { }
|
||||
fun applyBinaryen(body: BinaryenExec.() -> Unit)
|
||||
fun applyBinaryen(fn: Closure<*>) {
|
||||
fun applyBinaryen(fn: Action<BinaryenExec>) {
|
||||
applyBinaryen {
|
||||
ConfigureUtil.configure(fn, this)
|
||||
fn.execute(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -10,7 +10,6 @@ import org.gradle.api.provider.Provider
|
||||
import org.gradle.api.tasks.Copy
|
||||
import org.gradle.language.base.plugins.LifecycleBasePlugin
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinJsDce
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation
|
||||
import org.jetbrains.kotlin.gradle.report.BuildMetricsReporterService
|
||||
@@ -31,7 +30,7 @@ import org.jetbrains.kotlin.gradle.utils.newFileProperty
|
||||
import java.io.File
|
||||
import javax.inject.Inject
|
||||
|
||||
open class KotlinBrowserJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
||||
abstract class KotlinBrowserJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
||||
KotlinJsIrSubTarget(target, "browser"),
|
||||
KotlinJsBrowserDsl {
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.gradle.tasks.locateTask
|
||||
import org.jetbrains.kotlin.gradle.tasks.withType
|
||||
import javax.inject.Inject
|
||||
|
||||
open class KotlinD8Ir @Inject constructor(target: KotlinJsIrTarget) :
|
||||
abstract class KotlinD8Ir @Inject constructor(target: KotlinJsIrTarget) :
|
||||
KotlinJsIrSubTargetBase(target, "d8"),
|
||||
KotlinWasmD8Dsl {
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
|
||||
import org.jetbrains.kotlin.gradle.utils.setProperty
|
||||
import javax.inject.Inject
|
||||
|
||||
open class KotlinJsIrTarget
|
||||
abstract class KotlinJsIrTarget
|
||||
@Inject
|
||||
constructor(
|
||||
project: Project,
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.gradle.tasks.locateTask
|
||||
import org.jetbrains.kotlin.gradle.tasks.withType
|
||||
import javax.inject.Inject
|
||||
|
||||
open class KotlinNodeJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
||||
abstract class KotlinNodeJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
||||
KotlinJsIrSubTargetBase(target, "node"),
|
||||
KotlinJsNodeDsl {
|
||||
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ import java.io.File
|
||||
import javax.inject.Inject
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinJsDce as KotlinJsDceTask
|
||||
|
||||
open class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
|
||||
abstract class KotlinBrowserJs @Inject constructor(target: KotlinJsTarget) :
|
||||
KotlinJsSubTarget(target, "browser"),
|
||||
KotlinJsBrowserDsl {
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.gradle.tasks.dependsOn
|
||||
import org.jetbrains.kotlin.gradle.tasks.withType
|
||||
import javax.inject.Inject
|
||||
|
||||
open class KotlinNodeJs @Inject constructor(target: KotlinJsTarget) :
|
||||
abstract class KotlinNodeJs @Inject constructor(target: KotlinJsTarget) :
|
||||
KotlinJsSubTarget(target, "node"),
|
||||
KotlinJsNodeDsl {
|
||||
override val testTaskDescription: String
|
||||
|
||||
Reference in New Issue
Block a user