From fb616bbaa70ca0f8bbae7e076f3c403a737205a9 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 8 Nov 2019 10:20:19 +0000 Subject: [PATCH] Revert "JAL-3210 work in progress on closures" This reverts commit 581fcc0aab400bcdd52f5c0ec64f34a8fd5e786a. Seems to have broken development in Eclipse IDE. Reverting. --- build.gradle | 123 ++------------------ .../classlists => classlists}/jalview.txt | 0 .../classlists => classlists}/jvexamplefile.txt | 0 gradle.properties | 4 - 4 files changed, 10 insertions(+), 117 deletions(-) rename {utils/jalviewjs/classlists => classlists}/jalview.txt (100%) rename {utils/jalviewjs/classlists => classlists}/jvexamplefile.txt (100%) diff --git a/build.gradle b/build.gradle index a88c42f..535f3b9 100644 --- a/build.gradle +++ b/build.gradle @@ -1274,16 +1274,14 @@ task helppages { def jalviewjsBuildDir def jalviewjsSiteDir -def jalviewjsTransferSiteJsDir +def jalviewjsTransferSiteJSDir def jalviewjsTransferSiteLibDir -def jalviewjsTransferSiteCoreDir task jalviewjsSitePath { def relativeBuildDir = file(jalviewDirAbsolutePath).toPath().relativize(buildDir.toPath()) jalviewjsBuildDir = "${relativeBuildDir}/jalviewjs" jalviewjsSiteDir = "${jalviewjsBuildDir}/${jalviewjs_site_dir}" - jalviewjsTransferSiteJsDir = "${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_js" + jalviewjsTransferSiteJSDir = "${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_js" jalviewjsTransferSiteLibDir = "${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_lib" - jalviewjsTransferSiteCoreDir = "${jalviewjsBuildDir}/tmp/${jalviewjs_site_dir}_core" } def eclipseWorkspace @@ -1496,14 +1494,14 @@ task jalviewjsCreateJ2sSettings(type: WriteProperties) { if (val != null) { if (prop == siteDirProperty) { if (!(val.startsWith('/') || val.startsWith("file://") )) { - val = "${jalviewDir}/${jalviewjsTransferSiteJsDir}/${val}" + val = "${jalviewDir}/${jalviewjsTransferSiteJSDir}/${val}" } setSiteDir = true } property(prop,val) } if (!setSiteDir) { // default site location, don't override specifically set property - property(siteDirProperty,"${jalviewDir}/${jalviewjsTransferSiteJsDir}") + property(siteDirProperty,"${jalviewDir}/${jalviewjsTransferSiteJSDir}") } } inputs.properties(j2s_props) @@ -1536,26 +1534,6 @@ task jalviewjsSyncLib (type: Sync) { inputs.files inputFiles } -task jalviewjsSyncCore (type: Sync) { - dependsOn jalviewjsSitePath - dependsOn "jalviewjsBuildAllCores" - def inputFiles = fileTree(dir: "${jalviewDir}/${jalviewjsTransferSiteCoreDir}") - def outputDir = "${jalviewDir}/${jalviewjsSiteDir}" - - from inputFiles - into outputDir - def outputFiles = [] - rename { filename -> - outputFiles += "${outputDir}/${filename}" - null - } - preserve { - include "**" - } - outputs.files outputFiles - inputs.files inputFiles -} - task jalviewjsSyncResources (type: Sync) { dependsOn jalviewjsSitePath def inputFiles = fileTree(dir: "${jalviewDir}/${resourceDir}") @@ -1696,20 +1674,20 @@ DEBUG: ${eclipseDebug} } inputs.dir("${jalviewDir}/${sourceDir}") - outputs.dir("${jalviewDir}/${jalviewjsTransferSiteJsDir}") - outputs.upToDateWhen( { file("${jalviewDir}/${jalviewjsTransferSiteJsDir}${jalviewjs_server_resource}").exists() } ) + outputs.dir("${jalviewDir}/${jalviewjsTransferSiteJSDir}") + outputs.upToDateWhen( { file("${jalviewDir}/${jalviewjsTransferSiteJSDir}${jalviewjs_server_resource}").exists() } ) } // this Copy version of TransferSite will delete anything else in the target dir task jalviewjsCopyTransferSite(type: Copy) { dependsOn jalviewjsTranspile - from "${jalviewDir}/${jalviewjsTransferSiteJsDir}" + from "${jalviewDir}/${jalviewjsTransferSiteJSDir}" into "${jalviewDir}/${jalviewjsSiteDir}" } // this Sync version of TransferSite is used by buildship to keep the website automatically up to date when a file changes task jalviewjsSyncTransferSite(type: Sync) { - from "${jalviewDir}/${jalviewjsTransferSiteJsDir}" + from "${jalviewDir}/${jalviewjsTransferSiteJSDir}" include "**/*.*" into "${jalviewDir}/${jalviewjsSiteDir}" preserve { @@ -1745,7 +1723,7 @@ task jalviewjsBuildSite { task cleanJalviewjsSite { doFirst { - delete "${jalviewDir}/${jalviewjsTransferSiteJsDir}" + delete "${jalviewDir}/${jalviewjsTransferSiteJSDir}" delete "${jalviewDir}/${jalviewjsSiteDir}" } } @@ -1834,7 +1812,7 @@ task jalviewjs { task jalviewjsIDE_CopyTransferSite(type: Copy) { - from "${jalviewDir}/${jalviewjsTransferSiteJsDir}" + from "${jalviewDir}/${jalviewjsTransferSiteJSDir}" into "${jalviewDir}/${jalviewjsSiteDir}" } @@ -1874,84 +1852,3 @@ task eclipseAutoBuildTask { dependsOn jalviewjsSyncTransferSite dependsOn jalviewjsPrepareSite } - - - - - - - - -// closure -def jalviewjsCallCore(String name, FileCollection list, String jsDir, String outputDir) { - def coreFileName = "core${name}.js" - def coreFilePath = "${outputDir}/${coreFileName}" - def coreFile = file(coreFilePath) - println("...Generating ${coreFilePath}") - - def coreTop = file("${jsDir}/core/coretop2.js") - def coreBottom = file("${jsDir}/core/corebottom2.js") - coreFile.getParentFile().mkdirs() - coreFile.createNewFile() - coreFile.write( coreTop.text ) - list.each { - f -> - if (f.exists()) { - def t = f.text - t.replaceAll("Clazz\\.","Clazz_") - t.replaceAll("Class__","Clazz._") - coreFile.append( t ) - } else { - println("...file ${line} does not exist, skipping") - } - } - coreFile.append( coreBottom.text ) - - def coreZFileName = "core${name}.z.js" - def coreZFilePath = "${outputDir}/${coreZFileName}" - def coreZFile = file(coreZFilePath) - println("...Generating ${coreZFilePath}") - - javaexec { - classpath = files(["${jalviewDir}/tools/closure_compiler.jar"]) - args = [ "--js", coreFileName, "--js_output_file", coreZFileName ] - workingDir = outputDir - } - - return [ coreFile, coreZFile ] -} - -def jalviewjsToJs(String name, String classlist, String jsDir, String j2sDir, String outputDir) { - def filelist = [] - file(classlist).eachLine { - line -> - filelist += line - } - def list = fileTree(dir: j2sDir, includes: filelist) - /* - def list = files() - file(classlist).eachLine { - line -> - list += file("${j2sDir}/${line}") - } - */ - - return jalviewjsCallCore(name, list, jsDir, outputDir) -// publish-core-template ... here? -} - -task jalviewjsBuildAllCores { - group "JalviewJS" - description "Build the core js lib closures" - - dependsOn jalviewjsSitePath - dependsOn jalviewjsTransferUnzipLib - dependsOn jalviewjsTranspile - - fileTree(dir: "${jalviewDir}/${jalviewjs_classlists_dir}", include: "*.txt").each { - file -> - def name = file.getName() - ".txt" - - jalviewjsToJs(name, file.getAbsolutePath(), "${jalviewDir}/${jalviewjsTransferSiteLibDir}/${jalviewjs_js_subdir}", "${jalviewDir}/${jalviewjsTransferSiteJsDir}/${jalviewjs_j2s_subdir}", "${jalviewDir}/${jalviewjsTransferSiteCoreDir}/${jalviewjs_j2s_subdir}/core") - } -} diff --git a/utils/jalviewjs/classlists/jalview.txt b/classlists/jalview.txt similarity index 100% rename from utils/jalviewjs/classlists/jalview.txt rename to classlists/jalview.txt diff --git a/utils/jalviewjs/classlists/jvexamplefile.txt b/classlists/jvexamplefile.txt similarity index 100% rename from utils/jalviewjs/classlists/jvexamplefile.txt rename to classlists/jvexamplefile.txt diff --git a/gradle.properties b/gradle.properties index d602a9c..fe03c9c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -155,17 +155,13 @@ jalviewjs_swingjs_zip = swingjs/SwingJS-site.zip jalviewjs_j2s_plugin = swingjs/net.sf.j2s.core.jar jalviewjs_libjs_dir = utils/jalviewjs/libjs jalviewjs_site_resource_dir = utils/jalviewjs/site-resources -jalviewjs_classlists_dir = utils/jalviewjs/classlists jalviewjs_j2s_settings = .j2s #jalviewjs_eclipse_workspace = ~/tmp/eclipse-workspace # these 3 files/dirs found in build/jalviewjs jalviewjs_eclipse_tmp_dropins_dir = eclipse_dropins jalviewjs_eclipse_workspace_location_file = eclipse_workspace_location jalviewjs_site_dir = site -# these dirs are subdirs of the site dir -jalviewjs_swingjs_subdir = swingjs jalviewjs_j2s_subdir = swingjs/j2s -jalviewjs_js_subdir = swingjs/js #jalviewjs_eclipseBuildArg = build jalviewjs_eclipse_build_arg = cleanBuild jalviewjs_server_port = 9001 -- 1.7.10.2