Package org.eclipse.debug.core

Examples of org.eclipse.debug.core.Launch


        this.naturesUsed = naturesUsed;
        Integer[] ports = SocketUtil.findUnusedLocalPorts(2);
        int port = ports[0];
        int clientPort = ports[1];

        final Launch launch = new Launch(createLaunchConfig(), "interactive", null);
        launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, "false");
        launch.setAttribute(INTERACTIVE_LAUNCH_PORT, "" + port);

        File scriptWithinPySrc = PydevPlugin.getScriptWithinPySrc("pydevconsole.py");
        Collection<String> extraPath = pythonpath;
        if (InteractiveConsolePrefs.getConsoleConnectVariableView()
                && interpreterManager.getInterpreterType() != IInterpreterManager.INTERPRETER_TYPE_JYTHON_ECLIPSE) {
            // Add PydevDebugPlugin's pysrc so we can access pydevd
            extraPath = new LinkedHashSet<String>();
            extraPath.add(PydevDebugPlugin.getPySrcPath().getAbsolutePath()); //Add this one as the first in the PYTHONPATH!
            extraPath.addAll(pythonpath);
        }
        String pythonpathEnv = SimpleRunner.makePythonPathEnvFromPaths(extraPath);
        String[] commandLine;
        switch (interpreterManager.getInterpreterType()) {

            case IInterpreterManager.INTERPRETER_TYPE_PYTHON:
                commandLine = SimplePythonRunner.makeExecutableCommandStr(interpreter.getExecutableOrJar(),
                        scriptWithinPySrc.getAbsolutePath(),
                        new String[] { String.valueOf(port), String.valueOf(clientPort) });
                break;

            case IInterpreterManager.INTERPRETER_TYPE_IRONPYTHON:
                commandLine = SimpleIronpythonRunner.makeExecutableCommandStr(interpreter.getExecutableOrJar(),
                        scriptWithinPySrc.getAbsolutePath(),
                        new String[] { String.valueOf(port), String.valueOf(clientPort) });
                break;

            case IInterpreterManager.INTERPRETER_TYPE_JYTHON:
                String vmArgs = PydevDebugPlugin.getDefault().getPreferenceStore()
                        .getString(PydevConsoleConstants.INTERACTIVE_CONSOLE_VM_ARGS);

                commandLine = SimpleJythonRunner.makeExecutableCommandStrWithVMArgs(interpreter.getExecutableOrJar(),
                        scriptWithinPySrc.getAbsolutePath(), pythonpathEnv, vmArgs, new String[] {
                                String.valueOf(port), String.valueOf(clientPort) });
                break;

            case IInterpreterManager.INTERPRETER_TYPE_JYTHON_ECLIPSE:
                commandLine = null;
                break;

            default:
                throw new RuntimeException(
                        "Expected interpreter manager to be python or jython or iron python related.");
        }

        if (interpreterManager.getInterpreterType() == IInterpreterManager.INTERPRETER_TYPE_JYTHON_ECLIPSE) {
            process = new JythonEclipseProcess(scriptWithinPySrc.getAbsolutePath(), port, clientPort);

        } else {
            String[] env = SimpleRunner.createEnvWithPythonpath(pythonpathEnv, interpreter.getExecutableOrJar(),
                    interpreterManager, nature);
            process = SimpleRunner.createProcess(commandLine, env, null);
        }

        IProcess newProcess = new PydevSpawnedInterpreterProcess(launch, process, interpreter.getNameForUI(), null);

        launch.addProcess(newProcess);

        return new PydevConsoleLaunchInfo(launch, process, clientPort, interpreter, null);
    }
View Full Code Here


    assertEquals(reflistener, listener);
  }

  @Test
  public void testRemoveSessionsFor1() {
    ILaunch launch0 = new Launch(null, null, null);
    ILaunch launch1 = new Launch(null, null, null);
    ICoverageSession s0 = new DummySession();
    ICoverageSession s1 = new DummySession();
    manager.addSession(s0, false, launch0);
    manager.addSession(s1, true, launch1);
    listener.clear();
View Full Code Here

    assertEquals(reflistener, listener);
  }

  @Test
  public void testRemoveSessionsFor2() {
    ILaunch launch0 = new Launch(null, null, null);
    ILaunch launch1 = new Launch(null, null, null);
    ILaunch launch2 = new Launch(null, null, null);
    ICoverageSession s0 = new DummySession();
    ICoverageSession s1 = new DummySession();
    manager.addSession(s0, false, launch0);
    manager.addSession(s1, true, launch1);
    listener.clear();
View Full Code Here

    assertEquals(reflistener, listener);
  }

  @Test
  public void testRemoveSessionsFor3() {
    ILaunch launch0 = new Launch(null, null, null);
    ILaunch launch1 = new Launch(null, null, null);
    ICoverageSession s0 = new DummySession();
    ICoverageSession s1 = new DummySession();
    ICoverageSession s2 = new DummySession();
    manager.addSession(s0, true, launch0);
    manager.addSession(s1, true, launch1);
View Full Code Here

TOP

Related Classes of org.eclipse.debug.core.Launch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.