[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Launcher set the environment.
|
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.launch/ChangeLog,v
retrieving revision 1.13
diff -u -r1.13 ChangeLog
--- ChangeLog 23 Nov 2002 22:36:25 -0000 1.13
+++ ChangeLog 3 Dec 2002 19:20:55 -0000
@@ -1,3 +1,11 @@
+2002-12-03 Alain Magloire
+
+ * src/.../internal/LocalCLaunchConfigurationDelegate.java(exec):
+ Change the signature to take Properties for the environment get
+ the default environment and add it to new environment to it.
+ Use ProcessFactory to run the Application, with the new environment
+ array.
+
2002-11-23 Alain Magloire
* src/.../internal/ui/CApplicationLaunchShortcut.java (searchAndLaunch):
Index: src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java,v
retrieving revision 1.19
diff -u -r1.19 LocalCLaunchConfigurationDelegate.java
--- src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java 22 Nov 2002 04:28:24 -0000 1.19
+++ src/org/eclipse/cdt/launch/internal/LocalCLaunchConfigurationDelegate.java 3 Dec 2002 19:20:55 -0000
@@ -9,6 +9,8 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.Properties;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.IProcessInfo;
@@ -22,6 +24,8 @@
import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
import org.eclipse.cdt.launch.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
+import org.eclipse.cdt.utils.spawner.EnvironmentReader;
+import org.eclipse.cdt.utils.spawner.ProcessFactory;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -131,7 +135,7 @@
if (wd == null) {
wd = new File(System.getProperty("user.home", ".")); //NON-NLS-1;
}
- Process process = exec(commandArray, getEnvironmentArray(config), wd);
+ Process process = exec(commandArray, getEnvironmentProperty(config), wd);
DebugPlugin.getDefault().newProcess(launch, process, renderProcessLabel(commandArray[0]));
}
monitor.done();
@@ -183,13 +187,26 @@
* cancelled
* @see Runtime
*/
- protected Process exec(String[] cmdLine, String[] envp, File workingDirectory) throws CoreException {
+ protected Process exec(String[] cmdLine, Properties environ, File workingDirectory) throws CoreException {
Process p = null;
+ Properties props = EnvironmentReader.getEnvVars();
+ props.putAll(environ);
+ String[] envp = null;
+ ArrayList envList = new ArrayList();
+ Enumeration names = props.propertyNames();
+ if (names != null) {
+ while (names.hasMoreElements()) {
+ String key = (String) names.nextElement();
+ envList.add(key + "=" + props.getProperty(key));
+ }
+ envp = (String[]) envList.toArray(new String[envList.size()]);
+ }
try {
+
if (workingDirectory == null) {
- p = Runtime.getRuntime().exec(cmdLine, envp);
+ p = ProcessFactory.getFactory().exec(cmdLine, envp);
} else {
- p = Runtime.getRuntime().exec(cmdLine, envp, workingDirectory);
+ p = ProcessFactory.getFactory().exec(cmdLine, envp, workingDirectory);
}
} catch (IOException e) {
if (p != null) {
@@ -211,7 +228,7 @@
if (handler != null) {
Object result = handler.handleStatus(status, this);
if (result instanceof Boolean && ((Boolean) result).booleanValue()) {
- p = exec(cmdLine, envp, null);
+ p = exec(cmdLine, environ, null);
}
}
}