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)
beginToken: '',
endToken: '',
tokens: [
- '1111111111': JAVA_MIN_VERSION,
+ '0000000000': JAVA_MIN_VERSION,
'9999999999': JAVA_MAX_VERSION
]
)
+
filter(ReplaceTokens,
beginToken: '$$',
endToken: '$$',
'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,
}
}
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