From 0e8dfbe578f28f3b0cf14c564928fb692553b91f Mon Sep 17 00:00:00 2001 From: sspanak Date: Mon, 19 Feb 2024 16:27:39 +0200 Subject: [PATCH] dictionary properties are now calculated in parallel for faster build time --- app/dictionary-tools.gradle | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/dictionary-tools.gradle b/app/dictionary-tools.gradle index e1305bdd..bfa04cae 100644 --- a/app/dictionary-tools.gradle +++ b/app/dictionary-tools.gradle @@ -1,6 +1,13 @@ ext.getDictionarySizes = { dictionariesDir, sizesDir -> - fileTree(dir: dictionariesDir).forEach {dictionary -> + fileTree(dir: dictionariesDir).getFiles().parallelStream().forEach {dictionary -> def dictionarySize = dictionary.exists() ? dictionary.text.split("\n").length : 0 new File(sizesDir, "${dictionary.getName()}.size").text = dictionarySize } -} \ No newline at end of file +} + +ext.getDictionaryTimestamps = { dictionariesDir, timestampsDir -> + fileTree(dir: dictionariesDir).getFiles().parallelStream().forEach {dictionary -> + def dictionaryTimestamp = dictionary.exists() ? dictionary.lastModified() : 0 + new File(timestampsDir, "${dictionary.getName()}.timestamp").text = dictionaryTimestamp + } +}