Skip to content

Commit

Permalink
Add the simple name of the extension class to the filename of the con…
Browse files Browse the repository at this point in the history
…figuration proto, to avoid collisions.

PiperOrigin-RevId: 653787033
Change-Id: Ic928e62fe27dd4ea8b83e62340f4c5d254746d0d
  • Loading branch information
A Googler authored and copybara-github committed Jul 18, 2024
1 parent eaa8d13 commit 126fc66
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion provider/extension/textproto.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ def extension_to_textproto(ctx, extension):
"\n".join(['jar {{\n path: "{}"\n}}'.format(x.short_path) for x in extension.binary]),
extension.text_proto.replace("\n", "\\n"),
)
name = extension.extension_target.split(":")[-1] + "_extension.textproto"

# Make the filename a bit more interesting than the pure target name, without dragging in the
# entire target path (which might bump into Bazel or filesystem limits).
name = "{}_{}_extension.textproto".format(
extension.java_class.split(".")[-1],
extension.extension_target.split(":")[-1],
)
file = ctx.actions.declare_file(name)
ctx.actions.write(
output = file,
Expand Down

0 comments on commit 126fc66

Please sign in to comment.