node-gradle / node-gradle/gradle-node-plugin

Allow NodeTask to be extended and exec to be overridden.

Open
#307 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Groovy
Stars
677
Forks
120
PR merge metrics
No merged PRs in 30d

Description

In https://github.com/node-gradle/gradle-node-plugin/blob/main/src/main/kotlin/com/github/gradle/node/task/NodeTask.kt#L90-L99 exec is not defined as an open method, which means that tasks that extend this cannot add functionality during the execution.

In our specific case, we are using node to run SCSS, and so want to clean the target directory before calling node to populate it. I can add a second TaskAction, but there is no guarantee that this will run first, which means that sometimes I delete everything after it has been generated. Which is also not the point ;-)

I can, of course, just delegate everything, that involves a lot of boilerplate, since the there quite a few properties that should be delegated across..

So, would it be possible to make exec an open method?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/main/kotlin/com/github/gradle/node/task/NodeTask.kt around lines 90-99 and inspect how the task execution action invokes exec. Confirm that subclasses can customize execution before Node runs, and verify the change without requiring delegation of all existing properties.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, nodejs
Domain
build-system, tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.