Add defaultSourceSet to KotlinCompilation

Previously, the connection between a `KotlinCompilation` and its
default `KotlinSourceSet` (the one automatically created and added into
the compilation) was not expressed in the MPP model in any reasonable
way that can be used in the build scripts.

However, this connection seems to have settled in the build logic, and
it may be useful to be able to get the default source set from a
compilation, for example, to be able to configure dependencies across
several targets in a uniform way.

The metadata compilations don't have their dedicated source sets, but
we can think of commonMain as a default source set for the project's
metadata, is it is currently in fact only contains the declarations from
commonMain.

Issue #KT-27685 Fixed
This commit is contained in:
Sergey Igushkin
2018-11-12 17:21:34 +03:00
parent 581b161611
commit fe64d33ae4
3 changed files with 56 additions and 0 deletions
@@ -29,6 +29,10 @@ interface KotlinCompilation<out T : KotlinCommonOptions> : Named, HasAttributes,
val kotlinSourceSets: Set<KotlinSourceSet>
val defaultSourceSet: KotlinSourceSet
fun defaultSourceSet(configure: KotlinSourceSet.() -> Unit)
val compileDependencyConfigurationName: String
var compileDependencyFiles: FileCollection