rules_typescript_proto icon indicating copy to clipboard operation
rules_typescript_proto copied to clipboard

Support Well Known Types

Open Dig-Doug opened this issue 6 years ago • 5 comments

Originally:

The well known protos are in an external repository so we need to add some logic to handle the different paths.

Dig-Doug avatar Oct 21 '19 14:10 Dig-Doug

@Dig-Doug — I just wanted to let you know that #11 appears mostly compatible with the changes from your nested directories fix for #142. The only thing that needs to be done differently is clearing relative_path if workspace_root isn't empty, i.e.

for src in target[ProtoInfo].direct_sources:
    relative_path = _get_path_relative_to_build(ctx, src)
    # workspace_root is empty for our local workspace, or external/other_workspace
    # for @other_workspace//
    if ctx.label.workspace_root == "":
        file_name = src.basename[:-len(src.extension) - 1]
    else:
        relative_path = "" # <--- 
        file_name = _proto_path(src)[:-len(src.extension) - 1]

It looks like there have been some changes to the directory structure, too. @kellycampbell, do you mind updating your PR accordingly? Otherwise, I can certainly make my own that incorporates your changes. Thank you!

pfgallagher avatar Feb 18 '21 18:02 pfgallagher

I was also bit by this and would be happy to contribute toward the functionality.

mc0 avatar Feb 18 '21 20:02 mc0

Thanks @pfgallagher - If you could submit a PR that would be awesome. #11 seems to be stale.

Dig-Doug avatar Feb 19 '21 12:02 Dig-Doug

Sure thing; should be able to take a look sometime this weekend.

pfgallagher avatar Feb 19 '21 14:02 pfgallagher

Hi @pfgallagher, thanks for your PR. This fix is essential for my usecase. Are you still interested in merging?

tsawada avatar Jun 02 '21 05:06 tsawada