-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy querysync aspect code from repo studio-main to Google3
PiperOrigin-RevId: 697775331
- Loading branch information
1 parent
54de94b
commit baaf466
Showing
7 changed files
with
608 additions
and
323 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""Aspects to build and collect project's compose dependencies.""" | ||
|
||
load("@rules_java//java:defs.bzl", "JavaInfo") | ||
|
||
ComposeDependenciesInfo = provider( | ||
"The compose dependencies", | ||
fields = { | ||
"render_jars": "a list of render jars generated for project files and external dependencies", | ||
}, | ||
) | ||
|
||
def _package_compose_dependencies_impl(target, ctx): # @unused | ||
return [OutputGroupInfo( | ||
render_jars = target[ComposeDependenciesInfo].render_jars.to_list(), | ||
)] | ||
|
||
package_compose_dependencies = aspect( | ||
implementation = _package_compose_dependencies_impl, | ||
required_aspect_providers = [[ComposeDependenciesInfo]], | ||
) | ||
|
||
def _collect_compose_dependencies_impl(target, ctx): # @unused | ||
if JavaInfo not in target: | ||
return [ComposeDependenciesInfo( | ||
render_jars = depset(), | ||
)] | ||
return [ | ||
ComposeDependenciesInfo( | ||
render_jars = depset([], transitive = [target[JavaInfo].transitive_runtime_jars]), | ||
), | ||
] | ||
|
||
collect_compose_dependencies = aspect( | ||
implementation = _collect_compose_dependencies_impl, | ||
provides = [ComposeDependenciesInfo], | ||
attr_aspects = ["deps", "exports", "_android_sdk"], | ||
) |
Oops, something went wrong.