You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2014/05/15 22:16:25 UTC

svn commit: r1595033 - in /sling/trunk/tooling/ide/eclipse-core: META-INF/MANIFEST.MF src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadBehaviour.java

Author: rombert
Date: Thu May 15 20:16:24 2014
New Revision: 1595033

URL: http://svn.apache.org/r1595033
Log:
SLING-3559 - Never run project launches when publishing

Modified:
    sling/trunk/tooling/ide/eclipse-core/META-INF/MANIFEST.MF
    sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadBehaviour.java

Modified: sling/trunk/tooling/ide/eclipse-core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/META-INF/MANIFEST.MF?rev=1595033&r1=1595032&r2=1595033&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/META-INF/MANIFEST.MF (original)
+++ sling/trunk/tooling/ide/eclipse-core/META-INF/MANIFEST.MF Thu May 15 20:16:24 2014
@@ -29,7 +29,6 @@ Import-Package: org.apache.commons.httpc
  org.eclipse.debug.core,
  org.eclipse.debug.core.model,
  org.eclipse.debug.core.sourcelookup,
- org.eclipse.debug.ui,
  org.eclipse.jdt.core,
  org.eclipse.jdt.internal.launching,
  org.eclipse.jdt.launching,

Modified: sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadBehaviour.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadBehaviour.java?rev=1595033&r1=1595032&r2=1595033&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadBehaviour.java (original)
+++ sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadBehaviour.java Thu May 15 20:16:24 2014
@@ -20,9 +20,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URISyntaxException;
 import java.util.Arrays;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
 
 import org.apache.sling.ide.artifacts.EmbeddedArtifactLocator;
 import org.apache.sling.ide.eclipse.core.ISlingLaunchpadServer;
@@ -45,11 +42,8 @@ import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
 import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.DebugUITools;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.wst.server.core.IModule;
 import org.eclipse.wst.server.core.IServer;
@@ -281,11 +275,6 @@ public class SlingLaunchpadBehaviour ext
     private void publishContentModule(int kind, int deltaKind, IModule[] module, IProgressMonitor monitor)
             throws CoreException, SerializationException, IOException {
 
-		if (runLaunchesIfExist(kind, deltaKind, module, monitor)) {
-			return;
-		}
-		// otherwise fallback to old behaviour
-		
         PluginLogger logger = Activator.getDefault().getPluginLogger();
 
 		Repository repository = ServerUtil.getRepository(getServer(), monitor);
@@ -357,59 +346,6 @@ public class SlingLaunchpadBehaviour ext
 //        setServerPublishState(IServer.PUBLISH_STATE_NONE);
 	}
 
-	private boolean runLaunchesIfExist(int kind, int deltaKind, IModule[] module,
-			IProgressMonitor monitor) throws CoreException {
-		final IProject project = module[0].getProject();
-		final IFolder dotLaunches = project.getFolder(".settings").getFolder(".launches");
-		final List<IFile> launches = new LinkedList<IFile>();
-		if (dotLaunches.exists()) {
-			final IResource[] members = dotLaunches.members();
-			if (members!=null) {
-				for (int i = 0; i < members.length; i++) {
-					final IResource aMember = members[i];
-					if (aMember instanceof IFile) {
-						launches.add((IFile)aMember);
-					}
-				}
-			}
-		}
-		if (launches.size()>0) {
-			if (kind == IServer.PUBLISH_AUTO && deltaKind == ServerBehaviourDelegate.NO_CHANGE) {
-				// then nothing is to be done, there are no changes
-				return true;
-			}
-	        for (Iterator<IFile> it = launches.iterator(); it.hasNext();) {
-				IFile aLaunchFile = it.next();
-				try{
-//					@SuppressWarnings("restriction")
-//					IWorkbench workbench = DebugUIPlugin.getDefault().getWorkbench();
-//					if (workbench==null) {
-//						// we're not in the context of a workbench?
-//						System.err.println("We're not in the context of a workbench?");
-//					}
-//					IWorkbenchWindow aw = workbench.getActiveWorkbenchWindow();
-//					if (aw==null) {
-//						// we're not in the context of a workbench window?
-//					}
-					ILaunchConfiguration launchConfig = 
-							DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(aLaunchFile);
-					if (launchConfig!=null) {
-						DebugUITools.launch( launchConfig, ILaunchManager.RUN_MODE);
-					}
-				} catch(Exception e) {
-					// TODO logging
-					
-					e.printStackTrace();
-				}
-
-			}
-	        super.publishModule(kind, deltaKind, module, monitor);
-	        setModulePublishState(module, IServer.PUBLISH_STATE_NONE);
-	        return true;
-		}
-		return false;
-	}
-
     private void execute(Command<?> command) throws CoreException {
         if (command == null) {
             return;