-
Notifications
You must be signed in to change notification settings - Fork 213
Glob nodes #1722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glob nodes #1722
Conversation
|
||
/// A node representing a glob ran from a builder. | ||
/// | ||
/// The [id] must always be unique to a given package, phase, and glob |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this constructor generate the id from package/phase/pattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could but we need to generate these outside of the constructor to check for their existence in the graph as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add it as a static method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return node.isReadable && node.isValidInput; | ||
} | ||
|
||
FutureOr<dynamic> _ensureAssetIsBuilt(AssetNode node) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be FutureOr<void>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
doAfter(_updateGlobNodeIfNecessary(globNode), (_) => globNode)); | ||
} | ||
|
||
FutureOr<Null> _updateGlobNodeIfNecessary(GlobAssetNode globNode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FutureOr<void>
(we'll need to start fixing this elsewhere, but shouldn't introduce new cases)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
globNode.results = actualMatches; | ||
|
||
globNode.state = NodeState.upToDate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cascade operator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Fixes #1702
GlobAssetNode
, and a new interface (NodeWithInputs
) for nodes that have some inputs and an invalidation state.findAssets
, the glob node gets as inputs all the available nodes, and is invalidated just like any other generated node when those inputs are invalidated.