Is making a “node exec” task generally available p...
# javascript
r
Is making a “node exec” task generally available part of the js plugin plan (for running things installed by an npm dependency)? I have a few node programs I need to run, but to do that in gradle right now I’m juggling both the kotlin auto-installed node and the “com.github.node-gradle.node” plugin… which seems silly and causes multiple node installs.
c
If you have node installed locally, just set up a normal
Exec
task to run the node commands. Should be easy enough to pass project properties to it for a dynamic “node run” type command
r
oh yeah, that sort of thing is easy. But as much as possible I prefer my gradle builds to auto install specific versions of things so in all environments things work the same way
that technique was where i started years ago 🙂 transitioned to the node gradle plugin to make things more systemized and rely less on environment config… now I’d like to make another jump!
👍 1
r
I'm using this function to get the path of the node binary installed by kotlin plugin: https://github.com/rjaros/kvision-examples/blob/master/template/build.gradle.kts#L107-L114 and then just use
Exec
task with
executable
parameter: https://github.com/rjaros/kvision-examples/blob/master/template/build.gradle.kts#L161
r
not bad!
I’ll have to give that a shot later. Still hope an official task gets put in down-the-road so there’s less fuss. 😉
Do you know what the correct tasks are to depend on in order to ensure that the binary is there by runtime? @Robert Jaros
r
I'm using
dependsOn("kotlinNpmInstall")
👍 1
But it's all changing with new Kotlin versions every time lately ... 😉