X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=build.gradle;h=8d84b25a235f474c18d751d4ad548c55c9340d12;hb=refs%2Fheads%2Ftask%2FJAL-3394_install4j8_option;hp=81c27510380951cb5e4aa6160077eb7f53a89953;hpb=42685807a6a6298af4715267245460bc5f774f84;p=jalview.git diff --git a/build.gradle b/build.gradle index 81c2751..8d84b25 100644 --- a/build.gradle +++ b/build.gradle @@ -56,10 +56,14 @@ ext { reportRsyncCmd = false buildDist = true buildProperties = buildPropertiesFile + getdownLauncher = jalviewDir + '/' + getdown_lib_dir + '/' + getdown_launcher switch (CHANNEL) { case "BUILD": // TODO: get bamboo build artifact URL for getdown artifacts + getdown_channel_base = bamboo_channelbase + getdown_channel_name = bamboo_planKey + '/'+JAVA_VERSION + getdown_app_base = bamboo_channelbase + '/'+ bamboo_planKey + bamboo_getdown_channel_suffix + '/'+JAVA_VERSION getdown_app_dir = getdown_app_dir_alt buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile break @@ -103,6 +107,7 @@ ext { buildDist = false } reportRsyncCommand = true + getdownLauncher = jalviewDir + '/' + getdown_lib_dir + '/' + getdown_launcher_local break case "DEVELOP": @@ -136,6 +141,7 @@ ext { getdown_app_base = file(getdownWebsiteDir).toURI().toString() getdown_app_dir = getdown_app_dir_alt buildProperties = jalviewDir + "/" + classesDir +"/" + buildPropertiesFile + getdownLauncher = jalviewDir + '/' + getdown_lib_dir + '/' + getdown_launcher_local break default: // something wrong specified @@ -150,11 +156,12 @@ ext { //getdownJ11libDir = getdownWebsiteDir + '/' + getdown_j11lib_dir getdownResourceDir = getdownWebsiteDir + '/' + getdown_resource_dir getdownInstallDir = getdownWebsiteDir + '/' + getdown_install_dir - getdownLauncher = jalviewDir + '/' + getdown_launcher getdownFilesDir = jalviewDir + '/' + getdown_files_dir + '/' + JAVA_VERSION + '/' getdownFilesInstallDir = getdownFilesDir+"/"+getdown_install_dir + /* compile without modules -- using classpath libraries modules_compileClasspath = fileTree(dir: "$jalviewDir/$j11modDir", include: ["*.jar"]) modules_runtimeClasspath = modules_compileClasspath + */ gitHash = "" gitBranch = "" } @@ -189,10 +196,12 @@ if (JAVA_VERSION.equals("1.8")) { getdown_alt_java_max_version = getdown_alt_java11_max_version getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location eclipse_java_runtime_name = "JavaSE-11" + /* compile without modules -- using classpath libraries additional_compiler_args += [ '--module-path', ext.modules_compileClasspath.asPath, '--add-modules', j11modules ] + */ } else if (JAVA_VERSION.equals("12") || JAVA_VERSION.equals("13")) { JAVA_INTEGER_VERSION = JAVA_VERSION libDir = j11libDir @@ -203,10 +212,12 @@ if (JAVA_VERSION.equals("1.8")) { getdown_alt_java_max_version = getdown_alt_java11_max_version getdown_alt_multi_java_location = getdown_alt_java11_txt_multi_java_location eclipse_java_runtime_name = "JavaSE-11" + /* compile without modules -- using classpath libraries additional_compiler_args += [ '--module-path', ext.modules_compileClasspath.asPath, '--add-modules', j11modules ] + */ } else { throw new GradleException("JAVA_VERSION=$JAVA_VERSION not currently supported by Jalview") } @@ -595,7 +606,7 @@ task convertBuildingMD(type: Exec) { } doFirst { - if (false && pandoc != null && file(pandoc).exists()) { + if (pandoc != null && file(pandoc).exists()) { commandLine pandoc, '-s', '-o', buildingHTML, '--metadata', 'pagetitle="Building Jalview from Source"', '--toc', '-H', css, buildingMD } else { println("Cannot find pandoc. Skipping convert building.md to HTML") @@ -630,7 +641,7 @@ task copyHelp(type: Copy) { exclude '**/*.gif' exclude '**/*.jpg' exclude '**/*.png' - filter(ReplaceTokens, beginToken: '$$', endToken: '$$', tokens: ['Version-Rel': JALVIEW_VERSION]) + filter(ReplaceTokens, beginToken: '$$', endToken: '$$', tokens: ['Version-Rel': JALVIEW_VERSION,'Year-Rel': getDate("yyyy")]) } from(inputDir) { include '**/*.gif' @@ -724,7 +735,7 @@ task compileLinkCheck(type: JavaCompile) { outputs.file("$jalviewDir/$utilsDir/BufferedLineReader.class") } -def helplinkscheckeroutputfile = file("$jalviewDir/$utilsDir/HelpLinksChecker.out") +def helplinkscheckertouchfile = file("$jalviewDir/$utilsDir/HelpLinksChecker.touch") task linkCheck(type: JavaExec) { dependsOn prepare, compileLinkCheck classpath = files("$jalviewDir/$utilsDir") @@ -733,14 +744,20 @@ task linkCheck(type: JavaExec) { def help = "$classes/$helpDir" args = [ "$classes/$helpDir", "-nointernet" ] - doFirst { - helplinkscheckeroutputfile.createNewFile() - standardOutput new FileOutputStream(helplinkscheckeroutputfile, false) + doLast { + helplinkscheckertouchfile.createNewFile() } - outputs.file(helplinkscheckeroutputfile) + inputs.dir("$classes/$helpDir") + outputs.file(helplinkscheckertouchfile) } +// import the pubhtmlhelp target +ant.properties.basedir = "$jalviewDir" +ant.properties.helpBuildDir = jalviewDirAbsolutePath+"/$classes/$helpDir" +ant.importBuild "$utilsDir/publishHelp.xml" + + task cleanPackageDir(type: Delete) { delete fileTree("$jalviewDir/$packageDir").include("*.jar") } @@ -950,6 +967,9 @@ task getdownWebsite() { copy { from getdownLauncher + if (file(getdownLauncher).getName() != getdown_launcher) { + rename(file(getdownLauncher).getName(), getdown_launcher) + } into project.ext.getdownWebsiteDir } @@ -958,6 +978,9 @@ task getdownWebsite() { from getdown_txt from getdownLauncher from getdownWebsiteDir+"/"+getdown_build_properties + if (file(getdownLauncher).getName() != getdown_launcher) { + rename(file(getdownLauncher).getName(), getdown_launcher) + } into getdownInstallDir } @@ -972,6 +995,9 @@ task getdownWebsite() { from launch_jvl from getdownLauncher from getdownWebsiteDir+"/"+getdown_build_properties + if (file(getdownLauncher).getName() != getdown_launcher) { + rename(file(getdownLauncher).getName(), getdown_launcher) + } into getdownFilesDir } @@ -992,7 +1018,9 @@ task getdownDigest(type: JavaExec) { group = "distribution" description = "Digest the getdown website folder" dependsOn getdownWebsite - classpath = files(jalviewDir + '/' + getdown_core, jalviewDir+'/'+getdown_launcher) + doFirst { + classpath = files(getdownWebsiteDir + '/' + getdown_launcher) + } main = "com.threerings.getdown.tools.Digester" args project.ext.getdownWebsiteDir inputs.dir(project.ext.getdownWebsiteDir) @@ -1029,15 +1057,16 @@ clean { 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(",")) @@ -1060,9 +1089,10 @@ task copyInstall4jTemplate(type: Copy) { 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: [ @@ -1088,11 +1118,20 @@ task copyInstall4jTemplate(type: Copy) { } } into install4jDir + + inputs.files(i4jTemplate) + if (install4jVersion >= 8) { + inputs.files(install4jDir+"/"+install4j8InstallerFileAssociations) + } else { + inputs.files(install4jDir+"/"+install4jInstallerFileAssociations) + inputs.files(install4jDir+"/"+install4jInfoPlistFileAssociations) + } outputs.files(install4jConf) 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", @@ -1142,3 +1181,80 @@ clean { delete install4jConf } +task sourceDist (type: Tar) { + + def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_") + def outputFileName = project.name + "_" + VERSION_UNDERSCORES + ".tar.gz" + // cater for buildship < 3.1 [3.0.1 is max version in eclipse 2018-09] + try { + archiveFileName = outputFileName + } catch (Exception e) { + archiveName = outputFileName + } + + compression Compression.GZIP + + into project.name + + def EXCLUDE_FILES=["build/*","bin/*","test-output/","test-reports","tests","clover*/*" + ,".*" + ,"benchmarking/*" + ,"**/.*" + ,"*.class" + ,"**/*.class","$j11modDir/**/*.jar","appletlib","**/*locales" + ,"*locales/**", + ,"utils/InstallAnywhere"] + def PROCESS_FILES=[ "AUTHORS", + "CITATION", + "FEATURETODO", + "JAVA-11-README", + "FEATURETODO", + "LICENSE", + "**/README", + "RELEASE", + "THIRDPARTYLIBS","TESTNG", + "build.gradle", + "gradle.properties", + "**/*.java", + "**/*.html", + "**/*.xml", + "**/*.gradle", + "**/*.groovy", + "**/*.properties", + "**/*.perl", + "**/*.sh"] + + from(jalviewDir) { + exclude (EXCLUDE_FILES) + include (PROCESS_FILES) + filter(ReplaceTokens, beginToken: '$$', endToken: '$$', tokens: ['Version-Rel': JALVIEW_VERSION,'Year-Rel': getDate("yyyy")]) + } + from(jalviewDir) { + exclude (EXCLUDE_FILES) + exclude (PROCESS_FILES) + exclude ("appletlib") + exclude ("**/*locales") + exclude ("*locales/**") + exclude ("utils/InstallAnywhere") + + exclude (getdown_files_dir) + exclude (getdown_website_dir) + + // exluding these as not using jars as modules yet + exclude ("$j11modDir/**/*.jar") +} +// from (jalviewDir) { +// // explicit includes for stuff that seemed to not get included +// include(fileTree("test/**/*.")) +// exclude(EXCLUDE_FILES) +// exclude(PROCESS_FILES) +// } +} + +task helppages { + dependsOn copyHelp + dependsOn pubhtmlhelp + + inputs.dir("$classes/$helpDir") + outputs.dir("$helpOutputDir") +}