Remove deprecated ConfigureUtil usages in KotlinNativeBinaryContainer

^KT-46019 In Progress
This commit is contained in:
Yahor Berdnikau
2022-06-27 23:00:14 +02:00
committed by Space
parent e765d65b50
commit ae3451e2c8
3 changed files with 27 additions and 29 deletions
@@ -72,15 +72,15 @@ private fun generateFactoryMethods(binaryType: BinaryType): String {
fun $methodName(
namePrefix: String,
buildTypes: Collection<$nativeBuildType> = $nativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = $methodName(namePrefix, buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<$className>
) = $methodName(namePrefix, buildTypes) { configure.execute(this) }
/** Creates $binaryDescription with the default name prefix for each build type and configures it. */
@JvmOverloads
fun $methodName(
buildTypes: Collection<$nativeBuildType> = $nativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = $methodName(buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<$className>
) = $methodName(buildTypes) { configure.execute(this) }
""".trimIndent()
}
@@ -138,10 +138,9 @@ fun generateAbstractKotlinNativeBinaryContainer() {
val superClassName = typeName("org.gradle.api.DomainObjectSet", nativeBinaryBaseClass.fqName)
val imports = """
import groovy.lang.Closure
import org.gradle.api.Action
import org.gradle.api.DomainObjectSet
import org.gradle.api.Project
import org.gradle.util.ConfigureUtil
import $MPP_PACKAGE.*
""".trimIndent()
@@ -1,9 +1,8 @@
package org.jetbrains.kotlin.gradle.dsl
import groovy.lang.Closure
import org.gradle.api.Action
import org.gradle.api.DomainObjectSet
import org.gradle.api.Project
import org.gradle.util.ConfigureUtil
import org.jetbrains.kotlin.gradle.plugin.mpp.*
// DO NOT EDIT MANUALLY! Generated by org.jetbrains.kotlin.generators.gradle.dsl.MppNativeBinaryDSLCodegenKt
@@ -188,15 +187,15 @@ abstract class AbstractKotlinNativeBinaryContainer : DomainObjectSet<NativeBinar
fun executable(
namePrefix: String,
buildTypes: Collection<NativeBuildType> = NativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = executable(namePrefix, buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<Executable>
) = executable(namePrefix, buildTypes) { configure.execute(this) }
/** Creates an executable with the default name prefix for each build type and configures it. */
@JvmOverloads
fun executable(
buildTypes: Collection<NativeBuildType> = NativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = executable(buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<Executable>
) = executable(buildTypes) { configure.execute(this) }
/** Creates a static library with the given [namePrefix] for each build type and configures it. */
@JvmOverloads
@@ -218,15 +217,15 @@ abstract class AbstractKotlinNativeBinaryContainer : DomainObjectSet<NativeBinar
fun staticLib(
namePrefix: String,
buildTypes: Collection<NativeBuildType> = NativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = staticLib(namePrefix, buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<StaticLibrary>
) = staticLib(namePrefix, buildTypes) { configure.execute(this) }
/** Creates a static library with the default name prefix for each build type and configures it. */
@JvmOverloads
fun staticLib(
buildTypes: Collection<NativeBuildType> = NativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = staticLib(buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<StaticLibrary>
) = staticLib(buildTypes) { configure.execute(this) }
/** Creates a shared library with the given [namePrefix] for each build type and configures it. */
@JvmOverloads
@@ -248,15 +247,15 @@ abstract class AbstractKotlinNativeBinaryContainer : DomainObjectSet<NativeBinar
fun sharedLib(
namePrefix: String,
buildTypes: Collection<NativeBuildType> = NativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = sharedLib(namePrefix, buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<SharedLibrary>
) = sharedLib(namePrefix, buildTypes) { configure.execute(this) }
/** Creates a shared library with the default name prefix for each build type and configures it. */
@JvmOverloads
fun sharedLib(
buildTypes: Collection<NativeBuildType> = NativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = sharedLib(buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<SharedLibrary>
) = sharedLib(buildTypes) { configure.execute(this) }
/** Creates an Objective-C framework with the given [namePrefix] for each build type and configures it. */
@JvmOverloads
@@ -278,15 +277,15 @@ abstract class AbstractKotlinNativeBinaryContainer : DomainObjectSet<NativeBinar
fun framework(
namePrefix: String,
buildTypes: Collection<NativeBuildType> = NativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = framework(namePrefix, buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<Framework>
) = framework(namePrefix, buildTypes) { configure.execute(this) }
/** Creates an Objective-C framework with the default name prefix for each build type and configures it. */
@JvmOverloads
fun framework(
buildTypes: Collection<NativeBuildType> = NativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = framework(buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<Framework>
) = framework(buildTypes) { configure.execute(this) }
/** Creates a test executable with the given [namePrefix] for each build type and configures it. */
@JvmOverloads
@@ -308,14 +307,14 @@ abstract class AbstractKotlinNativeBinaryContainer : DomainObjectSet<NativeBinar
fun test(
namePrefix: String,
buildTypes: Collection<NativeBuildType> = NativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = test(namePrefix, buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<TestExecutable>
) = test(namePrefix, buildTypes) { configure.execute(this) }
/** Creates a test executable with the default name prefix for each build type and configures it. */
@JvmOverloads
fun test(
buildTypes: Collection<NativeBuildType> = NativeBuildType.DEFAULT_BUILD_TYPES,
configureClosure: Closure<*>
) = test(buildTypes) { ConfigureUtil.configure(configureClosure, this) }
configure: Action<TestExecutable>
) = test(buildTypes) { configure.execute(this) }
}
@@ -22,7 +22,7 @@ Use the following naming scheme:
executable([debug]) -> debugExecutable
*/
open class KotlinNativeBinaryContainer @Inject constructor(
abstract class KotlinNativeBinaryContainer @Inject constructor(
override val target: KotlinNativeTarget,
backingContainer: DomainObjectSet<NativeBinary>
) : AbstractKotlinNativeBinaryContainer(),