From: soares Date: Mon, 21 Oct 2019 18:51:32 +0000 (+0100) Subject: JAL-3210 Changed eclipse workspace dir to be a system temp dir [held in build/jalview... X-Git-Tag: Release_2_11_4_0~45^2~18^2~111 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fee03a7c043c336cee828b2382d56428e57483f2;p=jalview.git JAL-3210 Changed eclipse workspace dir to be a system temp dir [held in build/jalviewjs/eclipse_workspace_location] that persists until a gradle clean --- diff --git a/build.gradle b/build.gradle index 314306f..03dacfb 100644 --- a/build.gradle +++ b/build.gradle @@ -1262,17 +1262,6 @@ task helppages { outputs.dir("$helpOutputDir") } -def eclipseWorkspace -task jalviewjsSetEclipseWorkspace { - def eclipseWsDir = jalviewjs_eclipse_workspace - eclipseWorkspace = file(eclipseWsDir) - if (!eclipseWorkspace.exists()) { - eclipseWorkspace = file("${buildDir}/../tmp/eclipse-workspace") - //eclipseWorkspace.deleteOnExit() - } - println("ECLIPSE WORKSPACE: "+eclipseWorkspace.getPath()) -} - def jalviewjsBuildDir def jalviewjsSiteDir def jalviewjsTransferSiteDir @@ -1287,6 +1276,39 @@ task jalviewjsSitePath { jalviewjsTransferSiteDir = jalviewjsBuildDir + "/tmp/site" } +def eclipseWorkspace +task jalviewjsSetEclipseWorkspace { + def propKey = "jalviewjs_eclipse_workspace" + def propsFile = "${jalviewjsBuildDir}/${jalviewjs_eclipse_workspace_location_file}" + def props = new Properties() + def eclipseWsDir + def propVal = null + if (project.hasProperty(propKey)) { + propVal = project.getProperty(propKey) + eclipseWsDir = propVal + } + if ((eclipseWsDir == null || !file(eclipseWsDir).exists()) && file(propsFile).exists()) { + def ins = new FileInputStream(propsFile) + props.load(ins) + ins.close() + eclipseWsDir = props.getProperty(propKey) + } + if (eclipseWsDir == null || !file(eclipseWsDir).exists()) { + def tempDir = File.createTempDir() + eclipseWsDir = tempDir.getAbsolutePath() + props.setProperty(propKey, eclipseWsDir) + def outs = new FileOutputStream(propsFile) + props.store(outs, null) + outs.close() + } + + eclipseWorkspace = file(eclipseWsDir) + + println("ECLIPSE WORKSPACE: "+eclipseWorkspace.getPath()) + + inputs.property(propKey, propVal) + outputs.file(propsFile) +} task jalviewjsUnzipFiles { diff --git a/gradle.properties b/gradle.properties index 168de04..85ee158 100644 --- a/gradle.properties +++ b/gradle.properties @@ -142,7 +142,7 @@ eclipse_extra_jdt_prefs_file = .settings/org.eclipse.jdt.core.jalview.prefs eclipse_project_name = jalview eclipse_bin_dir = bin -jalviewjs_eclipse_root = ~/buildtools/eclipse/eclipse-jee-2019-09 +jalviewjs_eclipse_root = ~/buildtools/eclipse/eclipse-jee-2019-09/eclipse jalviewjs_utils_dir = utils/jalviewjs jalviewjs_eclipse_dropins_dir = eclipse/dropins @@ -154,7 +154,8 @@ jalviewjs_site_dir = site jalviewjs_j2s_subdir = swingjs/j2s jalviewjs_j2s_settings_file = dot_j2s jalviewjs_j2s_settings = .j2s -jalviewjs_eclipse_workspace = ../tmp/eclipse-workspace +#jalviewjs_eclipse_workspace = ../tmp/eclipse-workspace +jalviewjs_eclipse_workspace_location_file = eclipse_workspace_location #jalviewjs_eclipseBuildArg = build jalviewjs_eclipseBuildArg = cleanBuild jalviewjs_server_port = 9001 diff --git a/utils/jalviewjs/eclipse/dropins/net.sf.j2s.core_3.2.4.jar b/utils/jalviewjs/eclipse/dropins/net.sf.j2s.core_3.2.4-FOR_4.13.jar similarity index 100% rename from utils/jalviewjs/eclipse/dropins/net.sf.j2s.core_3.2.4.jar rename to utils/jalviewjs/eclipse/dropins/net.sf.j2s.core_3.2.4-FOR_4.13.jar