X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=build.gradle;h=d189d28ccc2a1ede279819200dd115ff7e106f4f;hb=a4fbae5dde7f0764ae749bc0c86712455f6462d3;hp=6c1e365f48b0c365b4db5dc998bb2801a20d4fa2;hpb=9831dc2e2e282496e16649cd514e9c24bede5c16;p=jalview.git diff --git a/build.gradle b/build.gradle index 6c1e365..d189d28 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ import groovy.transform.ExternalizeMethods buildscript { dependencies { - classpath 'org.openclover:clover:4.3.1' + classpath 'org.openclover:clover:4.4.1' classpath 'org.apache.commons:commons-compress:1.18' } } @@ -61,6 +61,9 @@ ext { 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 @@ -269,7 +272,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) } @@ -284,8 +287,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' } } @@ -449,7 +452,7 @@ eclipse { task cloverInstr() { // only instrument source, we build test classes as normal - inputs.files files (sourceSets.main.allJava) // , fileTree(dir:"$jalviewDir/$testSourceDir", include: ["**/*.java"])) + inputs.files files (sourceSets.main.allJava,sourceSets.test.allJava) // , fileTree(dir:"$jalviewDir/$testSourceDir", include: ["**/*.java"])) outputs.dir cloverInstrDir doFirst { @@ -466,25 +469,35 @@ task cloverInstr() { } +task cloverReportHTML (type: JavaExec) { + inputs.dir "${buildDir}/clover" + outputs.dir "${reportsDir}/clover" + + classpath configurations.cloverRuntime + main = "com.atlassian.clover.reporters.html.HtmlReporter" + args "--initstring", "${buildDir}/clover/clover.db", + "-o", "${reportsDir}/clover" +} + +task cloverReportXML (type: JavaExec) { + inputs.dir "${buildDir}/clover" + outputs.dir "${reportsDir}/clover" + + classpath configurations.cloverRuntime + maxHeapSize "2g" + main = "com.atlassian.clover.reporters.xml.XMLReporter" + args "--initstring", "${buildDir}/clover/clover.db", "-o", "${reportsDir}/clover/clover.xml", "-v" +} 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 @@ -1170,39 +1183,59 @@ clean { task sourceDist (type: Tar) { def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_") - archiveFileName = project.name + "_" + VERSION_UNDERSCORES + ".tar.gz" + 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","**/README", - "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) @@ -1212,22 +1245,26 @@ task sourceDist (type: Tar) { from(jalviewDir) { exclude (EXCLUDE_FILES) exclude (PROCESS_FILES) - exclude ("appletlib") - exclude ("**/*locales") - exclude ("*locales/**") - exclude ("utils/InstallAnywhere") + exclude ("appletlib") + exclude ("**/*locales") + exclude ("*locales/**") + exclude ("utils/InstallAnywhere") exclude (getdown_files_dir) - exclude (getdown_website_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) + // exluding these as not using jars as modules yet + 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) +// } } task helppages {