You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by si...@apache.org on 2009/10/06 00:32:00 UTC

svn commit: r822059 - /labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java

Author: simoneg
Date: Mon Oct  5 22:32:00 2009
New Revision: 822059

URL: http://svn.apache.org/viewvc?rev=822059&view=rev
Log:
LABS-474 : check for right run configuration

Modified:
    labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java

Modified: labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java?rev=822059&r1=822058&r2=822059&view=diff
==============================================================================
--- labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java (original)
+++ labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/launch/MagmaLaunchShortcut.java Mon Oct  5 22:32:00 2009
@@ -26,6 +26,7 @@
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
+import org.eclipse.wst.common.internal.emf.resource.RootTranslator;
 import org.maven.ide.eclipse.actions.MavenLaunchConstants;
 
 public class MagmaLaunchShortcut implements ILaunchShortcut2,
@@ -122,7 +123,7 @@
 		try {
 			ILaunchConfigurationType configType = getConfigurationType();
 			String goals = this.goalName == null ? "magma:run" : this.goalName;
-			String basename = prj.getName() + " - " + goals;
+			String basename = prj.getName() + " - " + goals.replace(':', '-');
 			ILaunchConfigurationWorkingCopy wc = configType.newInstance(null,
 					DebugPlugin.getDefault().getLaunchManager()
 							.generateUniqueLaunchConfigurationNameFrom(
@@ -147,6 +148,7 @@
 			ILaunchConfiguration[] configs = DebugPlugin.getDefault()
 					.getLaunchManager().getLaunchConfigurations(configType);
 			candidateConfigs = new ArrayList(configs.length);
+			String mygoals = this.goalName == null ? "magma:run" : this.goalName;
 			for (int i = 0; i < configs.length; i++) {
 				ILaunchConfiguration config = configs[i];
 				String pomDir = config.getAttribute(
@@ -157,8 +159,8 @@
 						.getStringVariableManager().performStringSubstitution(
 								pomDir);
 				File accpd = new File(pomDir);
-				if (accpd.getAbsolutePath().startsWith(root.getAbsolutePath())) {
-					if (this.goalName == null || goals.indexOf(" " + this.goalName + " ") > -1) {
+				if (accpd.equals(root)) {
+					if (mygoals == null || goals.indexOf(" " + mygoals + " ") > -1) {
 						candidateConfigs.add(config);
 					}
 				}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org