Merge pull request #177 from laurentlb/master

Update upb_proto_library.bzl for Bazel compatibility
pull/13171/head
Joshua Haberman 6 years ago committed by GitHub
commit d5137134e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      bazel/upb_proto_library.bzl

@ -42,7 +42,7 @@ def _generate_output_file(ctx, src, extension):
else:
real_short_path = paths.relativize(src.short_path, ctx.label.package)
output_filename = paths.replace_extension(real_short_path, extension)
ret = ctx.new_file(ctx.genfiles_dir, output_filename)
ret = ctx.actions.declare_file(output_filename)
return ret
def _filter_none(elems):
@ -149,12 +149,13 @@ _WrappedGeneratedSrcs = provider(fields = ["srcs"])
def _compile_upb_protos(ctx, proto_info, proto_sources, ext):
srcs = [_generate_output_file(ctx, name, ext + ".c") for name in proto_sources]
hdrs = [_generate_output_file(ctx, name, ext + ".h") for name in proto_sources]
transitive_sets = list(proto_info.transitive_descriptor_sets)
transitive_sets = proto_info.transitive_descriptor_sets.to_list()
ctx.actions.run(
inputs = depset(
direct = [ctx.executable._upbc, proto_info.direct_descriptor_set],
direct = [proto_info.direct_descriptor_set],
transitive = [proto_info.transitive_descriptor_sets],
),
tools = [ctx.executable._upbc],
outputs = srcs + hdrs,
executable = ctx.executable._protoc,
arguments = [

Loading…
Cancel
Save