Minor: Formatted
This commit is contained in:
@@ -8,7 +8,7 @@ import org.jetbrains.kotlin.util.*
|
|||||||
|
|
||||||
const val KOTLIN_STDLIB_NAME = "stdlib"
|
const val KOTLIN_STDLIB_NAME = "stdlib"
|
||||||
|
|
||||||
interface SearchPathResolver<L: KotlinLibrary> : WithLogger {
|
interface SearchPathResolver<L : KotlinLibrary> : WithLogger {
|
||||||
val searchRoots: List<File>
|
val searchRoots: List<File>
|
||||||
fun resolutionSequence(givenPath: String): Sequence<File>
|
fun resolutionSequence(givenPath: String): Sequence<File>
|
||||||
fun resolve(unresolved: UnresolvedLibrary, isDefaultLink: Boolean = false): L
|
fun resolve(unresolved: UnresolvedLibrary, isDefaultLink: Boolean = false): L
|
||||||
@@ -18,13 +18,13 @@ interface SearchPathResolver<L: KotlinLibrary> : WithLogger {
|
|||||||
fun isProvidedByDefault(unresolved: UnresolvedLibrary): Boolean = false
|
fun isProvidedByDefault(unresolved: UnresolvedLibrary): Boolean = false
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SearchPathResolverWithAttributes<L: KotlinLibrary>: SearchPathResolver<L> {
|
interface SearchPathResolverWithAttributes<L : KotlinLibrary> : SearchPathResolver<L> {
|
||||||
val knownAbiVersions: List<KotlinAbiVersion>?
|
val knownAbiVersions: List<KotlinAbiVersion>?
|
||||||
val knownCompilerVersions: List<CompilerVersion>?
|
val knownCompilerVersions: List<CompilerVersion>?
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a simple library resolver that only cares for file names.
|
// This is a simple library resolver that only cares for file names.
|
||||||
abstract class KotlinLibrarySearchPathResolver<L: KotlinLibrary> (
|
abstract class KotlinLibrarySearchPathResolver<L : KotlinLibrary>(
|
||||||
repositories: List<String>,
|
repositories: List<String>,
|
||||||
directLibs: List<String>,
|
directLibs: List<String>,
|
||||||
val distributionKlib: String?,
|
val distributionKlib: String?,
|
||||||
@@ -96,7 +96,7 @@ abstract class KotlinLibrarySearchPathResolver<L: KotlinLibrary> (
|
|||||||
return sequence.filterNotNull()
|
return sequence.filterNotNull()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Sequence<File>.filterOutPre_1_4_libraries(): Sequence<File> = this.filter{
|
private fun Sequence<File>.filterOutPre_1_4_libraries(): Sequence<File> = this.filter {
|
||||||
if (it.isPre_1_4_Library) {
|
if (it.isPre_1_4_Library) {
|
||||||
logger.warning("Skipping \"$it\" as it is a pre 1.4 library")
|
logger.warning("Skipping \"$it\" as it is a pre 1.4 library")
|
||||||
false
|
false
|
||||||
@@ -179,7 +179,7 @@ fun CompilerVersion.compatible(other: CompilerVersion) =
|
|||||||
// This is a library resolver aware of attributes shared between platforms,
|
// This is a library resolver aware of attributes shared between platforms,
|
||||||
// such as abi version.
|
// such as abi version.
|
||||||
// JS and Native resolvers are inherited from this one.
|
// JS and Native resolvers are inherited from this one.
|
||||||
abstract class KotlinLibraryProperResolverWithAttributes<L: KotlinLibrary>(
|
abstract class KotlinLibraryProperResolverWithAttributes<L : KotlinLibrary>(
|
||||||
repositories: List<String>,
|
repositories: List<String>,
|
||||||
directLibs: List<String>,
|
directLibs: List<String>,
|
||||||
override val knownAbiVersions: List<KotlinAbiVersion>?,
|
override val knownAbiVersions: List<KotlinAbiVersion>?,
|
||||||
@@ -190,8 +190,7 @@ abstract class KotlinLibraryProperResolverWithAttributes<L: KotlinLibrary>(
|
|||||||
override val logger: Logger,
|
override val logger: Logger,
|
||||||
private val knownIrProviders: List<String>
|
private val knownIrProviders: List<String>
|
||||||
) : KotlinLibrarySearchPathResolver<L>(repositories, directLibs, distributionKlib, localKotlinDir, skipCurrentDir, logger),
|
) : KotlinLibrarySearchPathResolver<L>(repositories, directLibs, distributionKlib, localKotlinDir, skipCurrentDir, logger),
|
||||||
SearchPathResolverWithAttributes<L>
|
SearchPathResolverWithAttributes<L> {
|
||||||
{
|
|
||||||
override fun libraryMatch(candidate: L, unresolved: UnresolvedLibrary): Boolean {
|
override fun libraryMatch(candidate: L, unresolved: UnresolvedLibrary): Boolean {
|
||||||
val candidatePath = candidate.libraryFile.absolutePath
|
val candidatePath = candidate.libraryFile.absolutePath
|
||||||
|
|
||||||
@@ -239,7 +238,8 @@ class SingleKlibComponentResolver(
|
|||||||
override fun libraryComponentBuilder(file: File, isDefault: Boolean) = createKotlinLibraryComponents(file, isDefault)
|
override fun libraryComponentBuilder(file: File, isDefault: Boolean) = createKotlinLibraryComponents(file, isDefault)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun resolveSingleFileKlib(libraryFile: File,
|
fun resolveSingleFileKlib(
|
||||||
|
libraryFile: File,
|
||||||
logger: Logger = object : Logger {
|
logger: Logger = object : Logger {
|
||||||
override fun log(message: String) {}
|
override fun log(message: String) {}
|
||||||
override fun error(message: String) = kotlin.error("e: $message")
|
override fun error(message: String) = kotlin.error("e: $message")
|
||||||
|
|||||||
Reference in New Issue
Block a user