Add proto toolchains as dependencies and collect runtime jar in the aspect #5222
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.
Add proto toolchains as dependencies and collect runtime jar in the aspect
Introduces ImplicitDepsProvider, which stores a mapping of rule types to implicit dependencies that need to be added to targets of the rule type (for the kotlin proto rule, this is determined dynamically according to the "variant" attribute), and augments the query proto during summarization. These labels can be found in the query output itself via "rule-input" fields of each target.
Adds attributes to the build_deps aspect so these dependencies can be reached for protos. This required adjusting the logic to allow traversal to go through targets without JavaInfo (the proto toolchain targets do not have a JavaInfo provider, but their "runtime" attribute is the java_library the IDE needs for resolving base classes.
Adds proto libraries as JAVA_RULE_TYPES in BlazeQueryParser so their deps are adequately reflected in the IDE.
For current query sync projects, this does not change what deps are built (as the runtime jars are picked up in the transitive deps for in-project proto libraries, which are "always build"), but it ensures that the runtime jars are marked as dependencies and built even if the ide doesn't need to build in-project protos.