X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=build.gradle;h=46f2226196ef3e80e3120e333fc25ed7ea2b90ee;hb=304e64fb34b32659be1bbfd39fb4e15b2f79586e;hp=17407a9b3cc1ba69c7e03fa93dc25c44a880c36f;hpb=61ff8fb4efa315c35149c9d11850d99e3d00c441;p=jalview.git diff --git a/build.gradle b/build.gradle index 17407a9..46f2226 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,7 @@ import java.security.MessageDigest import groovy.transform.ExternalizeMethods import groovy.util.XmlParser import groovy.xml.XmlUtil + import com.vladsch.flexmark.util.ast.Node import com.vladsch.flexmark.html.HtmlRenderer import com.vladsch.flexmark.parser.Parser @@ -52,12 +53,12 @@ repositories { } - // in ext the values are cast to Object. Ensure string values are cast as String (and not GStringImpl) for later use def string(Object o) { return o == null ? "" : o.toString() } + def overrideProperties(String propsFileName, boolean output = false) { if (propsFileName == null) { return @@ -164,7 +165,6 @@ ext { // datestamp buildDate = new Date().format("yyyyMMdd") - // essentials bareSourceDir = string(source_dir) sourceDir = string("${jalviewDir}/${bareSourceDir}") @@ -185,6 +185,7 @@ ext { //cloverTestClassesDir = cloverClassesDir cloverDb = string("${cloverBuildDir}/clover.db") + testSourceDir = useClover ? cloverTestInstrDir : testDir testClassesDir = useClover ? cloverTestClassesDir : "${jalviewDir}/${test_output_dir}" @@ -467,6 +468,7 @@ ext { helpBuildDir = string("${resourceBuildDir}/help_build") docBuildDir = string("${resourceBuildDir}/doc_build") + if (buildProperties == null) { buildProperties = string("${resourcesBuildDir}/${build_properties_file}") } @@ -515,6 +517,7 @@ sourceSets { srcDirs = [ resourcesBuildDir, docBuildDir, helpBuildDir ] } + compileClasspath = files(sourceSets.main.java.outputDir) compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"]) @@ -1158,6 +1161,7 @@ task convertMdFiles { def htmlFilePath = mdFile.getPath().replaceAll(/\..*?$/, ".html") htmlFiles.add(file(htmlFilePath)) } + outputs.files(htmlFiles) } @@ -1264,7 +1268,6 @@ task createBuildProperties(type: WriteProperties) { outputs.file(outputFile) } - task buildIndices(type: JavaExec) { dependsOn copyHelp classpath = sourceSets.main.compileClasspath @@ -1290,6 +1293,7 @@ task buildResources { dependsOn createBuildProperties } + task prepare { dependsOn buildResources dependsOn copyDocs @@ -1302,8 +1306,6 @@ task prepare { compileJava.dependsOn prepare run.dependsOn compileJava //run.dependsOn prepare - - //testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir test { dependsOn prepare @@ -1346,6 +1348,8 @@ test { } + + task compileLinkCheck(type: JavaCompile) { options.fork = true classpath = files("${jalviewDir}/${utils_dir}") @@ -1381,7 +1385,6 @@ task linkCheck(type: JavaExec) { outputs.file(helpLinksCheckerOutFile) } - // import the pubhtmlhelp target ant.properties.basedir = "${jalviewDir}" ant.properties.helpBuildDir = "${helpBuildDir}/${help_dir}" @@ -1412,7 +1415,6 @@ jar { archiveFileName = rootProject.name+".jar" duplicatesStrategy "EXCLUDE" - exclude "cache*/**" exclude "*.jar" exclude "*.jar.*" @@ -1463,7 +1465,6 @@ task cleanDist { dependsOn clean } - shadowJar { group = "distribution" description = "Create a single jar file with all dependency libraries merged. Can be run with java -jar" @@ -1477,9 +1478,7 @@ shadowJar { attributes "Implementation-Version": JALVIEW_VERSION, "Application-Name": install4jApplicationName } - duplicatesStrategy "INCLUDE" - mainClassName = shadow_jar_main_class mergeServiceFiles() classifier = "all-"+JALVIEW_VERSION+"-j"+JAVA_VERSION @@ -1855,6 +1854,7 @@ task copyInstall4jTemplate { } } + // write install4j file install4jConfFile.text = XmlUtil.serialize(install4jConfigXml) } @@ -1941,7 +1941,6 @@ task installers(type: com.install4j.gradle.Install4jTask) { 'WINDOWS_ICONS_FILE': install4jWindowsIconsFile, 'PNG_ICON_FILE': install4jPngIconFile, 'BACKGROUND': install4jBackground, - ] //println("INSTALL4J VARIABLES:") @@ -1995,7 +1994,6 @@ task sourceDist(type: Tar) { dependsOn createBuildProperties dependsOn convertMdFiles - def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_") def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz" archiveFileName = outputFileName @@ -2081,7 +2079,6 @@ task sourceDist(type: Tar) { // exclude(EXCLUDE_FILES) // exclude(PROCESS_FILES) // } - from(file(buildProperties).getParent()) { include(file(buildProperties).getName()) rename(file(buildProperties).getName(), "build_properties") @@ -2089,7 +2086,6 @@ task sourceDist(type: Tar) { line.replaceAll("^INSTALLATION=.*\$","INSTALLATION=Source Release"+" git-commit\\\\:"+gitHash+" ["+gitBranch+"]") }) } - } @@ -2134,8 +2130,6 @@ task jalviewjsEnableAltFileProperty(type: WriteProperties) { property(jalviewjs_j2s_alt_file_property_config, jalviewjs_j2s_alt_file_property) } } - - task jalviewjsSetEclipseWorkspace { def propKey = "jalviewjs_eclipse_workspace" def propVal = null @@ -2399,10 +2393,8 @@ task jalviewjsSyncAllLibs (type: Sync) { preserve { include "**" } - // should this be exclude really ? duplicatesStrategy "INCLUDE" - outputs.files outputFiles inputs.files inputFiles }