From: Ben Soares Date: Sun, 10 Nov 2019 16:06:50 +0000 (+0000) Subject: JAL-3210 _jalview core published, added to jalviewjsTest.html X-Git-Tag: Release_2_11_4_0~45^2~18^2~67 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d74c7a4abda9d65eec1b2e1b2a8012dce4967210;p=jalview.git JAL-3210 _jalview core published, added to jalviewjsTest.html --- diff --git a/build.gradle b/build.gradle index a56cd4c..9798062 100644 --- a/build.gradle +++ b/build.gradle @@ -1807,6 +1807,8 @@ def jalviewjsCallCore(FileCollection list, String prefixFile, String suffixFile, } +def jalviewjsJalviewTemplateName = "JalviewJS" +def jalviewjsJalviewCoreName = "_jalview" task jalviewjsNoTranspileBuildAllCores { dependsOn jalviewjsSitePath dependsOn jalviewjsTransferUnzipSwingJs @@ -1833,7 +1835,7 @@ task jalviewjsNoTranspileBuildAllCores { // _jmol and _jalview cores. Add any other peculiar classlist.txt files here classlistFiles += [ 'file': file("${jalviewDir}/${jalviewjs_classlist_jmol}"), 'name': "_jvjmol" ] - classlistFiles += [ 'file': file("${jalviewDir}/${jalviewjs_classlist_jalview}"), 'name': "_jalview" ] + classlistFiles += [ 'file': file("${jalviewDir}/${jalviewjs_classlist_jalview}"), 'name': jalviewjsJalviewCoreName ] def classlists = [] @@ -1908,30 +1910,27 @@ task jalviewjsBuildAllCores { } +def jalviewjsJalviewCoreHtmlFile task jalviewjsPublishCoreTemplate(type: Sync) { dependsOn jalviewjsSitePath dependsOn jalviewjsBuildAllCores -// clean this up def inputFile = file("${jalviewDir}/${j2s_template_html}") def outputDir = "${jalviewDir}/${jalviewjsTransferSiteCoreDir}" -// clean this up - def jalviewTemplateName = "JalviewJS" - def jalviewCoreName = "_jalview" - from inputFile into outputDir def outputFiles = [] + jalviewjsJalviewCoreHtmlFile = "${jalviewjsJalviewTemplateName}_${jalviewjsJalviewCoreName}.html" rename { filename -> outputFiles += "${outputDir}/${filename}" if (filename.equals(inputFile.getName())) { - return "${jalviewTemplateName}_${jalviewCoreName}.html" + return jalviewjsJalviewCoreHtmlFile } return null } - filter(ReplaceTokens, beginToken: '_', endToken: '_', tokens: ['MAIN': mainClass, 'CODE': "null", 'NAME': jalviewTemplateName]) - filter(ReplaceTokens, beginToken: '', endToken: '', tokens: ['NONE': "\"${jalviewCoreName}\""]) + filter(ReplaceTokens, beginToken: '_', endToken: '_', tokens: ['MAIN': '"'+mainClass+'"', 'CODE': "null", 'NAME': jalviewjsJalviewTemplateName]) + filter(ReplaceTokens, beginToken: '', endToken: '', tokens: ['NONE': jalviewjsJalviewCoreName]) preserve { include "**" } @@ -2070,19 +2069,23 @@ task jalviewjsServer { def start = port def running = false def url + def urlcore while(port < start+1000 && !running) { try { def doc_root = new File("${jalviewDirAbsolutePath}/${jalviewjsSiteDir}") def jalviewjsServer = factory.start(doc_root, port) running = true url = jalviewjsServer.getResourceUrl(jalviewjs_server_resource) + urlcore = jalviewjsServer.getResourceUrl(jalviewjsJalviewCoreHtmlFile) println("SERVER STARTED with document root ${doc_root}.") println("Go to "+url+" . Run gradle --stop to stop (kills all gradle daemons).") println("For debug: "+url+"?j2sdebug") + println("For core: "+urlcore) file(htmlFile).text = """ -

Jalview JS Test. <${url}>

-

Jalview JS Test with debug. <${url}?j2sdebug<

+

JalviewJS Test. <${url}>

+

JalviewJS Test with debug. <${url}?j2sdebug<

+

${jalviewjsJalviewTemplateName} Core Test. <${urlcore}>

""" } catch (Exception e) {