[Gradle, JS] Fix bridge between Gradle and Js IR CLI
This commit is contained in:
@@ -4,7 +4,10 @@ import org.jetbrains.kotlin.konan.CompilerVersion
|
||||
import org.jetbrains.kotlin.konan.file.File
|
||||
import org.jetbrains.kotlin.library.impl.createKotlinLibraryComponents
|
||||
import org.jetbrains.kotlin.library.impl.isPre_1_4_Library
|
||||
import org.jetbrains.kotlin.util.*
|
||||
import org.jetbrains.kotlin.util.Logger
|
||||
import org.jetbrains.kotlin.util.WithLogger
|
||||
import org.jetbrains.kotlin.util.removeSuffixIfPresent
|
||||
import org.jetbrains.kotlin.util.suffixIfNot
|
||||
import java.nio.file.InvalidPathException
|
||||
import java.nio.file.Paths
|
||||
|
||||
@@ -145,7 +148,7 @@ abstract class KotlinLibrarySearchPathResolver<L : KotlinLibrary>(
|
||||
.filterNotNull()
|
||||
|
||||
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")
|
||||
@@ -154,7 +157,7 @@ abstract class KotlinLibrarySearchPathResolver<L : KotlinLibrary>(
|
||||
}
|
||||
}
|
||||
|
||||
override fun libraryMatch(candidate: L, unresolved: UnresolvedLibrary) = true
|
||||
override fun libraryMatch(candidate: L, unresolved: UnresolvedLibrary): Boolean = true
|
||||
|
||||
override fun resolve(givenPath: String) = resolve(UnresolvedLibrary(givenPath, null), false)
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package org.jetbrains.kotlin.library.impl
|
||||
|
||||
import org.jetbrains.kotlin.konan.file.File
|
||||
import org.jetbrains.kotlin.library.*
|
||||
import org.jetbrains.kotlin.konan.properties.Properties
|
||||
import org.jetbrains.kotlin.konan.properties.loadProperties
|
||||
import org.jetbrains.kotlin.library.*
|
||||
|
||||
open class BaseKotlinLibraryImpl(
|
||||
val access: BaseLibraryAccess<KotlinLibraryLayout>,
|
||||
|
||||
@@ -20,12 +20,14 @@ open class KotlinLibraryLayoutForWriter(
|
||||
) : KotlinLibraryLayout, MetadataKotlinLibraryLayout, IrKotlinLibraryLayout {
|
||||
override val componentDir: File
|
||||
get() = File(unzippedDir, component)
|
||||
override val pre_1_4_manifest: File
|
||||
get() = File(unzippedDir, KLIB_MANIFEST_FILE_NAME)
|
||||
}
|
||||
|
||||
open class BaseWriterImpl(
|
||||
val libraryLayout: KotlinLibraryLayoutForWriter,
|
||||
moduleName: String,
|
||||
override val versions: KotlinLibraryVersioning,
|
||||
_versions: KotlinLibraryVersioning,
|
||||
builtInsPlatform: BuiltInsPlatform,
|
||||
nativeTargets: List<String> = emptyList(),
|
||||
val nopack: Boolean = false,
|
||||
@@ -34,14 +36,16 @@ open class BaseWriterImpl(
|
||||
|
||||
val klibFile = libraryLayout.libFile
|
||||
val manifestProperties = Properties()
|
||||
override val versions: KotlinLibraryVersioning = _versions
|
||||
|
||||
init {
|
||||
// TODO: figure out the proper policy here.
|
||||
klibFile.delete()
|
||||
klibFile.deleteRecursively()
|
||||
klibFile.parentFile.run { if (!exists) mkdirs() }
|
||||
libraryLayout.resourcesDir.mkdirs()
|
||||
// TODO: <name>:<hash> will go somewhere around here.
|
||||
manifestProperties.setProperty(KLIB_PROPERTY_UNIQUE_NAME, moduleName)
|
||||
manifestProperties.writeKonanLibraryVersioning(versions)
|
||||
manifestProperties.writeKonanLibraryVersioning(_versions)
|
||||
|
||||
if (builtInsPlatform != BuiltInsPlatform.COMMON) {
|
||||
manifestProperties.setProperty(KLIB_PROPERTY_BUILTINS_PLATFORM, builtInsPlatform.name)
|
||||
|
||||
Reference in New Issue
Block a user