Commit a36916c7 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Adding possibility to runs several sequential external tools waiting for

completion, preparing to communicate with external server.
parent 0c056d60
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
/com
/BuildParamsItem.class

icons/gtkwave.png

0 → 100644
+835 B
Loading image diff...

icons/python.png

0 → 100644
+2.99 KiB
Loading image diff...
+2 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ public class LaunchCore {
        if (!saveAllEditors(true)) {
            return;
        }
        
    System.out.println("launchInBackground, JOB_NAME="+JOB_NAME);    
        Job job = new Job(JOB_NAME) {
            public IStatus run(final IProgressMonitor monitor) {
                try {
@@ -293,6 +293,7 @@ public class LaunchCore {
        if (!saveAllEditors(true)) {
            return;
        }
        System.out.println("launchInForeground, JOB_NAME="+JOB_NAME);    

        IRunnableWithProgress runnable = new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException {
+21 −40
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
package com.elphel.vdt.core.launching;


import java.util.ArrayList;
import java.util.List;

import org.eclipse.core.runtime.CoreException;
@@ -49,6 +48,8 @@ public class VDTLaunchConfigurationDelegate implements ILaunchConfigurationDeleg
                         ) throws CoreException
                         
    {
    	VDTRunner runner = VDTLaunchUtil.getRunner();

        if (monitor == null) {
            monitor = new NullProgressMonitor();
        }
@@ -71,21 +72,14 @@ public class VDTLaunchConfigurationDelegate implements ILaunchConfigurationDeleg
        // resolve working directory
        runConfig.setWorkingDirectory(VDTLaunchUtil.getWorkingDirectory(configuration));
        runConfig.setProjectPath(VDTLaunchUtil.getProjectPath(configuration));
        runConfig.setConfiguration(configuration); // to be resumed
        
        runConfig.setLaunch(launch); // to be resumed
        runConfig.setMonitor(monitor); // to be resumed
        
        // done the half of creating arguments phase
        monitor.worked(1);  

        // resolve arguments
        List<String> arguments = VDTLaunchUtil.getArguments(configuration);
        
        // get tool is a shell 
        boolean isShell=VDTLaunchUtil.getIsShell(configuration);
        
        // get patterns for Error parser
        String patternErrors=  VDTLaunchUtil.getPatternErrors(configuration);
        String patternWarnings=VDTLaunchUtil.getPatternWarnings(configuration);
        String patternInfo=    VDTLaunchUtil.getPatternInfo(configuration);

        // check for cancellation
        if (monitor.isCanceled()) {
            return;
@@ -93,8 +87,6 @@ public class VDTLaunchConfigurationDelegate implements ILaunchConfigurationDeleg
        // done the creating arguments phase
        monitor.worked(2);  
                
        // resolve resources
//        List<String> resources = VDTLaunchUtil.getResources(configuration);
        
        // check for cancellation
        if (monitor.isCanceled()) {
@@ -104,34 +96,22 @@ public class VDTLaunchConfigurationDelegate implements ILaunchConfigurationDeleg
        monitor.worked(3);  

        // resolve arguments
        List<String> toolArguments = new ArrayList<String>();
        if (arguments != null)
            toolArguments.addAll(arguments);
//        if (resources != null)
//            toolArguments.addAll(resources);
        
        runConfig.setToolArguments((String[])toolArguments.toArray(new String[toolArguments.size()]));
        runConfig.setIsShell(isShell);
        runConfig.setPatternErrors(patternErrors);
        
    	runConfig.setIsShell(VDTLaunchUtil.getIsShell(configuration));
    	runConfig.setPatternErrors(VDTLaunchUtil.getPatternErrors(configuration));
    	runConfig.setToolName(VDTLaunchUtil.getToolName(configuration));
        runConfig.setPatternWarnings(patternWarnings);
        runConfig.setPatternInfo(patternInfo);
    	runConfig.setPatternWarnings(VDTLaunchUtil.getPatternWarnings(configuration));
    	runConfig.setPatternInfo(VDTLaunchUtil.getPatternInfo(configuration));
    	runConfig.setToolProjectPath(VDTLaunchUtil.getToolProjectPath(configuration));
        
    	runConfig.setBuildStep(0);
    	List<String> controlFiles = VDTLaunchUtil.getControlFiles(configuration);
        
    	runConfig.setControlFiles((String[])controlFiles.toArray(new String[controlFiles.size()]));
   	
        // Launch the configuration - 1 unit of work
        VDTRunner runner = VDTLaunchUtil.getRunner();
        runner.run(runConfig, launch, monitor);
        
        // check for cancellation
        if (monitor.isCanceled()) {
        String consoleName=VDTRunner.renderProcessLabel(runConfig.getToolName());
        runner.saveUnfinished(consoleName, runConfig );
        runner.resumeLaunch(consoleName);
        return;
    }
        monitor.done();
    }

    public void launch( ILaunchConfiguration configuration
                      , String mode
@@ -149,4 +129,5 @@ public class VDTLaunchConfigurationDelegate implements ILaunchConfigurationDeleg
        }
    }

 
} // class VDTLaunchConfigurationDelegate
Loading