- 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"