mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -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")
|
||||
failedProjects.add(project.name)
|
||||
kobaltError("Not building project ${project.name} since it depends on failed "
|
||||
+ Strings.pluralize("project", fp.size)
|
||||
+ Strings.pluralize(fp.size, "project")
|
||||
+ " " + fp.joinToString(","))
|
||||
} else {
|
||||
val projectName = project.name
|
||||
|
|
|
@ -4,8 +4,8 @@ import com.google.common.base.CharMatcher
|
|||
|
||||
class Strings {
|
||||
companion object {
|
||||
fun pluralize(s: String, n: Int) = s + (if (n != 1) "s" else "")
|
||||
fun pluralizeAll(s: String, n: Int) = "$n " + pluralize(s, n)
|
||||
fun pluralize(n:Int, s: String, plural: String = s) = plural + (if (n != 1) "s" else "")
|
||||
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(" ")
|
||||
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()
|
||||
errorMessage = dc.diagnostics.joinToString("\n")
|
||||
result
|
||||
|
@ -78,7 +78,7 @@ class JavaCompiler @Inject constructor(val jvmCompiler: JvmCompiler) {
|
|||
val pb = ProcessBuilder(allArgs)
|
||||
pb.inheritIO()
|
||||
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")
|
||||
|
||||
command = allArgs.joinToString(" ") + " " + info.sourceFiles.joinToString(" ")
|
||||
|
|
|
@ -39,7 +39,8 @@ class KotlinCompiler @Inject constructor(
|
|||
val compilerAction = object: ICompilerAction {
|
||||
override fun compile(projectName: String?, info: CompilerActionInfo): TaskResult {
|
||||
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 infoDir = info.directory
|
||||
val outputDir = if (infoDir != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue