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 } }