JAL-3521 Adding a build_properties into sourceDist tarball, with INSTALLATION=SourceD...
[jalview.git] / build.gradle
index 5281bb1..3bf1649 100644 (file)
@@ -94,7 +94,7 @@ ext {
   }
   ////
   // Set JALVIEW_VERSION if it is not already set
-  if (findProperty(JALVIEW_VERSION)==null || "".equals(JALVIEW_VERSION)) {
+  if (findProperty("JALVIEW_VERSION")==null || "".equals(JALVIEW_VERSION)) {
     JALVIEW_VERSION = releaseProps.get("jalview.version")
   }
   
@@ -1377,6 +1377,10 @@ task getdownWebsite() {
     //getdownTextString += "class = " + file(getdownLauncher).getName() + "\n"
     getdownTextString += "resource = ${getdown_launcher_new}\n"
     getdownTextString += "class = ${main_class}\n"
+    /* NOT setting these properties so that getdownappbase and getdowndistdir will default to release version
+     * getdownTextString += "jvmarg = -Dgetdowndistdir=${getdownAppDistDir}\n"
+     * getdownTextString += "jvmarg = -Dgetdownappbase=${getdownAppBase}\n"
+     */
 
     def getdown_txt = file("${getdownWebsiteDir}/getdown.txt")
     getdown_txt.write(getdownTextString)
@@ -1403,7 +1407,7 @@ task getdownWebsite() {
       copy {
         from getdown_txt
         from getdownLauncher
-        from "${getdownWebsiteDir}/${getdown_build_properties}"
+        from "${getdownAppDir}/${getdown_build_properties}"
         if (file(getdownLauncher).getName() != getdown_launcher) {
           rename(file(getdownLauncher).getName(), getdown_launcher)
         }
@@ -1700,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"
@@ -1791,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+"]")
+    })
+  }
+
 }