Get rid of explicit value case manipulations.
This commit is contained in:
committed by
alexander-gorshenev
parent
d237afdea5
commit
ff49153e79
+1
-1
@@ -69,7 +69,7 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
internal val produce get() = configuration.get(KonanConfigKeys.PRODUCE)!!
|
||||
private val prefix = produce.prefix(target)
|
||||
private val suffix = produce.suffix(target)
|
||||
val outputName = configuration.get(KonanConfigKeys.OUTPUT)?.removeSuffixIfPresent(suffix) ?: produce.name.toLowerCase()
|
||||
val outputName = configuration.get(KonanConfigKeys.OUTPUT)?.removeSuffixIfPresent(suffix) ?: produce.userName
|
||||
val outputFile = outputName
|
||||
.prefixBaseNameIfNot(prefix)
|
||||
.suffixIfNot(suffix)
|
||||
|
||||
+4
-3
@@ -17,12 +17,13 @@
|
||||
package org.jetbrains.kotlin.backend.konan
|
||||
|
||||
import org.jetbrains.kotlin.backend.konan.util.*
|
||||
import org.jetbrains.kotlin.konan.util.UserNamed
|
||||
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
|
||||
|
||||
enum class KonanPhase(val description: String,
|
||||
vararg prerequisite: KonanPhase,
|
||||
var enabled: Boolean = true, var verbose: Boolean = false) {
|
||||
|
||||
var enabled: Boolean = true,
|
||||
var verbose: Boolean = false) : UserNamed {
|
||||
/* */ FRONTEND("Frontend builds AST"),
|
||||
/* */ PSI_TO_IR("Psi to IR conversion"),
|
||||
/* */ SERIALIZER("Serialize descriptor tree and inline IR bodies"),
|
||||
@@ -73,7 +74,7 @@ enum class KonanPhase(val description: String,
|
||||
}
|
||||
|
||||
object KonanPhases {
|
||||
val phases = KonanPhase.values().associate { it.name.toLowerCase() to it }
|
||||
val phases = KonanPhase.values().associate { it.userName to it }
|
||||
|
||||
fun known(name: String): String {
|
||||
if (phases[name] == null) {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ interface KonanLibraryLayout {
|
||||
val targetsDir
|
||||
get() = File(libDir, "targets")
|
||||
val targetDir
|
||||
get() = File(targetsDir, target!!.name.toLowerCase())
|
||||
get() = File(targetsDir, target!!.userName)
|
||||
val kotlinDir
|
||||
get() = File(targetDir, "kotlin")
|
||||
val nativeDir
|
||||
|
||||
Reference in New Issue
Block a user