1
0
Fork 0

during build time the dictionary freshness is determined using 'sha256sum' shell command instead of Groovy's digest('SHA-256') to hopefuly prevent build crashing on F-droid

This commit is contained in:
sspanak 2025-05-03 13:51:02 +03:00 committed by Dimo Karaivanov
parent a8b6a0b95a
commit 58f9be779a

View file

@ -56,10 +56,16 @@ class Wrapper {
static def getLanguageHash(File definitionFile, File dictionaryFile) { static def getLanguageHash(File definitionFile, File dictionaryFile) {
def definitionHash = definitionFile != null && definitionFile.exists() ? definitionFile.text.digest("SHA-256") : "" def definitionHash = definitionFile != null && definitionFile.exists() ? sha256(definitionFile.path) : ""
def dictionaryHash = dictionaryFile != null && dictionaryFile.exists() ? dictionaryFile.text.digest("SHA-256") : "" def dictionaryHash = dictionaryFile != null && dictionaryFile.exists() ? sha256(dictionaryFile.path) : ""
return definitionHash + dictionaryHash return definitionHash + dictionaryHash
} }
static def sha256(String filePath) {
def parts = "sha256sum $filePath".execute().text.trim().split(" ")
return parts.length > 0 ? parts[0] : ""
}
} }
ext.DictionaryTools = Wrapper ext.DictionaryTools = Wrapper