[Gradle][MPP] Ensure presence of .defaultSourceSet when creating kotlinCompilations

This will finally make calls to KotlinCompilation.defaultSourceSet
or sourceSets.getByName(compilation.defaultSourceSetName) safe.

This will also enable removing the `kotlinSourceSetsIncludingDefault`
pitfall

^KT-52726 Verification Pending
This commit is contained in:
Sebastian Sellmair
2022-09-09 13:16:07 +02:00
committed by Space
parent 5f085f0448
commit f4eba62f8c
30 changed files with 217 additions and 198 deletions
@@ -33,7 +33,8 @@ interface KotlinCompilation<out T : KotlinCommonOptions> : Named, HasAttributes,
val allKotlinSourceSets: Set<KotlinSourceSet>
val defaultSourceSetName: String
@Deprecated("Use defaultSourceSet.name instead", ReplaceWith("defaultSourceSet.name"))
val defaultSourceSetName: String get() = defaultSourceSet.name
val defaultSourceSet: KotlinSourceSet