+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)
+}