Use project.container instead of WrapUtil

In Gradle 5.2 the 'WrapUtil.toNamedDomainObjectSet' method
was removed. This patches replaces usage of this method
with call of the 'Project.container' method.

Issue #KT-29725 Fixed
This commit is contained in:
Ilya Matveev
2019-02-05 14:18:42 +03:00
parent 1a630773cf
commit ecbadcdf6f
2 changed files with 12 additions and 2 deletions
@@ -1524,4 +1524,14 @@ class NewMultiplatformIT : BaseGradleIT() {
)
}
}
@Test
fun testKt29725() {
with(Project("new-mpp-native-libraries", GradleVersionRequired.Exact("5.2"))) {
// Assert that a project with a native target can be configured with Gradle 5.2
build("tasks") {
assertSuccessful()
}
}
}
}
@@ -26,14 +26,14 @@ open class KotlinNativeBinaryContainer @Inject constructor(
) : AbstractKotlinNativeBinaryContainer(),
DomainObjectSet<NativeBinary> by backingContainer
{
override val project: Project
final override val project: Project
get() = target.project
private val defaultCompilation: KotlinNativeCompilation
get() = target.compilations.getByName(KotlinCompilation.MAIN_COMPILATION_NAME)
private val nameToBinary = mutableMapOf<String, NativeBinary>()
internal val prefixGroups: NamedDomainObjectSet<PrefixGroup> = WrapUtil.toNamedDomainObjectSet(PrefixGroup::class.java)
internal val prefixGroups: NamedDomainObjectSet<PrefixGroup> = project.container(PrefixGroup::class.java)
// region DSL getters.
private inline fun <reified T : NativeBinary> getBinary(