From 3f99b4c31e36e3f3eb277c65e5057c00977681b3 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 22 Apr 2022 16:17:09 +0100 Subject: [PATCH] JAL-3989 Changed to using com.google.common.hash for SHA256 sum, for gradle 7 compatibility --- build.gradle | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 4d2c350..76ccefd 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,6 @@ import groovy.transform.ExternalizeMethods import groovy.util.XmlParser import groovy.xml.XmlUtil import groovy.json.JsonBuilder -import org.gradle.internal.hash.HashUtil import com.vladsch.flexmark.util.ast.Node import com.vladsch.flexmark.html.HtmlRenderer import com.vladsch.flexmark.parser.Parser @@ -24,6 +23,9 @@ import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension import com.vladsch.flexmark.ext.autolink.AutolinkExtension import com.vladsch.flexmark.ext.anchorlink.AnchorLinkExtension import com.vladsch.flexmark.ext.toc.TocExtension +import com.google.common.hash.HashCode +import com.google.common.hash.Hashing +import com.google.common.io.Files buildscript { repositories { @@ -2138,11 +2140,12 @@ task installerFiles(type: com.install4j.gradle.Install4jTask) { } def getDataHash(File myFile) { + HashCode hash = Files.asByteSource(myFile).hash(Hashing.sha256()) return myFile.exists() ? [ "filename" : myFile.getName(), "filesize" : myFile.length(), - "sha256" : HashUtil.createHash(myFile, "SHA-256").asHexString() + "sha256" : hash.toString() ] : null } -- 1.7.10.2