From 1053428ee4d06b03ccfdc96dac0eacd5205d455f Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Wed, 29 Jan 2020 21:53:39 +0700 Subject: [PATCH] Minor: Formatted --- .../kotlin/library/SearchPathResolver.kt | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/compiler/util-klib/src/org/jetbrains/kotlin/library/SearchPathResolver.kt b/compiler/util-klib/src/org/jetbrains/kotlin/library/SearchPathResolver.kt index 87628f755d0..204193e090a 100644 --- a/compiler/util-klib/src/org/jetbrains/kotlin/library/SearchPathResolver.kt +++ b/compiler/util-klib/src/org/jetbrains/kotlin/library/SearchPathResolver.kt @@ -8,7 +8,7 @@ import org.jetbrains.kotlin.util.* const val KOTLIN_STDLIB_NAME = "stdlib" -interface SearchPathResolver : WithLogger { +interface SearchPathResolver : WithLogger { val searchRoots: List fun resolutionSequence(givenPath: String): Sequence fun resolve(unresolved: UnresolvedLibrary, isDefaultLink: Boolean = false): L @@ -18,19 +18,19 @@ interface SearchPathResolver : WithLogger { fun isProvidedByDefault(unresolved: UnresolvedLibrary): Boolean = false } -interface SearchPathResolverWithAttributes: SearchPathResolver { +interface SearchPathResolverWithAttributes : SearchPathResolver { val knownAbiVersions: List? val knownCompilerVersions: List? } // This is a simple library resolver that only cares for file names. -abstract class KotlinLibrarySearchPathResolver ( - repositories: List, - directLibs: List, - val distributionKlib: String?, - val localKotlinDir: String?, - val skipCurrentDir: Boolean, - override val logger: Logger +abstract class KotlinLibrarySearchPathResolver( + repositories: List, + directLibs: List, + val distributionKlib: String?, + val localKotlinDir: String?, + val skipCurrentDir: Boolean, + override val logger: Logger ) : SearchPathResolver { val localHead: File? @@ -96,14 +96,14 @@ abstract class KotlinLibrarySearchPathResolver ( return sequence.filterNotNull() } - private fun Sequence.filterOutPre_1_4_libraries(): Sequence = this.filter{ - if (it.isPre_1_4_Library) { - logger.warning("Skipping \"$it\" as it is a pre 1.4 library") - false - } else { - true - } + private fun Sequence.filterOutPre_1_4_libraries(): Sequence = this.filter { + if (it.isPre_1_4_Library) { + logger.warning("Skipping \"$it\" as it is a pre 1.4 library") + false + } else { + true } + } override fun resolve(unresolved: UnresolvedLibrary, isDefaultLink: Boolean): L { val givenPath = unresolved.path @@ -171,15 +171,15 @@ abstract class KotlinLibrarySearchPathResolver ( } fun CompilerVersion.compatible(other: CompilerVersion) = - this.major == other.major - && this.minor == other.minor - && this.maintenance == other.maintenance + this.major == other.major + && this.minor == other.minor + && this.maintenance == other.maintenance // This is a library resolver aware of attributes shared between platforms, // such as abi version. // JS and Native resolvers are inherited from this one. -abstract class KotlinLibraryProperResolverWithAttributes( +abstract class KotlinLibraryProperResolverWithAttributes( repositories: List, directLibs: List, override val knownAbiVersions: List?, @@ -190,8 +190,7 @@ abstract class KotlinLibraryProperResolverWithAttributes( override val logger: Logger, private val knownIrProviders: List ) : KotlinLibrarySearchPathResolver(repositories, directLibs, distributionKlib, localKotlinDir, skipCurrentDir, logger), - SearchPathResolverWithAttributes -{ + SearchPathResolverWithAttributes { override fun libraryMatch(candidate: L, unresolved: UnresolvedLibrary): Boolean { val candidatePath = candidate.libraryFile.absolutePath @@ -239,13 +238,14 @@ class SingleKlibComponentResolver( override fun libraryComponentBuilder(file: File, isDefault: Boolean) = createKotlinLibraryComponents(file, isDefault) } -fun resolveSingleFileKlib(libraryFile: File, - logger: Logger = object : Logger { - override fun log(message: String) {} - override fun error(message: String) = kotlin.error("e: $message") - override fun warning(message: String) {} - override fun fatal(message: String) = kotlin.error("e: $message") - } +fun resolveSingleFileKlib( + libraryFile: File, + logger: Logger = object : Logger { + override fun log(message: String) {} + override fun error(message: String) = kotlin.error("e: $message") + override fun warning(message: String) {} + override fun fatal(message: String) = kotlin.error("e: $message") + } ): KotlinLibrary { return SingleKlibComponentResolver(libraryFile.absolutePath, listOf(KotlinAbiVersion.CURRENT), logger).resolve(libraryFile.absolutePath) -} \ No newline at end of file +}