diff --git a/src/main/kotlin/task/LangCompile.kt b/src/main/kotlin/task/LangCompile.kt index 1638ad2c..85192008 100644 --- a/src/main/kotlin/task/LangCompile.kt +++ b/src/main/kotlin/task/LangCompile.kt @@ -60,7 +60,9 @@ open class LangCompile } logger.lifecycle(" into ${destinationDir.absolutePath}/$subdirectory") langPaths.filter { it.value.size >= 2 }.forEach { lang, paths -> - logger.warn("\nWARNING: For language $lang there are multiple *.lang files, of which only the last one in the following list is used:\n * ${paths.joinToString("\n * ")}\n") + val warnMsg = "\nWARNING: For language $lang there are multiple *.lang files, of which only the last one in the following list is used:\n * ${paths.joinToString("\n * ")}\n" + logger.warn(warnMsg) + project.gradle.buildFinished { logger.warn(warnMsg) } } } } diff --git a/src/main/kotlin/task/MoCompile.kt b/src/main/kotlin/task/MoCompile.kt index 48de80a4..ac255c98 100644 --- a/src/main/kotlin/task/MoCompile.kt +++ b/src/main/kotlin/task/MoCompile.kt @@ -58,18 +58,24 @@ open class MoCompile project.fileTree(outDir) .filter { it.isFile && it.name.endsWith(".lang") } .forEach { it.delete() } + + inputFiles.groupBy { it.parentFile.absolutePath }.forEach { dir, files -> + logger.lifecycle(" from $dir : ${files.map { it.nameWithoutExtension }.sorted().joinToString(", ")}") + } + val langMap = mutableMapOf>() inputFiles.forEach { - logger.lifecycle(" ${it.absolutePath} …" + if (langMap.containsKey(it.nameWithoutExtension)) { - " (will overwrite existing file!)" - } else { - "" - }) langMap[it.nameWithoutExtension] = MoReader(it.toURI().toURL()).readFile() } logger.lifecycle("Writing the *.lang files into ${outDir.absolutePath} …") LangWriter().writeLangFile(outDir, langMap, project.extensions.josm.i18n.mainLanguage) + + inputFiles.groupBy { it.nameWithoutExtension }.filter { it.value.size >= 2 }.forEach { lang, paths -> + val warnMsg = "\nWARNING: For language $lang there are multiple *.mo files, of which only the last one in the following list is used:\n * ${paths.joinToString("\n * ")}\n" + logger.warn(warnMsg) + project.gradle.buildFinished { logger.warn(warnMsg) } + } } } } diff --git a/src/main/kotlin/task/PoCompile.kt b/src/main/kotlin/task/PoCompile.kt index c380a186..ee767de9 100644 --- a/src/main/kotlin/task/PoCompile.kt +++ b/src/main/kotlin/task/PoCompile.kt @@ -80,7 +80,7 @@ open class PoCompile } } convertedFiles.groupBy { it.parentFile.absolutePath }.forEach { dir, files -> - logger.lifecycle(" from $dir :\n ${files.map { it.nameWithoutExtension }.sorted().joinToString(", ")}") + logger.lifecycle(" from $dir : ${files.map { it.nameWithoutExtension }.sorted().joinToString(", ")}") } logger.lifecycle(" into $outDir")