|
From: <caw...@us...> - 2007-05-09 16:49:34
|
Revision: 2454
http://svn.sourceforge.net/rubyeclipse/?rev=2454&view=rev
Author: cawilliams
Date: 2007-05-09 09:49:33 -0700 (Wed, 09 May 2007)
Log Message:
-----------
don't add working directory to loadpath (often this is the project path) - it's unnecessary and in the case of Rails messes a lot of stuff up
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-05-09 15:30:23 UTC (rev 2453)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-05-09 16:49:33 UTC (rev 2454)
@@ -75,7 +75,7 @@
String[] cp = config.getLoadPath();
if (cp.length > 0) {
- arguments.addAll(convertLoadPath(cp)); // TODO If our working directory is equal to loadpath, don't add loadpath
+ arguments.addAll(convertLoadPath(config, cp));
}
arguments.addAll(debugSpecificVMArgs(debugTarget));
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-05-09 15:30:23 UTC (rev 2453)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-05-09 16:49:33 UTC (rev 2454)
@@ -167,11 +167,21 @@
return file.exists() && file.isFile();
}
- protected List<String> convertLoadPath(String[] lp) {
+ protected List<String> convertLoadPath(VMRunnerConfiguration config, String[] lp) {
+ String working = null;
+ try {
+ File workingDir = getWorkingDir(config);
+ if (workingDir != null) working = workingDir.getAbsolutePath();
+ } catch (CoreException e) {
+ // ignore
+ }
List<String> strings = new ArrayList<String>();
for (int i= 0; i < lp.length; i++) {
+ String path = lp[i];
+ // Don't add project to loadpath if project is working directory
+ if (working != null && working.equals(path)) continue;
strings.add("-I"); //$NON-NLS-1$
- strings.add(lp[i]);
+ strings.add(path);
}
return strings;
}
@@ -207,7 +217,7 @@
String[] lp= config.getLoadPath();
if (lp.length > 0) {
- arguments.addAll(convertLoadPath(lp));
+ arguments.addAll(convertLoadPath(config, lp));
}
arguments.add(END_OF_OPTIONS_DELIMITER);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|