refactor(project): Add TaskDefinitions and task-level build signatures#1412
Open
RandomByte wants to merge 2 commits into
Open
refactor(project): Add TaskDefinitions and task-level build signatures#1412RandomByte wants to merge 2 commits into
RandomByte wants to merge 2 commits into
Conversation
ba93ab7 to
a35ade0
Compare
Extract the task-list construction out of TaskRunner into a new TaskDefinitions class which owns the project-type to build-definition switch, the standard task map, and the custom task validation and de-duplication loop. Each standard task in a build definition can expose an async `determineBuildSignature()` returning a string contribution; the fallback is `JSON.stringify(taskDef.options)`. Custom tasks expose the same via the `determineBuildSignature` named export of their module, surfaced through `Task#getDetermineBuildSignatureCallback`, and must declare specVersion >= 5.0 to use it. `getProjectSignature` mixes the aggregated string in alongside the existing inputs. Split ProjectBuildContext into a synchronous wiring phase (logger, TaskUtil, TaskDefinitions) and a static `create()` that resolves task signatures, computes the project signature, and constructs the ProjectBuildCache. `create()` parameters are reordered to `(buildContext, project, baseSignature, cacheManager)`. Add `TaskUtil#getReadOnlyInterface(specVersion)` for passing into the `determineBuildSignature` callback before the task has run.
a35ade0 to
250e4fc
Compare
matz3
reviewed
Jun 15, 2026
| * Factory method to create and fully initialize a ProjectBuildContext instance. | ||
| * | ||
| * Performs the async work that the constructor cannot: collecting task build signatures, | ||
| * computing the project build signature, and constructing the {@link ProjectBuildCache}. |
Member
There was a problem hiding this comment.
the link doesn't really work, does it?
| const tasks = new Map(); | ||
| for (let i = 0; i < projectCustomTasks.length; i++) { | ||
| // Add tasks one-by-one to keep order as defined in project configuration | ||
| await this._addCustomTask(projectCustomTasks[i], tasks); |
Member
There was a problem hiding this comment.
_addCustomTask does nothing async; could be changed to sync method, along with _getCustomTasks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract the task-list construction out of TaskRunner into a new
TaskDefinitions class which owns the project-type to build-definition
switch, the standard task map, and the custom task validation and
de-duplication loop.
Each standard task in a build definition can expose an async
determineBuildSignature()returning a string contribution; thefallback is
JSON.stringify(taskDef.options). Custom tasks expose thesame via the
determineBuildSignaturenamed export of their module,surfaced through
Task#getDetermineBuildSignatureCallback, and mustdeclare specVersion >= 5.0 to use it.
getProjectSignaturemixes theaggregated string in alongside the existing inputs.
Split ProjectBuildContext into a synchronous wiring phase (logger,
TaskUtil, TaskDefinitions) and a static
create()that resolves tasksignatures, computes the project signature, and constructs the
ProjectBuildCache.
create()parameters are reordered to(buildContext, project, baseSignature, cacheManager).Add
TaskUtil#getReadOnlyInterface(specVersion)for passing into thedetermineBuildSignaturecallback before the task has run.Also Include builder and fs version into project build signature.