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
}
-
// 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
// datestamp
buildDate = new Date().format("yyyyMMdd")
-
// essentials
bareSourceDir = string(source_dir)
sourceDir = string("${jalviewDir}/${bareSourceDir}")
//cloverTestClassesDir = cloverClassesDir
cloverDb = string("${cloverBuildDir}/clover.db")
+
testSourceDir = useClover ? cloverTestInstrDir : testDir
testClassesDir = useClover ? cloverTestClassesDir : "${jalviewDir}/${test_output_dir}"
helpBuildDir = string("${resourceBuildDir}/help_build")
docBuildDir = string("${resourceBuildDir}/doc_build")
+
if (buildProperties == null) {
buildProperties = string("${resourcesBuildDir}/${build_properties_file}")
}
srcDirs = [ resourcesBuildDir, docBuildDir, helpBuildDir ]
}
+
compileClasspath = files(sourceSets.main.java.outputDir)
compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
def htmlFilePath = mdFile.getPath().replaceAll(/\..*?$/, ".html")
htmlFiles.add(file(htmlFilePath))
}
+
outputs.files(htmlFiles)
}
outputs.file(outputFile)
}
-
task buildIndices(type: JavaExec) {
dependsOn copyHelp
classpath = sourceSets.main.compileClasspath
dependsOn createBuildProperties
}
+
task prepare {
dependsOn buildResources
dependsOn copyDocs
compileJava.dependsOn prepare
run.dependsOn compileJava
//run.dependsOn prepare
-
-
//testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
test {
dependsOn prepare
}
+
+
task compileLinkCheck(type: JavaCompile) {
options.fork = true
classpath = files("${jalviewDir}/${utils_dir}")
outputs.file(helpLinksCheckerOutFile)
}
-
// import the pubhtmlhelp target
ant.properties.basedir = "${jalviewDir}"
ant.properties.helpBuildDir = "${helpBuildDir}/${help_dir}"
archiveFileName = rootProject.name+".jar"
duplicatesStrategy "EXCLUDE"
-
exclude "cache*/**"
exclude "*.jar"
exclude "*.jar.*"
dependsOn clean
}
-
shadowJar {
group = "distribution"
description = "Create a single jar file with all dependency libraries merged. Can be run with java -jar"
attributes "Implementation-Version": JALVIEW_VERSION,
"Application-Name": install4jApplicationName
}
-
duplicatesStrategy "INCLUDE"
-
mainClassName = shadow_jar_main_class
mergeServiceFiles()
classifier = "all-"+JALVIEW_VERSION+"-j"+JAVA_VERSION
}
}
+
// write install4j file
install4jConfFile.text = XmlUtil.serialize(install4jConfigXml)
}
'WINDOWS_ICONS_FILE': install4jWindowsIconsFile,
'PNG_ICON_FILE': install4jPngIconFile,
'BACKGROUND': install4jBackground,
-
]
//println("INSTALL4J VARIABLES:")
dependsOn createBuildProperties
dependsOn convertMdFiles
-
def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz"
archiveFileName = outputFileName
// exclude(EXCLUDE_FILES)
// exclude(PROCESS_FILES)
// }
-
from(file(buildProperties).getParent()) {
include(file(buildProperties).getName())
rename(file(buildProperties).getName(), "build_properties")
line.replaceAll("^INSTALLATION=.*\$","INSTALLATION=Source Release"+" git-commit\\\\:"+gitHash+" ["+gitBranch+"]")
})
}
-
}
property(jalviewjs_j2s_alt_file_property_config, jalviewjs_j2s_alt_file_property)
}
}
-
-
task jalviewjsSetEclipseWorkspace {
def propKey = "jalviewjs_eclipse_workspace"
def propVal = null
preserve {
include "**"
}
-
// should this be exclude really ?
duplicatesStrategy "INCLUDE"
-
outputs.files outputFiles
inputs.files inputFiles
}