From d391f78c44924a9cd5aee02431825da2ecfb51d3 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Fri, 31 Jul 2020 17:30:38 +0200 Subject: Minor simplification in AnalysisEnvironment --- .../kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'kotlin-analysis/src') diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt index 1523f170..685bfe82 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt @@ -214,9 +214,9 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl override val name: Name = Name.special("") override val platform: TargetPlatform = targetPlatform override fun dependencies(): List = listOf(this) - override fun getLibraryRoots(): Collection = classpath.mapNotNull { libraryFile -> - libraryFile.absolutePath.takeIf { it !in nativeLibraries } - } + override fun getLibraryRoots(): Collection = classpath + .map { libraryFile -> libraryFile.absolutePath } + .filter { path -> path !in nativeLibraries } } val module = object : ModuleInfo { @@ -289,7 +289,8 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl ) val projectComponentManager = environment.project as MockComponentManager projectComponentManager.registerService( - KotlinCacheService::class.java, + KotlinCacheService:: + class.java, CoreKotlinCacheService(created) ) -- cgit