-
Notifications
You must be signed in to change notification settings - Fork 112
Make closure_js_library to take deps in provider on top of target #604
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
Conversation
|
could you do try to keep rest of the code same. |
for other providers we need to keep target format, for example https://github.com/comius/rules_closure/blob/daf6131a64793e4f684fb9658ce7b6e5726896fb/closure/compiler/closure_js_library.bzl#L168-L182 we can do this for closureJsProvider related though. |
Can't we do unfurl them in the same way: |
closure/private/defs.bzl
Outdated
| if type(dep) == "Target": | ||
| if not provider or provider in dep: | ||
| res.append(dep) | ||
| if type(provider) == "Provider" and provider in dep and hasattr(dep[provider], "exports"): |
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.
do we ever pass non provider as a provider here?
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.
yes, the default parameter is "", the function signature is
def unfurl(deps, provider = ""):
sometimes there is only one parameter without provider.
the cssDep also need to be a target here(plz see |
|
The unfurl is overloaded with multiple purposes and that makes a lot of things obscure. I did a refactoring around that, will send for review but first I sent you a cleanup for runfiles handling. |
I take some efforts to refactor the code to take only provider, in that approach, we need to change for all providers and
collect_runfilesanddata, this kind of break the concept of #599 that pass target everywhere. I think for now this small patch should help us to walk around the issue that closure_js_library only handles target(but j2cl pass provider).