From: Ben Soares Date: Fri, 22 Nov 2019 15:29:39 +0000 (+0000) Subject: JAL-3449 adding an installer template version. Really an md5 and a commit hash X-Git-Tag: Develop-2_11_2_0-d20201215~80^2~28^2~28 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=f68de91188716afd421ec6716fbbfa5a4cebb11f JAL-3449 adding an installer template version. Really an md5 and a commit hash --- diff --git a/build.gradle b/build.gradle index 9059447..3ebb7ec 100644 --- a/build.gradle +++ b/build.gradle @@ -1215,6 +1215,26 @@ install4j { task copyInstall4jTemplate(type: Copy) { + dependsOn setGitVals + + def install4jTemplateMd5 = "" + def digest = MessageDigest.getInstance("MD5") + digest.update( + (file("${install4jDir}/${install4j_template}").text + + file("${install4jDir}/${install4j_info_plist_file_associations}").text + + file("${install4jDir}/${install4j_installer_file_associations}").text).bytes) + def filesMd5 = new BigInteger(1, digest.digest()).toString(16) + if (filesMd5.length() >= 8) { + filesMd5 = filesMd5.substring(0,8) + } + install4jTemplateMd5 += filesMd5 + install4jTemplateMd5 += "_${gitHash}" + + inputs.file("${install4jDir}/${install4j_template}") + inputs.file("${install4jDir}/${install4j_info_plist_file_associations}") + inputs.file("${install4jDir}/${install4j_installer_file_associations}") + outputs.files(install4jConfFile) + from (install4jDir) { include install4j_template rename (install4j_template, install4jConfFileName) @@ -1222,10 +1242,11 @@ task copyInstall4jTemplate(type: Copy) { beginToken: '', endToken: '', tokens: [ - '1111111111': JAVA_MIN_VERSION, + '0000000000': JAVA_MIN_VERSION, '9999999999': JAVA_MAX_VERSION ] ) + filter(ReplaceTokens, beginToken: '$$', endToken: '$$', @@ -1238,6 +1259,7 @@ task copyInstall4jTemplate(type: Copy) { 'WINDOWS_JAVA_VM_DIR': windowsJavaVMDir, 'WINDOWS_JAVA_VM_TGZ': windowsJavaVMTgz, 'INSTALL4JINFOPLISTFILEASSOCIATIONS': install4j_info_plist_file_associations, + 'INSTALLER_TEMPLATE_MD5': install4jTemplateMd5, 'COPYRIGHT_MESSAGE': install4j_copyright_message, 'MACOS_BUNDLE_ID': install4j_macOS_bundle_id, 'GETDOWN_RESOURCE_DIR': getdown_resource_dir, @@ -1264,10 +1286,6 @@ task copyInstall4jTemplate(type: Copy) { } } into install4jDir - inputs.file("${install4jDir}/${install4j_template}") - inputs.file("${install4jDir}/${install4j_installer_file_associations}") - inputs.file("${install4jDir}/${install4j_info_plist_file_associations}") - outputs.files(install4jConfFile) doLast { // include file associations in installer diff --git a/utils/install4j/mk_DS_STORE_cmds b/utils/install4j/DMG_creation_README.md similarity index 100% rename from utils/install4j/mk_DS_STORE_cmds rename to utils/install4j/DMG_creation_README.md