Skip to content

Support running Node tools in the Configuration Phase, and multiple tools per task by providing ValueSource implementations #334

Description

@adam-enko

Feature Request: Provide ValueSource implementations for running Node tools

Summary

Currently Gradle Plugin for Node has a 'task based' approach for running Node tools. One task can run one Node tool a single time. This is good for simple projects.

However, I would like to use Node tools in more advanced use cases:

  1. Use Node tools before task execution, during the configuration phase.

    As part of Make npmInstall and npmSetup tasks cacheable #81 I proposed a way to make npm install cacheable, but this would require running npm in the configuration phase (to manually add dependencies to the cache). Using a ValueSource would make this trivial.

  2. Support executing the same tool multiple times with different arguments or running different tools sequentially in the same task.

Proposal

Provide implementations of ValueSource so users can run node tools on-demand.

The existing task-based execution approach would still work as-is, but to avoid duplication it would be best to re-write the internal implementation to use a 'ValueSource first' approach. The existing tasks will have the same API surface (so there is no change for users), but internally they will use ValueSources.

We can break up the implementation into smaller steps by migrating each Node tool individually.

I'd be happy to make a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions