|
From: <caw...@us...> - 2007-01-19 17:00:32
|
Revision: 1808
http://svn.sourceforge.net/rubyeclipse/?rev=1808&view=rev
Author: cawilliams
Date: 2007-01-19 09:00:28 -0800 (Fri, 19 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/VMRunnerConfiguration.java
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-01-19 15:48:40 UTC (rev 1807)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-01-19 17:00:28 UTC (rev 1808)
@@ -31,6 +31,9 @@
import org.rubypeople.rdt.launching.VMRunnerConfiguration;
public class StandardVMRunner extends AbstractVMRunner {
+
+ private static final String END_OF_OPTIONS_DELIMITER = "--";
+
protected IVMInstall fVMInstance;
public StandardVMRunner(IVMInstall vmInstance) {
@@ -161,20 +164,13 @@
return file.exists() && file.isFile();
}
- protected String convertClassPath(String[] cp) {
- int pathCount= 0;
- StringBuffer buf= new StringBuffer();
- if (cp.length == 0) {
- return ""; //$NON-NLS-1$
+ protected List<String> convertLoadPath(String[] lp) {
+ List<String> strings = new ArrayList<String>();
+ for (int i= 0; i < lp.length; i++) {
+ strings.add("-I"); //$NON-NLS-1$
+ strings.add(lp[i]);
}
- for (int i= 0; i < cp.length; i++) {
- if (pathCount > 0) {
- buf.append(File.pathSeparator);
- }
- buf.append(cp[i]);
- pathCount++;
- }
- return buf.toString();
+ return strings;
}
@@ -196,18 +192,19 @@
List arguments= new ArrayList();
arguments.add(program);
- // VM args are the first thing after the java program so that users can specify
+ // VM args are the first thing after the ruby program so that users can specify
// options like '-client' & '-server' which are required to be the first option
String[] allVMArgs = combineVmArgs(config, fVMInstance);
addArguments(allVMArgs, arguments);
- String[] cp= config.getClassPath();
- if (cp.length > 0) {
- arguments.add("-I"); //$NON-NLS-1$
- arguments.add(convertClassPath(cp));
+ String[] lp= config.getLoadPath();
+ if (lp.length > 0) {
+ arguments.addAll(convertLoadPath(lp));
}
- arguments.add(config.getClassToLaunch());
+ arguments.add(END_OF_OPTIONS_DELIMITER);
+ arguments.add(config.getFileToLaunch());
+
String[] programArgs= config.getProgramArguments();
addArguments(programArgs, arguments);
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/VMRunnerConfiguration.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/VMRunnerConfiguration.java 2007-01-19 15:48:40 UTC (rev 1807)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/VMRunnerConfiguration.java 2007-01-19 17:00:28 UTC (rev 1808)
@@ -24,12 +24,11 @@
* </p>
*/
public class VMRunnerConfiguration {
- private String fClassToLaunch;
+ private String fFileToLaunch;
private String[] fVMArgs;
private String[] fProgramArgs;
private String[] fEnvironment;
- private String[] fClassPath;
- private String[] fBootClassPath;
+ private String[] fLoadPath;
private String fWorkingDirectory;
private Map fVMSpecificAttributesMap;
private boolean fResume = true;
@@ -38,20 +37,20 @@
/**
* Creates a new configuration for launching a VM to run the given main class
- * using the given class path.
+ * using the given load path.
*
- * @param classToLaunch The fully qualified name of the class to launch. May not be null.
- * @param classPath The classpath. May not be null.
+ * @param fileToLaunch The fully qualified name of the file to launch. May not be null.
+ * @param loadPath The loadpath. May not be null.
*/
- public VMRunnerConfiguration(String classToLaunch, String[] classPath) {
- if (classToLaunch == null) {
+ public VMRunnerConfiguration(String fileToLaunch, String[] loadPath) {
+ if (fileToLaunch == null) {
throw new IllegalArgumentException(LaunchingMessages.vmRunnerConfig_assert_classNotNull);
}
- if (classPath == null) {
+ if (loadPath == null) {
throw new IllegalArgumentException(LaunchingMessages.vmRunnerConfig_assert_classPathNotNull);
}
- fClassToLaunch= classToLaunch;
- fClassPath= classPath;
+ fFileToLaunch= fileToLaunch;
+ fLoadPath= loadPath;
}
/**
@@ -111,24 +110,6 @@
}
/**
- * Sets the boot classpath. Note that the boot classpath will be passed to the
- * VM "as is". This means it has to be complete. Interpretation of the boot class path
- * is up to the VM runner this object is passed to.
- * <p>
- * In release 3.0, support has been added for appending and prepending the
- * boot classpath. Generally an <code>IVMRunner</code> should use the prepend,
- * main, and append boot classpaths provided. However, in the case that an
- * <code>IVMRunner</code> does not support these options, a complete bootpath
- * should also be specified.
- * </p>
- * @param bootClassPath The boot classpath. An empty array indicates an empty
- * bootpath and <code>null</code> indicates a default bootpath.
- */
- public void setBootClassPath(String[] bootClassPath) {
- fBootClassPath= bootClassPath;
- }
-
- /**
* Returns the <code>Map</code> that contains String name/value pairs that represent
* VM-specific attributes.
*
@@ -140,47 +121,24 @@
}
/**
- * Returns the name of the class to launch.
+ * Returns the name of the file to launch.
*
- * @return The fully qualified name of the class to launch. Will not be <code>null</code>.
+ * @return The fully qualified name of the file to launch. Will not be <code>null</code>.
*/
- public String getClassToLaunch() {
- return fClassToLaunch;
+ public String getFileToLaunch() {
+ return fFileToLaunch;
}
/**
- * Returns the classpath.
+ * Returns the loadpath.
*
- * @return the classpath
+ * @return the loadpath
*/
- public String[] getClassPath() {
- return fClassPath;
+ public String[] getLoadPath() {
+ return fLoadPath;
}
/**
- * Returns the boot classpath. An empty array indicates an empty
- * bootpath and <code>null</code> indicates a default bootpath.
- * <p>
- * In 3.0, support has been added for prepending and appending to the
- * boot classpath. The new attributes are stored in the VM specific
- * attributes map using the following keys defined in
- * <code>IJavaLaunchConfigurationConstants</code>:
- * <ul>
- * <li>ATTR_BOOTPATH_PREPEND</li>
- * <li>ATTR_BOOTPATH_APPEND</li>
- * <li>ATTR_BOOTPATH</li>
- * </ul>
- * </p>
- * @return The boot classpath. An empty array indicates an empty
- * bootpath and <code>null</code> indicates a default bootpath.
- * @see #setBootClassPath(String[])
- * @see IJavaLaunchConfigurationConstants
- */
- public String[] getBootClassPath() {
- return fBootClassPath;
- }
-
- /**
* Returns the arguments to the VM itself.
*
* @return The VM arguments. Default is an empty array. Will not be <code>null</code>.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|