From cb3b5084fbc454239e7c77ee9e996e03b8e3e02e Mon Sep 17 00:00:00 2001 From: crschnick Date: Thu, 5 Oct 2023 15:19:48 +0000 Subject: [PATCH] Gradle build fixes --- build.gradle | 1 + dist/build.gradle | 19 ++++++++++++++++++- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f554d5e2f..b3c280cbd 100644 --- a/build.gradle +++ b/build.gradle @@ -49,6 +49,7 @@ project.ext { website = 'https://xpipe.io' sourceWebsite = 'https://github.com/xpipe-io/xpipe' authors = 'Christopher Schnick' + artifactChecksums = new HashMap() } def replaceVariablesInFileAsString(String f, Map replacements) { diff --git a/dist/build.gradle b/dist/build.gradle index 3a5b83462..6f95bf10a 100644 --- a/dist/build.gradle +++ b/dist/build.gradle @@ -5,6 +5,7 @@ plugins { id "org.asciidoctor.jvm.convert" version "3.3.2" id 'org.jreleaser' version '1.8.0' id("com.netflix.nebula.ospackage") version "11.4.0" + id 'org.gradle.crypto.checksum' version '1.4.0' } repositories { @@ -52,4 +53,20 @@ if (rootProject.fullVersion) { } apply from: 'test.gradle' -} \ No newline at end of file +} + +import org.gradle.crypto.checksum.Checksum +def distDir = layout.buildDirectory.get().dir('dist') +task createChecksums(type: Checksum) { + inputFiles.setFrom(distDir.dir('artifacts').getAsFileTree().files) + outputDirectory.set(layout.buildDirectory.dir("dist/checksums")) + checksumAlgorithm.set(Checksum.Algorithm.SHA256) + + doLast { + for (final def file in distDir.dir('checksums').getAsFileTree().files) { + artifactChecksums.put(file.name.lastIndexOf('.').with {it != -1 ? file.name[0..