mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -07:00
Fix plurals.
This commit is contained in:
parent
9ff5b52a7d
commit
3dc039e956
4 changed files with 7 additions and 6 deletions
|
@ -69,7 +69,7 @@ public class TaskManager @Inject constructor(val args: Args, val incrementalMana
|
||||||
log(2, "Marking project ${project.name} as skipped")
|
log(2, "Marking project ${project.name} as skipped")
|
||||||
failedProjects.add(project.name)
|
failedProjects.add(project.name)
|
||||||
kobaltError("Not building project ${project.name} since it depends on failed "
|
kobaltError("Not building project ${project.name} since it depends on failed "
|
||||||
+ Strings.pluralize("project", fp.size)
|
+ Strings.pluralize(fp.size, "project")
|
||||||
+ " " + fp.joinToString(","))
|
+ " " + fp.joinToString(","))
|
||||||
} else {
|
} else {
|
||||||
val projectName = project.name
|
val projectName = project.name
|
||||||
|
|
|
@ -4,8 +4,8 @@ import com.google.common.base.CharMatcher
|
||||||
|
|
||||||
class Strings {
|
class Strings {
|
||||||
companion object {
|
companion object {
|
||||||
fun pluralize(s: String, n: Int) = s + (if (n != 1) "s" else "")
|
fun pluralize(n:Int, s: String, plural: String = s) = plural + (if (n != 1) "s" else "")
|
||||||
fun pluralizeAll(s: String, n: Int) = "$n " + pluralize(s, n)
|
fun pluralizeAll(n:Int, s: String, plural: String = s) = "$n " + pluralize(n, s, plural)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ class JavaCompiler @Inject constructor(val jvmCompiler: JvmCompiler) {
|
||||||
command = "javac " + allArgs.joinToString(" ") + " " + info.sourceFiles.joinToString(" ")
|
command = "javac " + allArgs.joinToString(" ") + " " + info.sourceFiles.joinToString(" ")
|
||||||
log(2, "Launching\n$command")
|
log(2, "Launching\n$command")
|
||||||
|
|
||||||
log(1, " Java compiling " + Strings.pluralizeAll("file", info.sourceFiles.size))
|
log(1, " Java compiling " + Strings.pluralizeAll(info.sourceFiles.size, "file"))
|
||||||
val result = task.call()
|
val result = task.call()
|
||||||
errorMessage = dc.diagnostics.joinToString("\n")
|
errorMessage = dc.diagnostics.joinToString("\n")
|
||||||
result
|
result
|
||||||
|
@ -78,7 +78,7 @@ class JavaCompiler @Inject constructor(val jvmCompiler: JvmCompiler) {
|
||||||
val pb = ProcessBuilder(allArgs)
|
val pb = ProcessBuilder(allArgs)
|
||||||
pb.inheritIO()
|
pb.inheritIO()
|
||||||
val line = allArgs.joinToString(" ")
|
val line = allArgs.joinToString(" ")
|
||||||
log(1, " Java compiling " + Strings.pluralizeAll("file", info.sourceFiles.size))
|
log(1, " Java compiling " + Strings.pluralizeAll(info.sourceFiles.size, "file"))
|
||||||
log(2, " Java compiling $line")
|
log(2, " Java compiling $line")
|
||||||
|
|
||||||
command = allArgs.joinToString(" ") + " " + info.sourceFiles.joinToString(" ")
|
command = allArgs.joinToString(" ") + " " + info.sourceFiles.joinToString(" ")
|
||||||
|
|
|
@ -39,7 +39,8 @@ class KotlinCompiler @Inject constructor(
|
||||||
val compilerAction = object: ICompilerAction {
|
val compilerAction = object: ICompilerAction {
|
||||||
override fun compile(projectName: String?, info: CompilerActionInfo): TaskResult {
|
override fun compile(projectName: String?, info: CompilerActionInfo): TaskResult {
|
||||||
val version = settings.kobaltCompilerVersion
|
val version = settings.kobaltCompilerVersion
|
||||||
log(1, " Kotlin $version compiling " + Strings.pluralizeAll("file", info.sourceFiles.size))
|
log(1, " Kotlin $version compiling "
|
||||||
|
+ Strings.pluralizeAll(info.sourceFiles.size, "directory", "directories" ))
|
||||||
val cp = compilerFirst(info.dependencies.map {it.jarFile.get()})
|
val cp = compilerFirst(info.dependencies.map {it.jarFile.get()})
|
||||||
val infoDir = info.directory
|
val infoDir = info.directory
|
||||||
val outputDir = if (infoDir != null) {
|
val outputDir = if (infoDir != null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue