From f68de91188716afd421ec6716fbbfa5a4cebb11f Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 22 Nov 2019 15:29:39 +0000 Subject: [PATCH] JAL-3449 adding an installer template version. Really an md5 and a commit hash --- build.gradle | 28 ++++++++++++++++---- .../{mk_DS_STORE_cmds => DMG_creation_README.md} | 0 2 files changed, 23 insertions(+), 5 deletions(-) rename utils/install4j/{mk_DS_STORE_cmds => DMG_creation_README.md} (100%) 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 -- 1.7.10.2