JAL-3521 Adding a build_properties into sourceDist tarball, with INSTALLATION=SourceD...
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 8 Feb 2021 19:00:18 +0000 (19:00 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 8 Feb 2021 19:00:18 +0000 (19:00 +0000)
build.gradle

index b2e9af1..3bf1649 100644 (file)
@@ -1704,6 +1704,7 @@ task installers(type: com.install4j.gradle.Install4jTask) {
 
 
 task sourceDist(type: Tar) {
+  dependsOn createBuildProperties
   
   def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
   def outputFileName = "${project.name}_${VERSION_UNDERSCORES}.tar.gz"
@@ -1795,6 +1796,15 @@ task sourceDist(type: Tar) {
 //    exclude(EXCLUDE_FILES)
 //    exclude(PROCESS_FILES)
 //  }
+
+  from(file(buildProperties).getParent()) {
+    include(file(buildProperties).getName())
+    rename(file(buildProperties).getName(), "build_properties")
+    filter({ line ->
+      line.replaceAll("^INSTALLATION=.*\$","INSTALLATION=SourceDist"+" git-commit\\\\:"+gitHash+" ["+gitBranch+"]")
+    })
+  }
+
 }