1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-27 00:38:11 -07:00

Syntax updates for 0.4584.

This commit is contained in:
Cedric Beust 2015-12-28 01:50:51 +04:00
parent 8d54f2a843
commit ec398e0c8a
4 changed files with 5 additions and 4 deletions

View file

@ -37,7 +37,7 @@ abstract class BuildGenerator : IInitContributor<File> {
}
val properties = pom.properties
val mapped = properties.entries.toMap({it.key}, { ProjectGenerator.toIdentifier(it.key) })
val mapped = properties.entries.toMapBy({ it.key }, { ProjectGenerator.toIdentifier(it.key) })
map.put("properties", properties.entries.map({ Pair(mapped[it.key], it.value) }))

View file

@ -15,6 +15,7 @@ import java.net.URL
import java.nio.charset.Charset
import java.nio.file.Paths
import java.util.*
import kotlin.text.Regex
class ParsedBuildFile(val buildFile: BuildFile, val context: KobaltContext, val buildScriptUtil: BuildScriptUtil,
val dependencyManager: DependencyManager, val files: KFiles) {

View file

@ -77,7 +77,7 @@ public class KobaltServer @Inject constructor(val args: Args) : Runnable, IComma
private fun runCommand(jo: JsonObject) {
val command = jo.get("name").asString
if (command != null) {
COMMANDS.getOrElse(command, { COMMANDS.get("ping") })!!.run(this, jo)
(COMMANDS[command] ?: COMMANDS["ping"])!!.run(this, jo)
} else {
error("Did not find a name in command: $jo")
}

View file

@ -69,7 +69,7 @@ public class PublishPlugin @Inject constructor(val files: KFiles, val factory: P
}
private fun uploadGithub(project: Project) : TaskResult {
val configuration = githubConfigurations.getRaw(project.name)
val configuration = githubConfigurations[project.name]
//
// Upload individual files, if applicable
@ -93,7 +93,7 @@ public class PublishPlugin @Inject constructor(val files: KFiles, val factory: P
val jcenter = jcenterFactory.create(user, password)
var success = false
val configuration = jcenterConfigurations.getRaw(project.name)
val configuration = jcenterConfigurations[project.name]
val messages = arrayListOf<String>()
if (configuration != null) {