[Gradle][MPP] Mark KotlinTargetsContainer and KotlinTargetHierarchyBuilder with KotlinTargetsDsl annotation

To prevent confusing shortcuts defined on `KotlinTargetsContainer`
when declaring a KotlinTargetHierarchy:

e.g.

```kotlin
kotlin {
    targetHierarchy.default {
        common {
            ios() // <- [DSL_SCOPE_VIOLATION]
            //'fun ios(): Unit' can't be called in this context
            // by implicit receiver. Use the explicit one if necessary
        }
    }
 }
```

^KT-53570 Verification Pending
This commit is contained in:
Sebastian Sellmair
2022-10-07 11:08:14 +02:00
committed by Space Team
parent 0c114b9664
commit da8a18920d
4 changed files with 15 additions and 0 deletions
@@ -4,6 +4,7 @@ package org.jetbrains.kotlin.gradle.plugin
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
@KotlinTargetsDsl
@ExperimentalKotlinGradlePluginApi
interface KotlinTargetHierarchyBuilder {
/* Declaring groups */
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.gradle.plugin
import org.gradle.api.NamedDomainObjectCollection
import org.gradle.api.NamedDomainObjectContainer
@KotlinTargetsDsl
interface KotlinTargetsContainer {
val targets: NamedDomainObjectCollection<KotlinTarget>
}
@@ -0,0 +1,10 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle.plugin
@DslMarker
@Retention(AnnotationRetention.SOURCE)
annotation class KotlinTargetsDsl