X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=build.gradle;h=1f1bc2f6d9ba7c01880c10075b5f210955af0fad;hb=d29795758c856e03fcec7d0d313e968a7185455c;hp=d72ff435dece856d745239c83fa9da84ec885d94;hpb=92eab13adadbe0bf073c21dcea3cf243fe619a6f;p=jalview.git diff --git a/build.gradle b/build.gradle index d72ff43..1f1bc2f 100644 --- a/build.gradle +++ b/build.gradle @@ -335,7 +335,7 @@ ext { eclipseJavaVersion = "55" jalviewjsJ2sPlugin = jalviewjs_j2s_plugin if (IN_ECLIPSE) { - def eclipseJavaVersion = System.property["java.class.version"] + //def eclipseJavaVersion = System.property["java.class.version"] if (Float.parseFloat(eclipseJavaVersion) >= 55 && file(jalviewjs_j2s_plugin_j11).exists()) { // 55 is Java 11 jalviewjsJ2sPlugin = jalviewjs_j2s_plugin_j11 } @@ -2340,26 +2340,21 @@ task cleanJalviewjsAll { task jalviewjsIDE_checkJ2sPlugin { group "00 JalviewJS in Eclipse" - description "Compare the swingjs/net.sf.j2s.core.jar file with the Eclipse IDE's plugin version (found in the 'dropins' dir)" + description "Compare the swingjs/net.sf.j2s.core(-j11)?.jar file with the Eclipse IDE's plugin version (found in the 'dropins' dir)" doFirst { def j2sPlugin = string("${jalviewDir}/${jalviewjsJ2sPlugin}") def j2sPluginFile = file(j2sPlugin) - def copyPlugin = jalviewjs_eclipseIDE_auto_copy_j2s_plugin == "true" def eclipseHome = System.properties["eclipse.home.location"] - def doCopy = false if (eclipseHome == null || ! IN_ECLIPSE) { throw new StopExecutionException("Cannot find running Eclipse home from System.properties['eclipse.home.location']. Skipping J2S Plugin Check.") } def eclipseJ2sPlugin = "${eclipseHome}/dropins/${j2sPluginFile.getName()}" def eclipseJ2sPluginFile = file(eclipseJ2sPlugin) if (!eclipseJ2sPluginFile.exists()) { - def msg = "Eclipse J2S Plugin is not installed (could not find '${eclipseJ2sPlugin}')" + def msg = "Eclipse J2S Plugin is not installed (could not find '${eclipseJ2sPlugin}')\nTry running task jalviewjsIDE_copyJ2sPlugin" System.err.println(msg) - if (! copyPlugin) { - throw new GradleException(msg) - } - doCopy = true + throw new StopExecutionException(msg) } def digest = MessageDigest.getInstance("MD5") @@ -2373,20 +2368,7 @@ task jalviewjsIDE_checkJ2sPlugin { if (j2sPluginMd5 != eclipseJ2sPluginMd5) { def msg = "WARNING! Eclipse J2S Plugin '${eclipseJ2sPlugin}' is different to this commit's version '${j2sPlugin}'" System.err.println(msg) - if (! copyPlugin) { - throw new StopExecutionException(msg) - } - doCopy = true - } - - if (doCopy) { - def msg = "WARNING! Auto-copying this commit's j2s plugin version '${j2sPlugin}' to Eclipse J2S Plugin '${eclipseJ2sPlugin}'\n May require an Eclipse restart" - println(msg) - copy { - from j2sPlugin - eclipseJ2sPluginFile.getParentFile().mkdirs() - into eclipseJ2sPluginFile.getParent() - } + throw new StopExecutionException(msg) } else { def msg = "Eclipse J2S Plugin is the same as '${j2sPlugin}' (this is good)" println(msg) @@ -2394,6 +2376,29 @@ task jalviewjsIDE_checkJ2sPlugin { } } +task jalviewjsIDE_copyJ2sPlugin { + group "00 JalviewJS in Eclipse" + description "Copy the swingjs/net.sf.j2s.core(-j11)?.jar file into the Eclipse IDE's 'dropins' dir" + + doFirst { + def j2sPlugin = string("${jalviewDir}/${jalviewjsJ2sPlugin}") + def j2sPluginFile = file(j2sPlugin) + def eclipseHome = System.properties["eclipse.home.location"] + if (eclipseHome == null || ! IN_ECLIPSE) { + throw new StopExecutionException("Cannot find running Eclipse home from System.properties['eclipse.home.location']. NOT copying J2S Plugin.") + } + def eclipseJ2sPlugin = "${eclipseHome}/dropins/${j2sPluginFile.getName()}" + def eclipseJ2sPluginFile = file(eclipseJ2sPlugin) + def msg = "WARNING! Copying this commit's j2s plugin '${j2sPlugin}' to Eclipse J2S Plugin '${eclipseJ2sPlugin}'\n* May require an Eclipse restart" + System.err.println(msg) + copy { + from j2sPlugin + eclipseJ2sPluginFile.getParentFile().mkdirs() + into eclipseJ2sPluginFile.getParent() + } + } +} + task jalviewjsIDE_j2sFile { group "00 JalviewJS in Eclipse"