1
0
Fork 0
tt9/app/dictionary-tools.gradle

13 lines
628 B
Groovy

ext.getDictionarySizes = { dictionariesDir, sizesDir ->
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
}
}
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
}
}