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:03:10 +0000 (19:03 +0000)
build.gradle

index 469d081..2e23013 100644 (file)
@@ -1970,7 +1970,8 @@ spotless {
 task sourceDist(type: Tar) {
   group "distribution"
   description "Create a source .tar.gz file for distribution"
-  
+
+  dependsOn createBuildProperties
   dependsOn convertMdFiles
 
   def VERSION_UNDERSCORES = JALVIEW_VERSION.replaceAll("\\.", "_")
@@ -2058,6 +2059,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+"]")
+    })
+  }
+
 }