jsbuild-eclipse icon indicating copy to clipboard operation
jsbuild-eclipse copied to clipboard

Build Explorer Tasks don't kill process

Open sergiomichels opened this issue 9 years ago • 6 comments

I'm using the Build Explorer to run the Grunt embedded http server, but using the red square don't kill the process. It is possible to listen to the Process and kill his childs?

sergiomichels avatar Apr 09 '15 22:04 sergiomichels

You mean that you start grunt task https://www.npmjs.com/package/grunt-http-server

I don't know this task. I have tried to start it with a DOS command and it starts server and it seems that the server stops after? Could you share your project please. Thanks!

angelozerr avatar Apr 10 '15 14:04 angelozerr

Sorry for the late reply! I did not see the notification. Steps to reproduce

  1. Create a project with yeoman angular generator yo angular test-app
  2. Import in Eclipse, converting for Tern project, and using the Grunt module.
  3. Use the Gruntfile.js in the Build Explorer view
  4. Run the serve grunt task (Run As > Grunt Task). At this point the browser will open with the index page
  5. Stop with Eclipse's red square

With that, the node process is still alive, and the port is occupied.

sergiomichels avatar May 12 '15 01:05 sergiomichels

@sergiomichels I don't know yeoman, is it possible to share your project with your github?

angelozerr avatar May 12 '15 07:05 angelozerr

@angelozerr Maybe you can use my sample project here. It is generated with yeoman and angular generator https://github.com/jabby/sample-4-angularjs-eclipse

It's not a up-to-date version but I think the problem describe by @sergiomichels will happen.

jabby avatar May 12 '15 08:05 jabby

I have the same issue...

This problem happens when a gulp task which includes, for example, launching development server such as Browser Sync, from "Build Explorer" in Eclipse.

This is sample gulpfile.js:

var gulp = require('gulp');
var bs = require('browser-sync').create();

gulp.task('server', function() {
  bs.init({
    port: 3000
  });
});

The Browser Sync proccess can be killed by "Ctrl-C" when I run this gulp task from CLI such as command prompt in Windows environment. The gulp task "server" is killed at the same time.

But Running this task from "Build Explorer", Eclipse's red square might stop the gulp task, but NEVER kill the Browser Sync proccess...

ytkj avatar Dec 11 '15 18:12 ytkj

Thanks @ytkj for your simple sample. It seems that there are a problem with subprocess. Some ideas:

  • http://stackoverflow.com/questions/6356340/killing-a-process-using-java
  • https://github.com/jerboaa/linuxtools/blob/master/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/ProfileLaunchConfigurationDelegate.java

I'm very busy with tern.java. Any contribution are welcome!

angelozerr avatar Dec 11 '15 19:12 angelozerr