[Esbox-commits] r122 - in trunk/org.indt.esbox.core/src/org/indt/esbox: core/scratchbox internal/core

raul at garage.maemo.org raul at garage.maemo.org
Mon Oct 15 02:13:38 EEST 2007


Author: raul
Date: 2007-10-15 02:13:38 +0300 (Mon, 15 Oct 2007)
New Revision: 122

Modified:
   trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/ScratchboxCommandLauncher.java
   trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/ESboxPreferenceInitializer.java
Log:


Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/ScratchboxCommandLauncher.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/ScratchboxCommandLauncher.java	2007-10-14 23:12:41 UTC (rev 121)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/core/scratchbox/ScratchboxCommandLauncher.java	2007-10-14 23:13:38 UTC (rev 122)
@@ -15,11 +15,16 @@
 import java.util.StringTokenizer;
 
 import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.internal.core.envvar.UserDefinedEnvironmentSupplier;
+import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
 import org.eclipse.cdt.utils.spawner.ProcessFactory;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Preferences;
 import org.indt.esbox.core.CoreActivator;
 import org.indt.esbox.core.ESboxPreferenceConstants;
+import org.indt.esbox.core.env.ESboxEnvironmentVariableManager;
 
 /**
  * Launch commands inside Scratchbox.
@@ -35,11 +40,15 @@
 
 	}
 	
-	@Override
 	public Properties getEnvironment() {
-		Properties properties = new Properties();
-		properties.put("DISPLAY", ":2");
-		return properties;
+		UserDefinedEnvironmentSupplier userEnvSupplier = ESboxEnvironmentVariableManager.fUserSupplier;
+		IEnvironmentVariable vars[] = userEnvSupplier.getVariables(ResourcesPlugin.getWorkspace());
+		Properties props = new Properties();
+		for (int i = 0; i < vars.length; i++) {
+			IEnvironmentVariable variable = vars[i];
+			props.put(variable.getName(),variable.getValue());
+		}
+		return props;
 	}
 
 	/**
@@ -258,10 +267,6 @@
 		try {
 			// add platform specific arguments (shell invocation)
 			fCommandArgs = constructCommandArray(commandPath.toOSString(), args, env, changeToDirectory);
-			for (int i = 0; i < fCommandArgs.length; i++) {
-				String string = fCommandArgs[i];
-				System.out.println(string);
-			}
 			fProcess = Runtime.getRuntime().exec(fCommandArgs);
 			fErrorMessage = ""; //$NON-NLS-1$
 		} catch (IOException e) {

Modified: trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/ESboxPreferenceInitializer.java
===================================================================
--- trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/ESboxPreferenceInitializer.java	2007-10-14 23:12:41 UTC (rev 121)
+++ trunk/org.indt.esbox.core/src/org/indt/esbox/internal/core/ESboxPreferenceInitializer.java	2007-10-14 23:13:38 UTC (rev 122)
@@ -15,10 +15,18 @@
 import java.util.InvalidPropertiesFormatException;
 import java.util.Properties;
 
+import org.eclipse.cdt.core.envvar.IContributedEnvironment;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
+import org.eclipse.cdt.internal.core.envvar.ICoreEnvironmentVariableSupplier;
+import org.eclipse.cdt.internal.core.envvar.UserDefinedEnvironmentSupplier;
+import org.eclipse.cdt.utils.envvar.StorableEnvironmentLoader;
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.indt.esbox.core.CoreActivator;
 import org.indt.esbox.core.ESboxPreferenceConstants;
+import org.indt.esbox.core.env.ESboxContributedEnvironment;
+import org.indt.esbox.core.env.ESboxEnvironmentVariableManager;
 
 /**
  * Initialize a set of important values defined on file sbox_version_1.0.xml
@@ -39,7 +47,7 @@
 	 * 
 	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
 	 */
-	public void initializeDefaultPreferences() {
+	public void initializeDefaultPreferences() {		
 		IPreferenceStore preferenceStore = CoreActivator.getDefault()
 				.getPreferenceStore();
 
@@ -63,7 +71,8 @@
 				// TODO Auto-generated catch block
 				e.printStackTrace();
 			}
-		}
+		}		
+		
 	}
 
 }



More information about the Esbox-commits mailing list