install4jHomeDir = System.getProperty("user.home") + install4jHomeDir.substring(1)
}
- resourceBuildDir = string("${buildDir}/resource")
- resourcesBuildDir = string("${resourceBuildDir}/resources")
- helpBuildDir = string("${resourceBuildDir}/${help_dir}")
- docBuildDir = string("${resourceBuildDir}/${doc_dir}")
+ resourceBuildDir = string("${buildDir}/resources")
+ resourcesBuildDir = string("${resourceBuildDir}/resources_build")
+ helpBuildDir = string("${resourceBuildDir}/help_build")
+ docBuildDir = string("${resourceBuildDir}/doc_build")
buildProperties = string("${resourcesBuildDir}/${build_properties_file}")
buildingHTML = string("${jalviewDir}/${doc_dir}/building.html")
helpParentDir = string("${jalviewDir}/${help_parent_dir}")
helpSourceDir = string("${helpParentDir}/${help_dir}")
- helpFile = string("${helpBuildDir}/help.jhm")
+ helpFile = string("${helpBuildDir}/${help_dir}/help.jhm")
relativeBuildDir = file(jalviewDirAbsolutePath).toPath().relativize(buildDir.toPath())
}
resources {
- srcDirs resourcesBuildDir
+ srcDirs = [ resourcesBuildDir, docBuildDir, helpBuildDir ]
}
compileClasspath = files(sourceSets.main.java.outputDir)
compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
runtimeClasspath = compileClasspath
+ runtimeClasspath += files(sourceSets.main.resources.srcDirs)
}
clover {
compileClasspath += fileTree(dir: "${jalviewDir}/${utils_dir}/testnglibs", include: ["**/*.jar"])
runtimeClasspath = compileClasspath
+ runtimeClasspath += files(sourceSets.test.resources.srcDirs)
}
}
}
-clean {
- doFirst {
- delete buildProperties
- }
-}
-
-
-task cleanBuildingHTML(type: Delete) {
- doFirst {
- delete buildingHTML
- }
-}
-
-
def convertMdToHtml (FileTree mdFiles, File cssFile) {
MutableDataSet options = new MutableDataSet()
}
+task copyDocs(type: Copy) {
+ def inputDir = "${jalviewDir}/${doc_dir}"
+ def outputDir = "${docBuildDir}/${doc_dir}"
+ from(inputDir) {
+ exclude '**/*.gif'
+ exclude '**/*.jpg'
+ exclude '**/*.png'
+ filter(ReplaceTokens,
+ beginToken: '$$',
+ endToken: '$$',
+ tokens: [
+ 'Version-Rel': JALVIEW_VERSION,
+ 'Year-Rel': getDate("yyyy")
+ ]
+ )
+ }
+ from(inputDir) {
+ include '**/*.gif'
+ include '**/*.jpg'
+ include '**/*.png'
+ }
+ into outputDir
+
+ inputs.dir(inputDir)
+ outputs.files(helpFile)
+ outputs.dir(outputDir)
+}
+
+
task convertMdFiles {
- dependsOn cleanBuildingHTML
- def mdFiles = fileTree(dir: "${jalviewDir}/${doc_dir}", include: "*.md")
+ dependsOn copyDocs
+ def mdFiles = fileTree(dir: docBuildDir, include: "*.md")
def cssFile = file("${jalviewDir}/${flexmark_css}")
doLast {
}
-task copyDocs(type: Copy) {
- dependsOn convertMdFiles
- def syncDir = "${docBuildDir}"
- from ("${jalviewDir}/${doc_dir}") {
- exclude '**/*.gif'
- exclude '**/*.jpg'
- exclude '**/*.png'
- filter(ReplaceTokens,
- beginToken: '$$',
- endToken: '$$',
- tokens: [
- 'Version-Rel': JALVIEW_VERSION,
- 'Year-Rel': getDate("yyyy")
- ]
- )
- }
- into syncDir
-}
-
-
task copyHelp(type: Copy) {
def inputDir = helpSourceDir
- def outputDir = "${helpBuildDir}"
+ def outputDir = "${helpBuildDir}/${help_dir}"
from(inputDir) {
exclude '**/*.gif'
exclude '**/*.jpg'
task copyResources(type: Copy) {
- from(resourceDir) {
+ def inputDir = resourceDir
+ def outputDir = resourcesBuildDir
+ from(inputDir) {
+ exclude '**/*.gif'
+ exclude '**/*.jpg'
+ exclude '**/*.png'
filter(ReplaceTokens,
beginToken: '$$',
endToken: '$$',
]
)
}
- include "**/*.*"
- into "${resourcesBuildDir}"
- //preserve {
- // include "**"
- //}
+ from(inputDir) {
+ include '**/*.gif'
+ include '**/*.jpg'
+ include '**/*.png'
+ }
+ into outputDir
+
+ inputs.dir(inputDir)
+ outputs.dir(outputDir)
}
inputs.dir(sourceDir)
inputs.dir(resourcesBuildDir)
-//println("MKDIRS "+file(buildProperties).getParentFile().toString())
-// doFirst {
-// file(buildProperties).getParentFile().mkdirs()
-// }
outputFile (buildProperties)
// taking time specific comment out to allow better incremental builds
comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd HH:mm:ss")
dependsOn copyResources
dependsOn copyDocs
dependsOn copyHelp
+ dependsOn createBuildProperties
+ dependsOn convertMdFiles
}
-jar.dependsOn prepare
+
+
+compileJava.dependsOn prepare
+run.dependsOn compileJava
+//run.dependsOn prepare
//testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
test {
dependsOn prepare
- //dependsOn compileJava ////? DELETE
if (useClover) {
dependsOn cloverClasses
} else { //?
- dependsOn compileJava //?
+ dependsOn compileJava //?
}
useTestNG() {
maxHeapSize = "1024m"
workingDir = jalviewDir
- //systemProperties 'clover.jar' System.properties.clover.jar
def testLaf = project.findProperty("test_laf")
if (testLaf != null) {
println("Setting Test LaF to '${testLaf}'")
dependsOn copyHelp
classpath = sourceSets.main.compileClasspath
main = "com.sun.java.help.search.Indexer"
- workingDir = "${helpBuildDir}"
+ workingDir = "${helpBuildDir}/${help_dir}"
def argDir = "html"
args = [ argDir ]
inputs.dir("${workingDir}/${argDir}")
classpath = files("${jalviewDir}/${utils_dir}")
main = "HelpLinksChecker"
workingDir = jalviewDir
- def helpBuildDir = "${helpBuildDir}"
- args = [ helpBuildDir, "-nointernet" ]
+ args = [ "${helpBuildDir}/${help_dir}", "-nointernet" ]
def outFOS = new FileOutputStream(helpLinksCheckerOutFile, false) // false == don't append
def errFOS = outFOS
outputs.file(helpLinksCheckerOutFile)
}
+
// import the pubhtmlhelp target
ant.properties.basedir = "${jalviewDir}"
-ant.properties.helpBuildDir = "${jalviewDirAbsolutePath}/${helpBuildDir}"
+ant.properties.helpBuildDir = "${helpBuildDir}/${help_dir}"
ant.importBuild "${utils_dir}/publishHelp.xml"
dependsOn linkCheck
dependsOn buildIndices
dependsOn createBuildProperties
+ dependsOn prepare
manifest {
attributes "Main-Class": main_class,
exclude "**/*.jar"
exclude "**/*.jar.*"
- inputs.dir(classesDir)
- outputs.file("${jalviewDir}/${package_dir}/${archiveFileName}")
+ inputs.dir(sourceSets.main.java.outputDir)
+ sourceSets.main.resources.srcDirs.each{ dir ->
+ inputs.dir(dir)
+ }
+ outputs.file("${destinationDirectory}/${archiveFileName}")
}
dependsOn clean
}
+
shadowJar {
group = "distribution"
description = "Create a single jar file with all dependency libraries merged. Can be run with java -jar"
dependsOn copyHelp
dependsOn pubhtmlhelp
- inputs.dir("${helpBuildDir}")
+ inputs.dir("${helpBuildDir}/${help_dir}")
outputs.dir("${buildDir}/distributions/${help_dir}")
}