[KLIB] Add error message when failed to resolve library
This commit is contained in:
@@ -98,13 +98,18 @@ abstract class KotlinLibrarySearchPathResolver<L: KotlinLibrary>(
|
|||||||
|
|
||||||
override fun resolve(unresolved: UnresolvedLibrary, isDefaultLink: Boolean): L {
|
override fun resolve(unresolved: UnresolvedLibrary, isDefaultLink: Boolean): L {
|
||||||
val givenPath = unresolved.path
|
val givenPath = unresolved.path
|
||||||
val fileSequence = resolutionSequence(givenPath)
|
try {
|
||||||
val matching = fileSequence.map { libraryBuilder(it, isDefaultLink) }
|
val fileSequence = resolutionSequence(givenPath)
|
||||||
.map { it.takeIf { libraryMatch(it, unresolved) } }
|
val matching = fileSequence.map { libraryBuilder(it, isDefaultLink) }
|
||||||
.filterNotNull()
|
.map { it.takeIf { libraryMatch(it, unresolved) } }
|
||||||
|
.filterNotNull()
|
||||||
|
|
||||||
return matching.firstOrNull() ?: run {
|
return matching.firstOrNull() ?: run {
|
||||||
logger.fatal("Could not find \"$givenPath\" in ${searchRoots.map { it.absolutePath }}.")
|
logger.fatal("Could not find \"$givenPath\" in ${searchRoots.map { it.absolutePath }}.")
|
||||||
|
}
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
logger.error("Failed to resolve Kotlin library: $givenPath")
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user