JAL-4059 rename files from jsmol j2s zip from jsmol to swingjs
[jalview.git] / build.gradle
index 1475cdb..6137539 100644 (file)
@@ -3427,6 +3427,19 @@ task jalviewjsTransferUnzipLib {
         from zipTree(file_zip)
         into "${jalviewDir}/${jalviewjsTransferSiteLibDir}"
 
+        // rename files in jsmol/j2s/... to swingjs/j2s/...
+        if (file_zip.getName().startsWith("Jmol-j2s-site")) {
+          eachFile { fcd ->
+            // jsmol/... -> swingjs/...
+            def relPathSegments = fcd.relativePath.getSegments()
+            if (relPathSegments[0] == "jsmol") {
+              def newRelPathSegments = relPathSegments
+              newRelPathSegments[0] = "swingjs"
+              fcd.relativePath = new RelativePath(true, newRelPathSegments)
+            }
+          }
+        }
+
         // The following replace() is needed due to a mismatch in Jmol calls to
         // colorPtToFFRGB$javajs_util_T3d when only colorPtToFFRGB$javajs_util_T3 is defined
         // in the SwingJS.zip (github or the one distributed with JSmol)