X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=build.gradle;h=ca738599cd25ee59041f10aa36b5be9c907e40bb;hb=refs%2Fheads%2Fimprovement%2FJAL-3543_dont_report_null_versions_in_java_console;hp=84c38db45b55018616f6ff30e89e4bdc40248342;hpb=1655b4dd264bcc756d2d08cfe786dd64d75e7d06;p=jalview.git diff --git a/build.gradle b/build.gradle index 84c38db..ca73859 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ import groovy.xml.XmlUtil buildscript { dependencies { - classpath 'org.openclover:clover:4.3.1' + classpath 'org.openclover:clover:4.4.1' } } @@ -32,7 +32,6 @@ repositories { } dependencies { - compile 'org.apache.commons:commons-compress:1.18' } @@ -127,6 +126,7 @@ ext { getdownAppDistDir = getdown_app_dir_alt buildProperties = string("${classesDir}/${build_properties_file}") reportRsyncCmd = false + jvlChannelName = CHANNEL.toLowerCase() switch (CHANNEL) { case "BUILD": @@ -134,6 +134,7 @@ ext { getdown_channel_base = bamboo_channelbase getdownChannelName = string("${bamboo_planKey}/${JAVA_VERSION}") getdownAppBase = string("${bamboo_channelbase}/${bamboo_planKey}${bamboo_getdown_channel_suffix}/${JAVA_VERSION}") + jvlChannelName += "_${getdownChannelName}" break case "RELEASE": @@ -185,6 +186,15 @@ ext { reportRsyncCommand = true break + case "TEST-LOCAL": + if (!file("${LOCALDIR}").exists()) { + throw new GradleException("Must provide a LOCALDIR value to produce a local distribution") + } else { + getdownAppBase = file(file("${LOCALDIR}").getAbsolutePath()).toURI().toString() + getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}") + } + break + case "LOCAL": getdownAppBase = file(getdownWebsiteDir).toURI().toString() getdownLauncher = string("${jalviewDir}/${getdown_lib_dir}/${getdown_launcher_local}") @@ -200,6 +210,8 @@ ext { getdownAppBase = string(getProperty("getdown_appbase_override")) println("Overriding getdown appbase with '${getdownAppBase}'") } + // sanitise file name for jalview launcher file for this channel + jvlChannelName = jvlChannelName.replaceAll(/[^\w\-]/,"_") getdownAppDir = string("${getdownWebsiteDir}/${getdownAppDistDir}") //getdownJ11libDir = "${getdownWebsiteDir}/${getdown_j11lib_dir}" @@ -376,7 +388,7 @@ sourceSets { compileClasspath = files( sourceSets.test.java.outputDir ) if (use_clover) { - compileClasspath += sourceSets.clover.compileClasspath + compileClasspath = sourceSets.clover.compileClasspath } else { compileClasspath += files(sourceSets.main.java.outputDir) } @@ -393,8 +405,8 @@ sourceSets { // clover bits dependencies { if (use_clover) { - cloverCompile 'org.openclover:clover:4.3.1' - testCompile 'org.openclover:clover:4.3.1' + cloverCompile 'org.openclover:clover:4.4.1' + testCompile 'org.openclover:clover:4.4.1' } } @@ -540,7 +552,7 @@ eclipse { task cloverInstr() { // only instrument source, we build test classes as normal - inputs.files files (sourceSets.main.allJava) // , fileTree(dir: testSourceDir, include: ["**/*.java"])) + inputs.files files (sourceSets.main.allJava,sourceSets.test.allJava) // , fileTree(dir:"$jalviewDir/$testSourceDir", include: ["**/*.java"])) outputs.dir cloverInstrDir doFirst { @@ -557,25 +569,43 @@ task cloverInstr() { } +task cloverReportHTML (type: JavaExec) { + inputs.dir "${buildDir}/clover" + outputs.dir "${reportsDir}/clover" + + classpath configurations.cloverRuntime + maxHeapSize "${cloverReportJVMHeap}" + jvmArgs += "${cloverReportJVMArgs}" + main = "com.atlassian.clover.reporters.html.HtmlReporter" + args "--initstring", "${buildDir}/clover/clover.db", "-o", "${reportsDir}/clover" + "${cloverReportHTMLOptions}".split(",").each { + args+= it.trim() + } +} + +task cloverReportXML (type: JavaExec) { + inputs.dir "${buildDir}/clover" + outputs.dir "${reportsDir}/clover" + maxHeapSize "${cloverReportJVMHeap}" + jvmArgs "${cloverReportJVMArgs}" + classpath configurations.cloverRuntime + main = "com.atlassian.clover.reporters.xml.XMLReporter" + args "--initstring", "${buildDir}/clover/clover.db", "-o", "${reportsDir}/clover/clover.xml" + + "${cloverReportXMLOptions}".split(",").each { + args+= it.trim() + } +} task cloverReport { group = "Verification" - description = "Createst the Clover report" + description = "Creates the Clover report" inputs.dir "${buildDir}/clover" outputs.dir "${reportsDir}/clover" onlyIf { file("${buildDir}/clover/clover.db").exists() } - doFirst { - def argsList = ["--initstring", "${buildDir}/clover/clover.db", - "-o", "${reportsDir}/clover"] - String[] args = argsList.toArray() - com.atlassian.clover.reporters.html.HtmlReporter.runReport(args) - - // and generate ${reportsDir}/clover/clover.xml - args = ["--initstring", "${buildDir}/clover/clover.db", - "-o", "${reportsDir}/clover/clover.xml"].toArray() - com.atlassian.clover.reporters.xml.XMLReporter.runReport(args) - } + dependsOn cloverReportXML + dependsOn cloverReportHTML } // end clover bits @@ -1088,9 +1118,9 @@ task getdownWebsite() { def getdown_txt = file("${getdownWebsiteDir}/getdown.txt") getdown_txt.write(getdownTextString) - def getdownLaunchJvl = ( (getdownChannelName != null && getdownChannelName.length() > 0)?"${getdownChannelName}_":"" ) + getdown_launch_jvl - def launch_jvl = file("${getdownWebsiteDir}/${getdown_launch_jvl}") - launch_jvl.write("appbase="+props.get("getdown_txt_appbase")) + def getdownLaunchJvl = getdown_launch_jvl_name + ( (jvlChannelName != null && jvlChannelName.length() > 0)?"-${jvlChannelName}":"" ) + ".jvl" + def launchJvl = file("${getdownWebsiteDir}/${getdownLaunchJvl}") + launchJvl.write("appbase="+props.get("getdown_txt_appbase")) copy { from getdownLauncher @@ -1125,7 +1155,7 @@ task getdownWebsite() { copy { from getdown_txt - from launch_jvl + from launchJvl from getdownLauncher from "${getdownWebsiteDir}/${getdown_build_properties}" if (file(getdownLauncher).getName() != getdown_launcher) { @@ -1148,6 +1178,22 @@ task getdownWebsite() { } +// a helper task to allow getdown digest of any dir: `gradle getdownDigestDir -PDIGESTDIR=/path/to/my/random/getdown/dir +task getdownDigestDir(type: JavaExec) { + def digestDirPropertyName = "DIGESTDIR" + description = "Digest a local dir (-P${digestDirPropertyName}=...) for getdown" + doFirst { + classpath = files(getdownLauncher) + def digestDir = findProperty(digestDirPropertyName) + if (digestDir == null) { + throw new GradleException("Must provide a DIGESTDIR value to produce an alternative getdown digest") + } + args digestDir + } + main = "com.threerings.getdown.tools.Digester" +} + + task getdownDigest(type: JavaExec) { group = "distribution" description = "Digest the getdown website folder" @@ -1227,6 +1273,14 @@ task copyInstall4jTemplate { } } + // turn off checksum creation for LOCAL channel + def e = install4jConfigXml.application[0] + if (CHANNEL == "LOCAL") { + e.'@createChecksums' = "false" + } else { + e.'@createChecksums' = "true" + } + // put file association actions where placeholder action is def install4jFileAssociationsText = install4jFileAssociationsFile.text def fileAssociationActions = new XmlParser().parseText("${install4jFileAssociationsText}") @@ -1279,6 +1333,7 @@ task installers(type: com.install4j.gradle.Install4jTask) { def install4jBuildDir = "${install4j_build_dir}/${JAVA_VERSION}" variables = [ + 'JALVIEW_NAME': getdown_txt_title, 'JALVIEW_DIR': "../..", 'OSX_KEYSTORE': OSX_KEYSTORE, 'JSIGN_SH': JSIGN_SH, @@ -1298,6 +1353,7 @@ task installers(type: com.install4j.gradle.Install4jTask) { 'LINUX_JAVA_VM_TGZ': linuxJavaVMTgz, 'COPYRIGHT_MESSAGE': install4j_copyright_message, 'MACOS_BUNDLE_ID': install4j_macOS_bundle_id, + 'INSTALLER_NAME': install4j_installer_name, 'INSTALL4J_UTILS_DIR': install4j_utils_dir, 'GETDOWN_WEBSITE_DIR': getdown_website_dir, 'GETDOWN_FILES_DIR': getdown_files_dir, @@ -1312,8 +1368,7 @@ task installers(type: com.install4j.gradle.Install4jTask) { destination = "${jalviewDir}/${install4jBuildDir}" buildSelected = true - if (install4j_faster.equals("true") || CHANNEL.startsWith("DEVELOP") || CHANNEL.startsWith("LOCAL")) { - // this doesn't seem to work + if (install4j_faster.equals("true") || CHANNEL.startsWith("LOCAL")) { faster = true disableSigning = true } @@ -1350,33 +1405,47 @@ task sourceDist(type: Tar) { 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"] + def EXCLUDE_FILES=[ + "build/*", + "bin/*", + "test-output/", + "test-reports", + "tests", + "clover*/*", + ".*", + "benchmarking/*", + "**/.*", + "*.class", + "**/*.class","$j11modDir/**/*.jar","appletlib","**/*locales", + "*locales/**", + "utils/InstallAnywhere", + "**/*.log", + ] + 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", + ] + def INCLUDE_FILES=[ + ".settings/org.eclipse.jdt.core.jalview.prefs", + ] from(jalviewDir) { exclude (EXCLUDE_FILES) @@ -1402,14 +1471,17 @@ task sourceDist(type: Tar) { 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) - // } + exclude ("$j11modDir/**/*.jar") + } + from(jalviewDir) { + include(INCLUDE_FILES) + } +// from (jalviewDir) { +// // explicit includes for stuff that seemed to not get included +// include(fileTree("test/**/*.")) +// exclude(EXCLUDE_FILES) +// exclude(PROCESS_FILES) +// } }