From cbed3ee81fd8e9eff9d59e9a31d2c327a87a426e Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 4 Sep 2020 18:29:41 +0100 Subject: [PATCH] JAL-3679 Added externally specified plugins dir to J2sPlugin check --- build.gradle | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index bfd7a8f..4fe4088 100644 --- a/build.gradle +++ b/build.gradle @@ -2841,10 +2841,25 @@ task jalviewjsIDE_checkJ2sPlugin { 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}')\nTry running task jalviewjsIDE_copyJ2sPlugin" + def eclipseJ2sPluginDirs = [ "${eclipseHome}/dropins" ] + def altPluginsDir = System.properties["org.eclipse.equinox.p2.reconciler.dropins.directory"] + if (altPluginsDir != null && file(altPluginsDir).exists()) { + eclipseJ2sPluginDirs += altPluginsDir + } + def foundPlugin = false + def j2sPluginFileName = j2sPluginFile.getName() + def eclipseJ2sPlugin + def eclipseJ2sPluginFile + eclipseJ2sPluginDirs.any { dir -> + eclipseJ2sPlugin = "${dir}/${j2sPluginFileName}" + eclipseJ2sPluginFile = file(eclipseJ2sPlugin) + if (eclipseJ2sPluginFile.exists()) { + foundPlugin = true + return true + } + } + if (!foundPlugin) { + def msg = "Eclipse J2S Plugin is not installed (could not find '${j2sPluginFileName}' in\n"+eclipseJ2sPluginDirs.join("\n")+"\n)\nTry running task jalviewjsIDE_copyJ2sPlugin" System.err.println(msg) throw new StopExecutionException(msg) } @@ -2862,7 +2877,7 @@ task jalviewjsIDE_checkJ2sPlugin { System.err.println(msg) throw new StopExecutionException(msg) } else { - def msg = "Eclipse J2S Plugin is the same as '${j2sPlugin}' (this is good)" + def msg = "Eclipse J2S Plugin '${eclipseJ2sPlugin}' is the same as '${j2sPlugin}' (this is good)" println(msg) } } -- 1.7.10.2