}
cp.entries.removeAll(removeTheseToo)
- cp.entries += new Output("bin/main")
+ cp.entries += new Output(eclipse_bin_dir+"/main")
cp.entries += new Library(fileReference(helpParentDir))
cp.entries += new Library(fileReference(resourceDir))
task jalviewjsSetTempEclipseWorkspace {
tempEclipseWorkspace = file(jalviewjs_eclipse_workspace)
- if (!tempEclipseWorkspace.exists() && jalviewjs_eclipse_workspace.startsWith(File.separator)) {
+ if (!tempEclipseWorkspace.exists()) {
tempEclipseWorkspace = File.createTempDir()
- print("ECLIPSE WORKSPACE: "+tempEclipseWorkspace.getPath())
tempEclipseWorkspace.deleteOnExit()
}
+ println("ECLIPSE WORKSPACE: "+tempEclipseWorkspace.getPath())
}
task jalviewjsEclipseSetup {
inputs.files inputFiles
}
-task cleanJalviewjsSite {
- delete jalviewjs_site_dir
+task cleanJalviewjs {
+ delete jalviewDir+"/"+jalviewjs_site_dir
+ delete jalviewDir+"/"+eclipse_bin_dir
+ delete file(tempEclipseWorkspace.getAbsolutePath()+"/.metadata")
+ delete jalviewDir+"/"+jalviewjs_j2s_settings
}
task jalviewjsProjectImport(type: Exec) {
}
task jalviewjsTranspile(type: Exec) {
+ dependsOn jalviewjsCreateJ2sSettings
dependsOn jalviewjsProjectImport
dependsOn jalviewjsEclipsePaths
executable(eclipseBinary)
args(["-nosplash", "--launcher.suppressErrors", "-application", "org.eclipse.jdt.apt.core.aptBuild", "-data", tempEclipseWorkspace, "-"+jalviewjs_eclipseBuildArg, eclipse_project_name ])
+ inputs.dir(sourceDir)
+ outputs.dir(eclipse_bin_dir+"/main")
+ outputs.file(eclipse_bin_dir+"/main/jalview/bin/Jalview.class")
+ outputs.dir(jalviewjs_site_dir+"/"+jalviewjs_j2s_subdir)
}
task jalviewjsBuildSite {
compression Compression.GZIP
from jalviewjs_site_dir
- into jalviewjs_site_dir
+ into jalviewjs_site_dir // this is inside the tar file
inputs.dir(jalviewjs_site_dir)
}
task jalviewjs {
- dependsOn jalviewjsCreateJ2sSettings
dependsOn jalviewjsBuildSite
}
+task jalviewjsServer {
+ //dependsOn jalviewjsBuildSite
+
+ doLast {
+ SimpleHttpFileServerFactory factory = new SimpleHttpFileServerFactory()
+ def port = Integer.valueOf(jalviewjs_server_port)
+ def add = 0
+ def running = false
+ while(add < 1000) {
+ try {
+ HttpFileServer server = factory.start(new File(jalviewDirAbsolutePath+"/"+jalviewjs_site_dir), port)
+ running = true
+ } catch (Exception e) {
+ port++;
+ add++;
+ }
+ }
+ println("SERVER STARTED on http://localhost:"+port+"/ . Ctrc+C to kill it")
+ java.lang.Thread.sleep(Integer.valueOf(jalviewjs_server_wait)*1000);
+ }
+}
mainClass = jalview.bin.Jalview
launcherClass = jalview.bin.Jalview
eclipse_project_name = jalview
+eclipse_bin_dir = bin
gradlePluginsDir = gradle/plugins
jalviewjs_j2s_settings_file = dot_j2s
jalviewjs_j2s_settings = .j2s
jalviewjs_eclipse_workspace = ../tmp/eclipse-workspace
-jalviewjs_eclipseBuildArg = build
-#jalviewjs_eclipseBuildArg = cleanBuild
+#jalviewjs_eclipseBuildArg = build
+jalviewjs_eclipseBuildArg = cleanBuild
+jalviewjs_server_port = 9001
+jalviewjs_server_wait = 10
j2s.compiler.status = enable