task cleanInstallersDataFiles {
def installersOutputTxt = file("${jalviewDir}/${install4jBuildDir}/output.txt")
- def installersSha256 = file("${jalviewDir}/${install4jBuildDir}/sha256sums")
def hugoDataJsonFile = file("${jalviewDir}/${install4jBuildDir}/installers-${JALVIEW_VERSION_UNDERSCORES}.json")
doFirst {
delete installersOutputTxt
- delete installersSha256
delete hugoDataJsonFile
}
}
: null
}
-def writeDataJsonFile(File installersOutputTxt, File installersSha256, File dataJsonFile) {
+def writeDataJsonFile(File installersOutputTxt, File dataJsonFile) {
def hash = [
"channel" : getdownChannelName,
"date" : getDate("yyyy-MM-dd HH:mm:ss"),
line.replaceAll("\n","")
def vals = line.split("\t")
def filename = vals[3]
- def filesize = file(filename).length()
+ def file = file(vals[3])
+ def filesize = file.length()
+ def sha256 = getDataHash(file)
filename = filename.replaceAll(/^.*\//, "")
- hash[vals[0]] = [ "id" : vals[0], "os" : vals[1], "name" : vals[2], "file" : filename, "filesize" : filesize ]
+ hash[vals[0]] = [ "id" : vals[0], "os" : vals[1], "name" : vals[2], "file" : filename, "filesize" : filesize, "sha256": sha256 ]
idHash."${filename}" = vals[0]
}
- if (install4jCheckSums && installersSha256.exists()) {
- installersSha256.readLines().each { def line ->
- if (line.startsWith("#")) {
- return;
- }
- line.replaceAll("\n","")
- def vals = line.split(/\s+\*?/)
- def filename = vals[1]
- def innerHash = (hash.(idHash."${filename}"))."sha256" = vals[0]
- }
- }
}
-
+
[
"JAR": shadowJar.archiveFile, // executable JAR
"JVL": getdownVersionLaunchJvl, // version JVL
task staticMakeInstallersJsonFile {
doFirst {
def output = findProperty("i4j_output")
- def sha256 = findProperty("i4j_sha256")
def json = findProperty("i4j_json")
if (output == null || sha256 == null || json == null) {
- throw new GradleException("Must provide paths to all of output.txt, sha256sums, and output.json with '-Pi4j_output=... -Pi4j_sha256=... -Pi4j_json=...")
+ throw new GradleException("Must provide paths to all of output.txt and output.json with '-Pi4j_output=... -Pi4j_json=...")
}
- writeDataJsonFile(file(output), file(sha256), file(json))
+ writeDataJsonFile(file(output), file(json))
}
}
mustRunAfter getdownArchive
def installersOutputTxt = file("${jalviewDir}/${install4jBuildDir}/output.txt")
- def installersSha256 = file("${jalviewDir}/${install4jBuildDir}/sha256sums")
- if (installersOutputTxt.exists()) {
- inputs.file(installersOutputTxt)
- }
- if (install4jCheckSums && installersSha256.exists()) {
- inputs.file(installersSha256)
- }
+ inputs.dir("${jalviewDir}/${install4j_build_dir}/${JAVA_VERSION}")
[
shadowJar.archiveFile, // executable JAR
getdownVersionLaunchJvl, // version JVL
outputs.file(hugoDataJsonFile)
doFirst {
- writeDataJsonFile(installersOutputTxt, installersSha256, hugoDataJsonFile)
+ writeDataJsonFile(installersOutputTxt, hugoDataJsonFile)
}
}