JAL-3337 rejig the source distribution generation to process and replace tokens in...
authorJim Procter <jprocter@issues.jalview.org>
Thu, 4 Jul 2019 14:51:28 +0000 (15:51 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 4 Jul 2019 14:51:28 +0000 (15:51 +0100)
build.gradle

index 383e189..c24c020 100644 (file)
@@ -1174,38 +1174,55 @@ task sourceDist (type: Tar) {
   
   compression Compression.GZIP
   
-  from jalviewDir
   into project.name
-   
-  exclude (".*")
-  exclude ("**/.*")
-  exclude ("*.class")
-  exclude ("**/*.class")
-  include (eclipse_extra_jdt_prefs_file)
-  include ("AUTHORS")
-  include ("CITATION")
-  include ("FEATURETODO")
-  include ("JAVA-11-README")
-  include ("FEATURETODO")
-  include ("LICENSE")
-  include ("README")
-  include ("RELEASE")
-  include ("THIRDPARTYLIBS")
-  include ("build.gradle")
-  include ("gradle.properties")
-  include ("$sourceDir/*.java")
-  include ("$sourceDir/**/*.java")
-  include ("$sourceDir/**/*.cdr")
-  include ("$j8libDir/**/*.jar")
-  include ("$j11libDir/**/*.jar")
-  include ("$resourceDir/**/*")
-  include ("$helpDir/**/*")
-  include ("$schemaDir/**/*")
-  include ("$utilsDir/**/*")
-  include ("$docDir/**/*")
-  include ("$examplesDir/**/*")
-  include ("getdown/**/*")
+
+  def EXCLUDE_FILES=["bin/*","test-*","clover*/*"
+  ,".*"
+  ,"**/.*"
+  ,"*.class"
+  ,"**/*.class","$j11modDir/**/*.jar","appletlib","**/*locales"
+  ,"*locales/**",
+  ,"utils/InstallAnywhere"] 
+  def PROCESS_FILES=[   "AUTHORS",
+  "CITATION",
+  "FEATURETODO",
+  "JAVA-11-README",
+  "FEATURETODO",
+  "LICENSE",
+  "README",
+  "RELEASE",
+  "THIRDPARTYLIBS",
+  "build.gradle",
+  "gradle.properties",
+  "**/*.java",
+  "**/*.html",
+  "**/*.xml",
+  "**/*.gradle",
+  "**/*.groovy",
+  "**/*.properties",
+  "**/*.perl",
+  "**/*.sh"]
+
+  from(jalviewDir) {
+    exclude (EXCLUDE_FILES)
+    include (PROCESS_FILES)
+    filter(ReplaceTokens, beginToken: '$$', endToken: '$$', tokens: ['Version-Rel': JALVIEW_VERSION,'Year-Rel': getDate("yyyy")])
+  }
+  from(jalviewDir) {
+    exclude (EXCLUDE_FILES)
+    exclude (PROCESS_FILES)
+    include (eclipse_extra_jdt_prefs_file)
+    include ("$schemaDir/**/*")
+    include ("$utilsDir/**/*")
+    include ("$docDir/**/*")
+    include ("$examplesDir/**/*")
+    include ("getdown/**/*")
+  
+    include ("$sourceDir/**/*.cdr")
+    include ("$j8libDir/**/*.jar")
+    include ("$j11libDir/**/*.jar")
+    include ("$resourceDir/**/*")
+  
   //include ("jalview-jalopy.xml")
   //include ("JalviewApplet.jpx")
   //include ("JalviewX.jpx")
@@ -1214,6 +1231,9 @@ task sourceDist (type: Tar) {
   //include ("nbproject/project.properties")
   //include ("nbproject/project.xml")
   
+  include ("$helpDir/**/*")
+  exclude ("$helpDir/**/*.html")
+
   exclude ("appletlib")
   exclude ("**/*locales")
   exclude ("*locales/**")
@@ -1224,7 +1244,7 @@ task sourceDist (type: Tar) {
 
   // exluding these as not using jars as modules yet
   exclude ("$j11modDir/**/*.jar")
-
+}
 }
 
 task helppages  {