Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file paths in generated source jars #503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions 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 Expand Up @@ -279,7 +282,7 @@ def _kt_jvm_proto_library_helper_impl(ctx):
args = ctx.actions.args()
args.add("c")
args.add(ctx.outputs.srcjar)
args.add_all([gen_src_dir])
args.add_all([gen_src_dir], map_each = _map_relative_path)
ctx.actions.run(
arguments = [args],
executable = ctx.executable._zip,
Expand Down
Loading