Be more tolerant to non-existing paths in library reader. (#1511)
This commit is contained in:
+3
-2
@@ -60,10 +60,11 @@ class LibraryReaderImpl(var libraryFile: File, val currentAbiVersion: Int,
|
||||
get() = manifestProperties.propertyString("unique_name")!!
|
||||
|
||||
override val bitcodePaths: List<String>
|
||||
get() = (realFiles.kotlinDir.listFiles + realFiles.nativeDir.listFiles).map{it.absolutePath}
|
||||
get() = (realFiles.kotlinDir.listFilesOrEmpty + realFiles.nativeDir.listFilesOrEmpty)
|
||||
.map { it.absolutePath }
|
||||
|
||||
override val includedPaths: List<String>
|
||||
get() = (realFiles.includedDir.listFiles).map{it.absolutePath}
|
||||
get() = (realFiles.includedDir.listFilesOrEmpty).map { it.absolutePath }
|
||||
|
||||
override val linkerOpts: List<String>
|
||||
get() = manifestProperties.propertyList("linkerOpts", target!!.visibleName)
|
||||
|
||||
@@ -52,6 +52,8 @@ data class File constructor(internal val javaPath: Path) {
|
||||
get() = javaPath.isAbsolute()
|
||||
val listFiles: List<File>
|
||||
get() = Files.newDirectoryStream(javaPath).use { stream -> stream.map { File(it) } }
|
||||
val listFilesOrEmpty: List<File>
|
||||
get() = if (exists) listFiles else emptyList()
|
||||
|
||||
fun child(name: String) = File(this, name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user