node-gradle / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
602 stars 118 forks source link

support detection or install node #183

Open xenoterracide opened 3 years ago

xenoterracide commented 3 years ago

so gradle now supports configuring java like this, which will install a gradle version of java if the required version isn't already available. I think it would be cool to do that with node, instead of either/or

java {
  toolchain {
    languageVersion.set(JavaLanguageVersion.of(11))
  }
}
deepy commented 3 years ago

I think this functionality is Gradle internal and only supports the java toolchain, but ideally the same functionality should be exposed as an API so that we can just plug ourselves in there as a provider and get Gradle's help in figuring things out.

Or maybe we can re-implement their wheel, but yeah, this would be super-cool to get working

xenoterracide commented 3 years ago

yeah, I'm not certain that you can use their stuff, but you could do something like it probably. I would guess it's just a matter of searching the PATH seeing if the binary with the right version exists, and if not proceed to download. But maybe they have some internal api's that would make it easier for an arbitrary binary.

deepy commented 2 years ago

This may get split into multiple tasks, but for 3.3 I'll try getting the detection working