|
From: David C. <dc...@us...> - 2005-09-05 16:44:29
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31754/src/org/rubypeople/rdt/core Modified Files: RubyCore.java Log Message: Fixed how we find RemoteTestRunner.rb to use getOSString() Fixed getOSString so that we can find "plugin-ruby files" even when the current directory is NOT the Eclipse install directory (still a bit kludgy). Index: RubyCore.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** RubyCore.java 4 Sep 2005 17:39:11 -0000 1.11 --- RubyCore.java 5 Sep 2005 16:44:21 -0000 1.12 *************** *** 23,26 **** --- 23,27 ---- import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.InstanceScope; + import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.rubypeople.rdt.internal.core.BatchOperation; *************** *** 264,273 **** public static String getOSDirectory(Plugin plugin) { ! String location = plugin.getBundle().getLocation(); int prefixLength = location.indexOf('@'); if (prefixLength == -1) { throw new RuntimeException("Location of launching bundle does not contain @: " + location); } String pluginDir = location.substring(prefixLength + 1); File pluginDirFile = new File(pluginDir); ! if (!pluginDirFile.exists()) { throw new RuntimeException("Expected directory of eclipseDebug.rb does not exist: " + pluginDir); } return pluginDirFile.getAbsolutePath()+"/"; } --- 265,284 ---- public static String getOSDirectory(Plugin plugin) { ! final Bundle bundle = plugin.getBundle(); ! String location = bundle.getLocation(); int prefixLength = location.indexOf('@'); if (prefixLength == -1) { throw new RuntimeException("Location of launching bundle does not contain @: " + location); } String pluginDir = location.substring(prefixLength + 1); File pluginDirFile = new File(pluginDir); ! if (!pluginDirFile.exists()) ! { ! String installArea = System.getProperty("osgi.install.area"); ! if (installArea.startsWith("file:/")) ! installArea = installArea.substring("file:/".length()); ! File installFile = new File(installArea); ! pluginDirFile = new File(installFile, pluginDir); ! if (!pluginDirFile.exists()) ! throw new RuntimeException("Unable to find (" + pluginDirFile + ") directory for " + plugin.getClass()); ! } return pluginDirFile.getAbsolutePath()+"/"; } |