From: soares Date: Mon, 21 Oct 2019 20:16:37 +0000 (+0100) Subject: JAL-3210 Different j2s plugin for different versions of eclipse. Not great, but good... X-Git-Tag: Release_2_11_4_0~45^2~18^2~110 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a2471f9a2d164c04e9863702195924b4d95d41c8;p=jalview.git JAL-3210 Different j2s plugin for different versions of eclipse. Not great, but good for now --- diff --git a/build.gradle b/build.gradle index 03dacfb..c42b7bd 100644 --- a/build.gradle +++ b/build.gradle @@ -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 diff --git a/gradle.properties b/gradle.properties index 85ee158..dc46f86 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/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/com.seeq.eclipse.importprojects-1.4.0.jar b/utils/jalviewjs/eclipse/dropins_4.12/com.seeq.eclipse.importprojects-1.4.0.jar similarity index 100% rename from utils/jalviewjs/eclipse/dropins/com.seeq.eclipse.importprojects-1.4.0.jar rename to utils/jalviewjs/eclipse/dropins_4.12/com.seeq.eclipse.importprojects-1.4.0.jar 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 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 index 0000000..69d7603 Binary files /dev/null and b/utils/jalviewjs/eclipse/dropins_4.13/com.seeq.eclipse.importprojects-1.4.0.jar differ diff --git a/utils/jalviewjs/eclipse/dropins/net.sf.j2s.core_3.2.4-FOR_4.13.jar b/utils/jalviewjs/eclipse/dropins_4.13/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-FOR_4.13.jar rename to utils/jalviewjs/eclipse/dropins_4.13/net.sf.j2s.core_3.2.4-FOR_4.13.jar