diff --git a/kt_jvm_grpc.bzl b/kt_jvm_grpc.bzl index af649a54..34d4d5cc 100644 --- a/kt_jvm_grpc.bzl +++ b/kt_jvm_grpc.bzl @@ -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],