install4j {
def install4jHomeDir = "/opt/install4j"
def hostname = "hostname".execute().text.trim()
+ def install4jName = (install4jVersion >= 8) ? "install4j"+install4jVersion:"install4j"
if (hostname.equals("jv-bamboo")) {
- install4jHomeDir = System.getProperty("user.home")+"/buildtools/install4j"
+ install4jHomeDir = System.getProperty("user.home")+"/buildtools/"+install4jName
} else if (OperatingSystem.current().isMacOsX()) {
- install4jHomeDir = '/Applications/install4j.app/Contents/Resources/app'
+ install4jHomeDir = '/Applications/'+install4jName+'.app/Contents/Resources/app'
if (! file(install4jHomeDir).exists()) {
install4jHomeDir = System.getProperty("user.home")+install4jHomeDir
}
} else if (OperatingSystem.current().isLinux()) {
- install4jHomeDir = System.getProperty("user.home")+"/buildtools/install4j"
+ install4jHomeDir = System.getProperty("user.home")+"/buildtools/"+install4jName
}
installDir = file(install4jHomeDir)
mediaTypes = Arrays.asList(install4jMediaTypes.split(","))
macosJavaVMTgz = System.env.HOME+"/buildtools/jre/openjdk-java_vm/install4j/tgz/macos-jre"+JAVA_VERSION+".tar.gz"
windowsJavaVMDir = System.env.HOME+"/buildtools/jre/openjdk-java_vm/getdown/windows-jre"+JAVA_VERSION+"/jre"
windowsJavaVMTgz = System.env.HOME+"/buildtools/jre/openjdk-java_vm/install4j/tgz/windows-jre"+JAVA_VERSION+".tar.gz"
+ def i4jTemplate = (install4jVersion >= 8)?install4j8Template:install4jTemplate
from (install4jDir) {
- include install4jTemplate
- rename (install4jTemplate, install4jConfFile)
+ include i4jTemplate
+ rename (i4jTemplate, install4jConfFile)
filter(ReplaceTokens, beginToken: '', endToken: '', tokens: ['9999999999': JAVA_VERSION])
filter(ReplaceTokens, beginToken: '$$', endToken: '$$',
tokens: [
doLast {
// include file associations in installer
- def installerFileAssociationsXml = file("$install4jDir/$install4jInstallerFileAssociations").text
+ def i4jIFA = (install4jVersion >= 8)?install4j8InstallerFileAssociations:install4jInstallerFileAssociations
+ def installerFileAssociationsXml = file("$install4jDir/$i4jIFA").text
ant.replaceregexp(
byline: false,
flags: "s",