From: Ben Soares Date: Fri, 6 Dec 2019 17:34:55 +0000 (+0000) Subject: JAL-3394 Changed most of the token replacement for adding compiler variables X-Git-Tag: Develop-2_11_2_0-d20201215~80^2~28^2~22 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b7e1d10df4497f4ec7a684cd0c4c7f1500ee71d9;p=jalview.git JAL-3394 Changed most of the token replacement for adding compiler variables --- diff --git a/build.gradle b/build.gradle index 336bc42..cdea714 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ plugins { id 'application' id 'eclipse' id 'com.github.johnrengelman.shadow' version '4.0.3' - id 'com.install4j.gradle' version '7.0.9' + id 'com.install4j.gradle' version '8.0.2' id 'com.dorongold.task-tree' version '1.4' // only needed to display task dependency tree with gradle task1 [task2 ...] taskTree } @@ -1208,7 +1208,7 @@ install4j { installDir(file(install4jHomeDir)) mediaTypes = Arrays.asList(install4j_media_types.split(",")) - if (install4j_faster.equals("true")) { + if (install4j_faster.equals("true") || CHANNEL.startsWith("DEVELOP") || CHANNEL.startsWith("LOCAL")) { faster = true } } @@ -1238,6 +1238,7 @@ task copyInstall4jTemplate(type: Copy) { from (install4jDir) { include install4j_template rename (install4j_template, install4jConfFileName) + /* filter(ReplaceTokens, beginToken: '', endToken: '', @@ -1268,6 +1269,7 @@ task copyInstall4jTemplate(type: Copy) { 'GETDOWN_INSTALL_DIR': getdown_install_dir ] ) + */ if (OSX_KEYPASS == "") { filter(ReplaceTokens, beginToken: 'codeSigning macEnabled="', @@ -1325,7 +1327,43 @@ task installers(type: com.install4j.gradle.Install4jTask) { dependsOn getdown dependsOn copyInstall4jTemplate projectFile = file(install4jConfFile) - variables = [majorVersion: version.substring(2, 11), build: 001, OSX_KEYSTORE: OSX_KEYSTORE, JSIGN_SH: JSIGN_SH] + + 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}" + def install4jTemplateVersion = "${JALVIEW_VERSION}_${install4jTemplateMd5}" + + variables = [ + 'OSX_KEYSTORE': OSX_KEYSTORE, + 'JSIGN_SH': JSIGN_SH, + 'JALVIEW_VERSION': JALVIEW_VERSION, + 'JAVA_MIN_VERSION': JAVA_MIN_VERSION, + 'JAVA_MAX_VERSION': JAVA_MAX_VERSION, + 'JAVA_VERSION': JAVA_VERSION, + 'JAVA_INTEGER_VERSION': JAVA_INTEGER_VERSION, + 'VERSION': JALVIEW_VERSION, + 'MACOS_JAVA_VM_DIR': macosJavaVMDir, + 'MACOS_JAVA_VM_TGZ': macosJavaVMTgz, + 'WINDOWS_JAVA_VM_DIR': windowsJavaVMDir, + 'WINDOWS_JAVA_VM_TGZ': windowsJavaVMTgz, + 'INSTALL4JINFOPLISTFILEASSOCIATIONS': install4j_info_plist_file_associations, + 'INSTALLER_TEMPLATE_VERSION': install4jTemplateVersion, + 'COPYRIGHT_MESSAGE': install4j_copyright_message, + 'MACOS_BUNDLE_ID': install4j_macOS_bundle_id, + 'GETDOWN_RESOURCE_DIR': getdown_resource_dir, + 'GETDOWN_DIST_DIR': getdown_app_dir, + 'GETDOWN_ALT_DIR': getdown_app_dir_alt, + 'GETDOWN_INSTALL_DIR': getdown_install_dir + ] destination = "${jalviewDir}/${install4j_build_dir}/${JAVA_VERSION}" buildSelected = true diff --git a/utils/install4j/install4j8_template.install4j b/utils/install4j/install4j8_template.install4j index 7860656..de8b133 100644 --- a/utils/install4j/install4j8_template.install4j +++ b/utils/install4j/install4j8_template.install4j @@ -1,7 +1,7 @@ - + @@ -11,7 +11,24 @@ - + + + + + + + + + + + + + + + + + + @@ -39,11 +56,11 @@ - - - - - + + + + + @@ -80,9 +97,9 @@ - - - + + + @@ -90,19 +107,19 @@ - + - + - + - + @@ -110,21 +127,21 @@ - + - + - + - + - + @@ -635,17 +652,17 @@ return console.askYesNo(message, true); - $$GETDOWN_DIST_DIR$$ + ${compiler:GETDOWN_DIST_DIR} - $$GETDOWN_ALT_DIR$$ + ${compiler:GETDOWN_ALT_DIR} - $$GETDOWN_RESOURCE_DIR$$ + ${compiler:GETDOWN_RESOURCE_DIR} @@ -1024,7 +1041,7 @@ return console.askYesNo(message, true); - + @@ -1043,7 +1060,7 @@ return console.askYesNo(message, true); - + @@ -1062,7 +1079,7 @@ return console.askYesNo(message, true); - + @@ -1079,9 +1096,9 @@ return console.askYesNo(message, true); - + - + @@ -1094,9 +1111,9 @@ return console.askYesNo(message, true); - + - + @@ -1117,7 +1134,7 @@ return console.askYesNo(message, true); - + @@ -1138,7 +1155,7 @@ return console.askYesNo(message, true); - + @@ -1156,7 +1173,7 @@ return console.askYesNo(message, true); - + @@ -1171,7 +1188,7 @@ return console.askYesNo(message, true); - + @@ -1189,7 +1206,7 @@ return console.askYesNo(message, true); - +