Rework checksums some more

This commit is contained in:
crschnick 2024-01-03 18:56:33 +00:00
parent 0070a08109
commit 6c9fddebe6
2 changed files with 9 additions and 9 deletions

View file

@ -52,15 +52,6 @@ project.ext {
javafxVersion = '21.0.1'
}
def getArtifactChecksumSha256Hex(String name) {
var file = layout.buildDirectory.file("dist/checksums/artifacts/${name}.sha256")
return file.get().getAsFile().exists() ? file.get().getAsFile().text : "";
}
def getArtifactChecksumSha256Base64(String name) {
return Base64.getEncoder().encodeToString(HexFormat.of().parseHex(getArtifactChecksumSha256Hex(name)))
}
def replaceVariablesInFileAsString(String f, Map<String, String> replacements) {
def fileName = file(f).getName()
def text = file(f).text

9
dist/build.gradle vendored
View file

@ -48,6 +48,15 @@ task createChecksums(type: Checksum) {
}
}
def getArtifactChecksumSha256Hex(String name) {
var file = layout.buildDirectory.file("dist/checksums/artifacts/${name}.sha256")
return file.get().getAsFile().exists() ? file.get().getAsFile().text : "";
}
def getArtifactChecksumSha256Base64(String name) {
return Base64.getEncoder().encodeToString(HexFormat.of().parseHex(getArtifactChecksumSha256Hex(name)))
}
clean {
doFirst {
// Fix clean failing when file is read-only