1
0
Fork 0

non-YML language definitions are now ignored during build time

This commit is contained in:
sspanak 2025-04-14 13:35:12 +03:00 committed by Dimo Karaivanov
parent 05385eeecc
commit 3be8e9626d
2 changed files with 8 additions and 0 deletions

View file

@ -8,6 +8,10 @@ ext.convertDictionaries = { definitionsInputDir, dictionariesInputDir, dictionar
int errorCount = 0 int errorCount = 0
def errorStream = fileTree(dir: definitionsInputDir).getFiles().parallelStream().map { definition -> def errorStream = fileTree(dir: definitionsInputDir).getFiles().parallelStream().map { definition ->
if (!definition.name.endsWith("yml")) {
return ""
}
def (_, sounds, prependSoundsToWords, noSyllables, locale, dictionaryFile, langFileErrorCount, langFileErrorMsg) = parseLanguageDefintion(definition, dictionariesInputDir) def (_, sounds, prependSoundsToWords, noSyllables, locale, dictionaryFile, langFileErrorCount, langFileErrorMsg) = parseLanguageDefintion(definition, dictionariesInputDir)
errorCount += langFileErrorCount errorCount += langFileErrorCount
if (!langFileErrorMsg.isEmpty()) { if (!langFileErrorMsg.isEmpty()) {

View file

@ -5,6 +5,10 @@ ext.validateLanguageFiles = { definitionsDir, dictionariesDir, validationDir ->
int errorCount = 0 int errorCount = 0
def errorStream = fileTree(dir: definitionsDir).getFiles().parallelStream().map { definition -> def errorStream = fileTree(dir: definitionsDir).getFiles().parallelStream().map { definition ->
if (!definition.name.endsWith("yml")) {
return ""
}
if (errorCount >= MAX_ERRORS) { if (errorCount >= MAX_ERRORS) {
return "Too many errors! Skipping: ${definition}\n" return "Too many errors! Skipping: ${definition}\n"
} }