[Gradle, JS] Fix check on klib
This commit is contained in:
@@ -67,8 +67,7 @@ object LibraryUtils {
|
|||||||
return checkAttributeValue(library, TITLE_KOTLIN_JAVASCRIPT_STDLIB, Attributes.Name.IMPLEMENTATION_TITLE)
|
return checkAttributeValue(library, TITLE_KOTLIN_JAVASCRIPT_STDLIB, Attributes.Name.IMPLEMENTATION_TITLE)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun isZippedKlib(candidate: File): Boolean {
|
private fun isZippedKlibInZip(candidate: File): Boolean {
|
||||||
if (candidate.extension == "klib") return true
|
|
||||||
var manifestFound = false
|
var manifestFound = false
|
||||||
var irFound = false
|
var irFound = false
|
||||||
for (entry in ZipFile(candidate).entries()) {
|
for (entry in ZipFile(candidate).entries()) {
|
||||||
@@ -78,10 +77,15 @@ object LibraryUtils {
|
|||||||
return manifestFound && irFound
|
return manifestFound && irFound
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun isZippedKlib(candidate: File): Boolean {
|
||||||
|
return candidate.extension == "klib"
|
||||||
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun isKotlinJavascriptIrLibrary(candidate: File): Boolean {
|
fun isKotlinJavascriptIrLibrary(candidate: File): Boolean {
|
||||||
return when {
|
return when {
|
||||||
FileUtil.isJarOrZip(candidate) -> isZippedKlib(candidate)
|
isZippedKlib(candidate) -> true
|
||||||
|
FileUtil.isJarOrZip(candidate) -> isZippedKlibInZip(candidate)
|
||||||
!File(candidate, "manifest").isFile -> false
|
!File(candidate, "manifest").isFile -> false
|
||||||
!File(candidate, "ir").isDirectory -> false
|
!File(candidate, "ir").isDirectory -> false
|
||||||
else -> true
|
else -> true
|
||||||
|
|||||||
Reference in New Issue
Block a user