+/* Convention for properties. Read from gradle.properties, use lower_case_underlines for property names.
+ * For properties set within build.gradle, use camelCaseNoSpace.
+ */
import org.apache.tools.ant.filters.ReplaceTokens
import org.gradle.internal.os.OperatingSystem
import org.gradle.plugins.ide.internal.generator.PropertiesPersistableConfigurationObject
id 'com.github.johnrengelman.shadow' version '4.0.3'
id 'com.install4j.gradle' version '8.0.4'
id 'com.dorongold.task-tree' version '1.5' // only needed to display task dependency tree with gradle task1 [task2 ...] taskTree
+ id 'com.palantir.git-version' version '0.12.3'
}
repositories {
cloverBuildDir = "${buildDir}/clover"
cloverInstrDir = file("${cloverBuildDir}/clover-instr")
cloverClassesDir = file("${cloverBuildDir}/clover-classes")
- cloverReportDir = file("${buildDir}/reports")
+ cloverReportDir = file("${buildDir}/reports/clover")
cloverTestInstrDir = file("${cloverBuildDir}/clover-test-instr")
cloverTestClassesDir = file("${cloverBuildDir}/clover-test-classes")
//cloverTestClassesDir = cloverClassesDir
modules_compileClasspath = fileTree(dir: "${jalviewDir}/${j11modDir}", include: ["*.jar"])
modules_runtimeClasspath = modules_compileClasspath
*/
- gitHash = string("")
- gitBranch = string("")
+ def details = versionDetails()
+ gitHash = details.gitHash
+ gitBranch = details.branchName
println("Using a ${CHANNEL} profile.")
task cleanClover {
doFirst {
delete cloverBuildDir
+ delete cloverReportDir
}
}
file(cloverDb).exists()
}
- def cloverHtmlDir = "${cloverReportDir}/clover"
+ def cloverHtmlDir = cloverReportDir
inputs.dir cloverClassesDir
outputs.dir cloverHtmlDir
}
-task setGitVals {
- def hashStdOut = new ByteArrayOutputStream()
- exec {
- commandLine "git", "rev-parse", "--short", "HEAD"
- standardOutput = hashStdOut
- ignoreExitValue true
- }
-
- def branchStdOut = new ByteArrayOutputStream()
- exec {
- commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
- standardOutput = branchStdOut
- ignoreExitValue true
- }
-
- gitHash = hashStdOut.toString().trim()
- gitBranch = branchStdOut.toString().trim()
-
- outputs.upToDateWhen { false }
-}
-
-
task createBuildProperties(type: WriteProperties) {
group = "build"
description = "Create the ${buildProperties} file"
- dependsOn setGitVals
inputs.dir(sourceDir)
inputs.dir(resourceDir)
file(buildProperties).getParentFile().mkdirs()
task syncDocs(type: Sync) {
- dependsOn convertBuildingMD
+ //dependsOn convertBuildingMD
def syncDir = "${classesDir}/${doc_dir}"
from fileTree("${jalviewDir}/${doc_dir}")
into syncDir
shadowJar {
group = "distribution"
+ description = "Create a single jar file with all dependency libraries merged. Can be run with java -jar"
if (buildDist) {
dependsOn makeDist
}
task installers(type: com.install4j.gradle.Install4jTask) {
group = "distribution"
description = "Create the install4j installers"
- dependsOn setGitVals
dependsOn getdown
dependsOn copyInstall4jTemplate
task sourceDist(type: Tar) {
+ group "distribution"
+ description "Create a source .tar.gz file for distribution"
+ dependsOn convertBuildingMD
+
def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz"
// cater for buildship < 3.1 [3.0.1 is max version in eclipse 2018-09]
description "Sync libs and resources to site dir, but not closure cores"
dependsOn jalviewjsIDE_SyncSiteAll
- dependsOn cleanJalviewjsTransferSite
+ //dependsOn cleanJalviewjsTransferSite // not sure why this clean is here -- will slow down a re-run of this task
}