dependsOn

abstract fun dependsOn(other: KotlinSourceSet)

Adds a Kotlin-specific relation to the other source set.

Consider a general example that has Kotlin source sets A and B. The expression A.dependsOn(B) instructs Kotlin that:

  • A observes the API from B, including internal declarations.

  • A can provide actual implementations for expected declarations from B if and only if A.dependsOn(B), either directly or through a transitive dependsOn relationship. This is both a necessary and sufficient condition.

  • Source code from A will always compile together with source code from B. The opposite is not true!

  • A extends dependencies from all dependency configurations of B.

  • A inherits all KotlinSourceSets that B has a dependsOn relationship with.

For more information, see dependsOn and source set hierarchies.


Returns a set of source sets that have a dependsOn relationship with this source set.

Return

a set of source sets added with dependsOn relationship at the current state of configuration. Note that the Kotlin Gradle plugin may add additional required source sets on late stages of Gradle configuration and the most reliable way to get a full final set is to use this property as a task input with org.gradle.api.provider.Provider type.