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:
parent
a8b6a0b95a
commit
58f9be779a
1 changed files with 8 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue