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 {
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 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
}