Skip to content

Commit

Permalink
Fix file paths in generated source jars
Browse files Browse the repository at this point in the history
  • Loading branch information
alexenvoy committed Jan 5, 2024
1 parent 253c24f commit 4a89cfc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kt_jvm_grpc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ def _invoke_generator(ctx, proto_dep, output_dir):
progress_message = "Generating Kotlin gRPC extensions for %s" % proto_dep.label,
)

def _map_relative_path(file):
return "{dest}={src}".format(dest = file.tree_relative_path, src = file.path)

def _build_srcjar(ctx, proto_dep, input_dir, source_jar):
args = ctx.actions.args()
args.add("c")
args.add(source_jar.path)
args.add_all(depset([input_dir]))
args.add_all(depset([input_dir]), map_each = _map_relative_path)
ctx.actions.run(
outputs = [source_jar],
inputs = [input_dir],
Expand Down

0 comments on commit 4a89cfc

Please sign in to comment.