1
0
Fork 0

dictionary properties are now calculated in parallel for faster build time

This commit is contained in:
sspanak 2024-02-19 16:27:39 +02:00 committed by Dimo Karaivanov
parent b12c85ecfc
commit 0e8dfbe578

View file

@ -1,6 +1,13 @@
ext.getDictionarySizes = { dictionariesDir, sizesDir -> 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 def dictionarySize = dictionary.exists() ? dictionary.text.split("\n").length : 0
new File(sizesDir, "${dictionary.getName()}.size").text = dictionarySize new File(sizesDir, "${dictionary.getName()}.size").text = dictionarySize
} }
} }
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
}
}