Initial klib tool check in.
This commit is contained in:
committed by
alexander-gorshenev
parent
9dfdd91cc8
commit
646117a60b
+1
-1
@@ -44,7 +44,7 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
}
|
||||
|
||||
private val repositories = configuration.getList(KonanConfigKeys.REPOSITORIES) ?: emptyList()
|
||||
private val resolver = KonanLibrarySearchPathResolver(repositories, distribution)
|
||||
private val resolver = KonanLibrarySearchPathResolver(repositories, distribution.klib, distribution.localKonanDir)
|
||||
private val librariesFound: List<File> by lazy {
|
||||
libraryNames.map{it -> resolver.resolve(it)}
|
||||
}
|
||||
|
||||
+2
-2
@@ -29,7 +29,8 @@ enum class KonanTarget(val suffix: String, var enabled: Boolean = false) {
|
||||
RASPBERRYPI("raspberrypi")
|
||||
}
|
||||
|
||||
class TargetManager(val config: CompilerConfiguration) {
|
||||
class TargetManager(val userRequest: String? = null) {
|
||||
constructor(config: CompilerConfiguration) : this(config.get(KonanConfigKeys.TARGET))
|
||||
val targets = KonanTarget.values().associate{ it.name.toLowerCase() to it }
|
||||
val current = determineCurrent()
|
||||
val currentName
|
||||
@@ -79,7 +80,6 @@ class TargetManager(val config: CompilerConfiguration) {
|
||||
}
|
||||
|
||||
fun determineCurrent(): KonanTarget {
|
||||
val userRequest = config.get(KonanConfigKeys.TARGET)
|
||||
return if (userRequest == null || userRequest == "host") {
|
||||
host
|
||||
} else {
|
||||
|
||||
-2
@@ -185,8 +185,6 @@ class SplitLibraryWriter(override val libDir: File, override val target: String?
|
||||
|
||||
override fun commit() {
|
||||
if (!nopack) {
|
||||
// This is no-op for the Split library.
|
||||
// Or should we zip the directory?
|
||||
libDir.zipDirAs(klibFile)
|
||||
libDir.deleteRecursively()
|
||||
}
|
||||
|
||||
+3
-6
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.konan.library
|
||||
|
||||
import org.jetbrains.kotlin.backend.konan.Distribution
|
||||
import org.jetbrains.kotlin.backend.konan.KonanProperties
|
||||
import org.jetbrains.kotlin.backend.konan.util.File
|
||||
import org.jetbrains.kotlin.backend.konan.util.suffixIfNot
|
||||
import org.jetbrains.kotlin.backend.konan.util.removeSuffixIfPresent
|
||||
@@ -28,14 +26,13 @@ interface SearchPathResolver {
|
||||
}
|
||||
|
||||
class KonanLibrarySearchPathResolver(repositories: List<String>,
|
||||
val distribution: Distribution): SearchPathResolver {
|
||||
val distributionKlib: String, val localKonanDir: String): SearchPathResolver {
|
||||
|
||||
private val properties = distribution.properties
|
||||
val localHead: File
|
||||
get() = File(distribution.localKonanDir).klib
|
||||
get() = File(localKonanDir).klib
|
||||
|
||||
val distHead: File
|
||||
get() = File(distribution.klib)
|
||||
get() = File(distributionKlib)
|
||||
|
||||
val currentDirHead: File
|
||||
get() = File.userDir
|
||||
|
||||
+2
-2
@@ -110,7 +110,7 @@ fun Path.recursiveCopyTo(destPath: Path) {
|
||||
}
|
||||
}
|
||||
|
||||
fun File.copyTo(destination: File) {
|
||||
Files.copy(this.toPath(), destination.toPath())
|
||||
fun File.copyTo(destination: File, vararg options: StandardCopyOption) {
|
||||
Files.copy(this.toPath(), destination.toPath(), *options)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user