JAL-3210 Different j2s plugin for different versions of eclipse. Not great, but good...
authorsoares <bsoares@dundee.ac.uk>
Mon, 21 Oct 2019 20:16:37 +0000 (21:16 +0100)
committersoares <bsoares@dundee.ac.uk>
Mon, 21 Oct 2019 20:16:37 +0000 (21:16 +0100)
build.gradle
gradle.properties
utils/jalviewjs/eclipse/dropins_4.12/com.seeq.eclipse.importprojects-1.4.0.jar [moved from utils/jalviewjs/eclipse/dropins/com.seeq.eclipse.importprojects-1.4.0.jar with 100% similarity]
utils/jalviewjs/eclipse/dropins_4.12/net.sf.j2s.core-3.2.4-FOR_4.12.jar [new file with mode: 0644]
utils/jalviewjs/eclipse/dropins_4.13/com.seeq.eclipse.importprojects-1.4.0.jar [new file with mode: 0644]
utils/jalviewjs/eclipse/dropins_4.13/net.sf.j2s.core_3.2.4-FOR_4.13.jar [moved from utils/jalviewjs/eclipse/dropins/net.sf.j2s.core_3.2.4-FOR_4.13.jar with 100% similarity]

index 03dacfb..c42b7bd 100644 (file)
@@ -1332,8 +1332,11 @@ task jalviewjsUnzipFiles {
 
 def eclipseDropinsDir
 def eclipseBinary
+def eclipseVersion
+def fromDropinsDir
 task jalviewjsEclipsePaths {
   def eclipseRoot
+  def eclipseProduct
   eclipseRoot = jalviewjs_eclipse_root
   if (eclipseRoot.startsWith("~")) {
     eclipseRoot = System.getProperty("user.home") + eclipseRoot.substring(1)
@@ -1342,18 +1345,36 @@ task jalviewjsEclipsePaths {
     eclipseRoot += "/Eclipse.app"
     eclipseDropinsDir = eclipseRoot+"/Contents/Eclipse/dropins"
     eclipseBinary = eclipseRoot+"/Contents/MacOS/eclipse"
+    eclipseProduct = eclipseRoot+"/Contents/Eclipse/.eclipseproduct"
   } else if (OperatingSystem.current().isWindows()) { // check these paths!!
     eclipseDropinsDir = eclipseRoot+"/dropins"
     eclipseBinary = eclipseRoot+"/eclipse"
+    eclipseProduct = eclipseRoot+"/.eclipseproduct"
   } else { // linux or unix
     eclipseDropinsDir = eclipseRoot+"/dropins"
     eclipseBinary = eclipseRoot+"/eclipse"
+    eclipseProduct = eclipseRoot+"/.eclipseproduct"
   }
+
+  def fis = new FileInputStream(eclipseProduct)
+  def props = new Properties()
+  props.load(fis)
+  eclipseVersion = props.getProperty("version")
+  fis.close()
+  println("ECLIPSE_VERSION=${eclipseVersion}")
+  String[] v = eclipseVersion.split("\\.")
+  def v0 = Integer.valueOf(v[0])
+  def v1 = Integer.valueOf(v[1])
+  if (v0 < 4 || ( v0 == 4 && v1 < 13 )) {
+    fromDropinsDir = "eclipse/dropins_4.12"
+  } else {
+    fromDropinsDir = "eclipse/dropins_4.13"
+  } 
 }
 
 task jalviewjsEclipseCopyDropins {
   dependsOn jalviewjsEclipsePaths
-  def inputFiles = fileTree(dir: jalviewjs_utils_dir+"/"+jalviewjs_eclipse_dropins_dir, include: "*.jar")
+  def inputFiles = fileTree(dir: jalviewjs_utils_dir+"/"+fromDropinsDir, include: "*.jar")
   def outputDir = eclipseDropinsDir
 
   inputs.files inputFiles
index 85ee158..dc46f86 100644 (file)
@@ -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/eclipse
+jalviewjs_eclipse_root = ~/buildtools/eclipse/eclipse-jee-2019-06/eclipse
 
 jalviewjs_utils_dir = utils/jalviewjs
 jalviewjs_eclipse_dropins_dir = eclipse/dropins
diff --git a/utils/jalviewjs/eclipse/dropins_4.12/net.sf.j2s.core-3.2.4-FOR_4.12.jar b/utils/jalviewjs/eclipse/dropins_4.12/net.sf.j2s.core-3.2.4-FOR_4.12.jar
new file mode 100644 (file)
index 0000000..e8288a9
Binary files /dev/null and b/utils/jalviewjs/eclipse/dropins_4.12/net.sf.j2s.core-3.2.4-FOR_4.12.jar differ
diff --git a/utils/jalviewjs/eclipse/dropins_4.13/com.seeq.eclipse.importprojects-1.4.0.jar b/utils/jalviewjs/eclipse/dropins_4.13/com.seeq.eclipse.importprojects-1.4.0.jar
new file mode 100644 (file)
index 0000000..69d7603
Binary files /dev/null and b/utils/jalviewjs/eclipse/dropins_4.13/com.seeq.eclipse.importprojects-1.4.0.jar differ