Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-09-05 03:51:31 -0400
committerTobias Schwarz2014-09-05 03:51:31 -0400
commit1c6b05bfed3788917e09a743c74baf7f8b0ff76d (patch)
tree2a355930bb38578a662c2f916a7069d87da06bf7
parent26c71dd7e1f1ace5cda3bfa409e19dd644838473 (diff)
downloadorg.eclipse.tcf-1c6b05bfed3788917e09a743c74baf7f8b0ff76d.tar.gz
org.eclipse.tcf-1c6b05bfed3788917e09a743c74baf7f8b0ff76d.tar.xz
org.eclipse.tcf-1c6b05bfed3788917e09a743c74baf7f8b0ff76d.zip
Target Explorer: extend process launcher with better environment
handling
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/steps/IProcessesStepAttributes.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java15
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/TargetPathValidator.java8
3 files changed, 23 insertions, 5 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/steps/IProcessesStepAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/steps/IProcessesStepAttributes.java
index e5c7a8de9..235274731 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/steps/IProcessesStepAttributes.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/steps/IProcessesStepAttributes.java
@@ -31,6 +31,11 @@ public interface IProcessesStepAttributes {
public static final String ATTR_PROCESS_ARGUMENTS = ATTR_PREFIX + ".process_arguments"; //$NON-NLS-1$
/**
+ * Launch configuration attribute: The process library path.
+ */
+ public static final String ATTR_PROCESS_LIBRARY_PATH = ATTR_PREFIX + ".process_library_path"; //$NON-NLS-1$
+
+ /**
* Launch configuration attribute: Flag if or if not to stop at process entry.
*/
public static final String ATTR_STOP_AT_ENTRY = ATTR_PREFIX + ".process_stop_at_entry"; //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
index 286eb006d..8bf1a5c8c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
@@ -893,9 +893,7 @@ public class ProcessLauncher extends PlatformObject implements IProcessLauncher
Map<String, String> processEnv = new HashMap<String, String>(environment);
@SuppressWarnings("unchecked")
Map<String, String> processEnvDiff = (Map<String, String>)properties.getProperty(IProcessLauncher.PROP_PROCESS_ENV);
- if (processEnvDiff != null && !processEnvDiff.isEmpty()) {
- processEnv.putAll(processEnvDiff);
- }
+ mergeEnvironment(processEnv, processEnvDiff);
boolean processConsole = properties.getBooleanProperty(IProcessLauncher.PROP_PROCESS_ASSOCIATE_CONSOLE);
@@ -981,6 +979,17 @@ public class ProcessLauncher extends PlatformObject implements IProcessLauncher
}
/**
+ * Merge original channel environment and process environment.
+ * @param processEnv
+ * @param processEnvDiff
+ */
+ protected void mergeEnvironment(Map<String,String> processEnv, Map<String,String> processEnvDiff) {
+ if (processEnv != null && processEnvDiff != null && !processEnvDiff.isEmpty()) {
+ processEnv.putAll(processEnvDiff);
+ }
+ }
+
+ /**
* Register the process context to the listeners.
*
* @param process The process context or <code>null</code>.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/TargetPathValidator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/TargetPathValidator.java
index e305ec298..04aa92a4c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/TargetPathValidator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/TargetPathValidator.java
@@ -17,16 +17,20 @@ import org.eclipse.tcf.te.ui.controls.nls.Messages;
*/
public class TargetPathValidator extends RegexValidator {
- protected static final String TARGET_PATH_SEGMENT_REGEX = "[^?* /\\\\]+|([^?* /\\\\]+[^?*/\\\\]*)"; //$NON-NLS-1$
+ public static final int ATTR_MULTIPLE = 4;
+
+ protected static final String TARGET_PATH_SEGMENT_REGEX = "[^;?* /\\\\]+"; //$NON-NLS-1$
protected static final String TARGET_PATH_REGEX = "(/(" + TARGET_PATH_SEGMENT_REGEX + "))+"; //$NON-NLS-1$ //$NON-NLS-2$
+ protected static final String TARGET_PATH_MULTIPLE_REGEX = TARGET_PATH_REGEX + "(;" + TARGET_PATH_REGEX + ")*"; //$NON-NLS-1$ //$NON-NLS-2$
+
/**
* Constructor.
* @param attributes
* @param regex
*/
public TargetPathValidator(int attributes) {
- super(attributes, TARGET_PATH_REGEX);
+ super(attributes, isAttribute(ATTR_MULTIPLE, attributes) ? TARGET_PATH_MULTIPLE_REGEX : TARGET_PATH_REGEX);
setMessageText(INFO_MISSING_VALUE, Messages.TargetPathValidator_Information_MissingTargetPath);
setMessageText(ERROR_INVALID_VALUE, Messages.TargetPathValidator_Error_InvalidTargetPath);
}

Back to the top