aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/main/kotlin/org/jetbrains
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2022-09-27 07:05:36 +0200
committerGitHub <noreply@github.com>2022-09-27 07:05:36 +0200
commita7750c6447230abb409a05bf1686c78632696df4 (patch)
tree9fd7b54bd27d9590046596a2fe6b165e59444567 /runners/gradle-plugin/src/main/kotlin/org/jetbrains
parent86f9559ebd40a07e996df49464fc9101dd21d3bc (diff)
downloaddokka-a7750c6447230abb409a05bf1686c78632696df4.tar.gz
dokka-a7750c6447230abb409a05bf1686c78632696df4.tar.bz2
dokka-a7750c6447230abb409a05bf1686c78632696df4.zip
Update Kotlin to 1.7.20-RC (#2682)
Diffstat (limited to 'runners/gradle-plugin/src/main/kotlin/org/jetbrains')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinCompilationUtils.kt34
1 files changed, 22 insertions, 12 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinCompilationUtils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinCompilationUtils.kt
index fdb4642c..1d06e608 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinCompilationUtils.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinCompilationUtils.kt
@@ -10,26 +10,36 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
internal typealias KotlinCompilation =
org.jetbrains.kotlin.gradle.plugin.KotlinCompilation<KotlinCommonOptions>
+internal fun Project.compilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> {
+ //KT-45412 Make sure .kotlinSourceSets and .allKotlinSourceSets include the default source set
+ return allCompilationsOf(sourceSet).filter { compilation ->
+ sourceSet in compilation.kotlinSourceSets || sourceSet == compilation.defaultSourceSet
+ }
+}
+
internal fun Project.allCompilationsOf(
sourceSet: KotlinSourceSet
): List<KotlinCompilation> {
return when (val kotlin = kotlin) {
- is KotlinMultiplatformExtension -> kotlin.allCompilationsOf(sourceSet)
- is KotlinSingleTargetExtension -> kotlin.allCompilationsOf(sourceSet)
+ is KotlinMultiplatformExtension -> allCompilationsOf(kotlin, sourceSet)
+ is KotlinSingleTargetExtension<*> -> allCompilationsOf(kotlin, sourceSet)
else -> emptyList()
}
}
-internal fun Project.compilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> {
- //KT-45412 Make sure .kotlinSourceSets and .allKotlinSourceSets include the default source set
- return allCompilationsOf(sourceSet).filter { compilation -> sourceSet in compilation.kotlinSourceSets || sourceSet == compilation.defaultSourceSet }
-}
-
-private fun KotlinMultiplatformExtension.allCompilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> {
- val allCompilations = targets.flatMap { target -> target.compilations }
- return allCompilations.filter { compilation -> sourceSet in compilation.allKotlinSourceSets || sourceSet == compilation.defaultSourceSet }
+private fun allCompilationsOf(
+ kotlin: KotlinMultiplatformExtension,
+ sourceSet: KotlinSourceSet
+): List<KotlinCompilation> {
+ val allCompilations = kotlin.targets.flatMap { target -> target.compilations }
+ return allCompilations.filter { compilation ->
+ sourceSet in compilation.allKotlinSourceSets || sourceSet == compilation.defaultSourceSet
+ }
}
-private fun KotlinSingleTargetExtension.allCompilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> {
- return target.compilations.filter { compilation -> sourceSet in compilation.allKotlinSourceSets }
+private fun allCompilationsOf(
+ kotlin: KotlinSingleTargetExtension<*>,
+ sourceSet: KotlinSourceSet
+): List<KotlinCompilation> {
+ return kotlin.target.compilations.filter { compilation -> sourceSet in compilation.allKotlinSourceSets }
}