git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fb51c05
)
JAL-3299 Fixed gitHash and gitBranch definitions in build.gradle
author
Ben Soares
<bsoares@dundee.ac.uk>
Wed, 12 Jun 2019 14:58:04 +0000
(15:58 +0100)
committer
Ben Soares
<bsoares@dundee.ac.uk>
Wed, 12 Jun 2019 14:58:04 +0000
(15:58 +0100)
build.gradle
patch
|
blob
|
history
diff --git
a/build.gradle
b/build.gradle
index
9fbcd38
..
0ae4e5c
100644
(file)
--- a/
build.gradle
+++ b/
build.gradle
@@
-417,32
+417,29
@@
def getDate(format) {
return date.format(format)
}
return date.format(format)
}
-task setGitHash(type: Exec) {
- workingDir = jalviewDir
- commandLine "git", "rev-parse", "--short", "HEAD"
- standardOutput = new ByteArrayOutputStream()
- project.ext.gitHash = {
- return standardOutput.toString().trim()
+task setGitVals {
+ def hashStdOut = new ByteArrayOutputStream()
+ exec {
+ commandLine "git", "rev-parse", "--short", "HEAD"
+ standardOutput = hashStdOut
}
}
-}
-task setGitBranch(type: Exec) {
- workingDir = jalviewDir
- commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
- standardOutput = new ByteArrayOutputStream()
- project.ext.gitBranch = {
- return standardOutput.toString().trim()
+ def branchStdOut = new ByteArrayOutputStream()
+ exec {
+ commandLine "git", "rev-parse", "--abbrev-ref", "HEAD"
+ standardOutput = branchStdOut
}
}
-}
-task setGitVals {
- dependsOn setGitHash
- dependsOn setGitBranch
+ project.ext.gitHash = hashStdOut.toString().trim()
+ project.ext.gitBranch = branchStdOut.toString().trim()
+
+ outputs.upToDateWhen { false }
}
task createBuildProperties(type: WriteProperties) {
dependsOn setGitVals
inputs.dir("$jalviewDir/$sourceDir")
}
task createBuildProperties(type: WriteProperties) {
dependsOn setGitVals
inputs.dir("$jalviewDir/$sourceDir")
+ inputs.dir("$classes")
inputs.dir("$jalviewDir/$resourceDir")
outputFile "$classes/$buildPropertiesFile"
// taking time specific comment out to allow better incremental builds
inputs.dir("$jalviewDir/$resourceDir")
outputFile "$classes/$buildPropertiesFile"
// taking time specific comment out to allow better incremental builds
@@
-452,7
+449,6
@@
task createBuildProperties(type: WriteProperties) {
property "VERSION", JALVIEW_VERSION
property "INSTALLATION", INSTALLATION+" git-commit:"+project.ext.gitHash+" ["+project.ext.gitBranch+"]"
outputs.file(outputFile)
property "VERSION", JALVIEW_VERSION
property "INSTALLATION", INSTALLATION+" git-commit:"+project.ext.gitHash+" ["+project.ext.gitBranch+"]"
outputs.file(outputFile)
- outputs.dir("$classes")
}
def buildingHTML = "$jalviewDir/$docDir/building.html"
}
def buildingHTML = "$jalviewDir/$docDir/building.html"