Turn off gradle deamon for a task from a plugin

(pmendelski) #1

There is a gradle-node-plugin. It is a very useful gradle plugin that helps to execute node scripts.

One of my tasks in gradle starts an infinite node task called “watch”. This task stops on Ctrl + c. Unfortunately when I kill gradle task the SIGKILL does not propagate to the npm task.

I have created an issue on plugin’s github repository. Although it seem to be a limitation of gradle itself.

Has anyone faced this problem/limitation before?


Looks like there is a very detailed explanation about Gradle daemon / client behaviour on Ctrl + C in related Gradle issue: https://github.com/gradle/gradle/issues/1128#issuecomment-271299381. Although it is about JavaExec task, gradle-node-plugin uses similar mechanism to launch Node. Perhaps implementation for this issue could cover other cases of exec usage, including gradle-node-plugin.