From 32359e95ca4259e224e6a93f793ab176b59c8184 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 25 Nov 2021 11:08:15 +0000 Subject: [PATCH] JAL-3553 added filesize to json --- build.gradle | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 89af47c..6c7b7b9 100644 --- a/build.gradle +++ b/build.gradle @@ -1992,8 +1992,12 @@ task installerFiles(type: com.install4j.gradle.Install4jTask) { } def writeInstallersJsonFile(File installersOutputTxt, File installersSha256, File installersJsonFile) { - if ((!installersOutputTxt.exists()) || (install4jCheckSums && (!installersSha256))) { - throw new GradleException("One of the required input files doesn't exist.") + if (!installersOutputTxt.exists()) { + throw new GradleException("Required input file '${installersOutputTxt.getPath()}' doesn't exist.") + return null; + } + if (install4jCheckSums && (!installersSha256)) { + throw new GradleException("Required input file '${installersSha256.getPath()}' doesn't exist.") return null; } def hash = [:] @@ -2005,8 +2009,9 @@ def writeInstallersJsonFile(File installersOutputTxt, File installersSha256, Fil line.replaceAll("\n","") def vals = line.split("\t") def filename = vals[3] + def filesize = file(filename).length() filename = filename.replaceAll(/^.*\//, "") - hash[vals[0]] = [ "id" : vals[0], "os" : vals[1], "name" : vals[2], "file" : filename ] + hash[vals[0]] = [ "id" : vals[0], "os" : vals[1], "name" : vals[2], "file" : filename, "filesize" : filesize ] idHash."${filename}" = vals[0] } if (install4jCheckSums) { -- 1.7.10.2