1
0
Fork 0
tt9/app/dictionary-tools.gradle
sspanak 4907671aa3 db migrations
simplified the Add Word dialog

added a popup confirmation when there are new dictionary words
2024-02-26 10:59:48 +02:00

13 lines
596 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.getDictionaryHashes = { dictionariesDir, timestampsDir ->
fileTree(dir: dictionariesDir).getFiles().parallelStream().forEach {dictionary ->
def hash = dictionary.exists() ? dictionary.text.digest("SHA-1") : ""
new File(timestampsDir, "${dictionary.getName()}.hash").text = hash
}
}