[Gradle] KotlinTargetHierarchyBuilder: Add documentation to 'common' function

^KT-58209 Verification Pending
This commit is contained in:
Sebastian Sellmair
2023-04-24 14:47:21 +02:00
committed by Space Team
parent 52cbad2da2
commit 1d23d7de17
@@ -16,6 +16,24 @@ interface KotlinTargetHierarchyBuilder {
}
/* Declaring groups */
/**
* Shortcut for `group("common") { }`:
* Most hierarchies should attach their nodes/groups to 'common'
*
* e.g.
* ```
* common {
* group("native") {
* withIos()
* withMacos()
* }
* }
* ```
* applying the shown hierarchy to the main compilations will create a 'nativeMain' source set which will
* depend on the usual 'commonMain'
*
*/
fun common(build: KotlinTargetHierarchyBuilder.() -> Unit) = group("common", build)
fun group(name: String, build: KotlinTargetHierarchyBuilder.() -> Unit = {})