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)
}
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)
}
}