From 138f5eaedcc2873c3a30a5b3c0c07b5aa56e2c26 Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Mon, 18 Sep 2023 15:29:03 -0600 Subject: [PATCH] Fix deprecated options in pack_sources And declare the file ourselves --- rules/private/phases/phase_javainfo.bzl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rules/private/phases/phase_javainfo.bzl b/rules/private/phases/phase_javainfo.bzl index 359e2f51..15b7abbc 100644 --- a/rules/private/phases/phase_javainfo.bzl +++ b/rules/private/phases/phase_javainfo.bzl @@ -49,11 +49,16 @@ def phase_javainfo(ctx, g): java_toolchain = find_java_toolchain(ctx, ctx.attr._java_toolchain), ) + source_jar_name = ctx.outputs.jar.basename.replace(".jar", "-src.jar") + output_source_jar = ctx.actions.declare_file( + source_jar_name, + sibling = ctx.outputs.jar, + ) + source_jar = java_common.pack_sources( ctx.actions, - output_jar = ctx.outputs.jar, + output_source_jar = output_source_jar, sources = ctx.files.srcs, - host_javabase = find_java_runtime_toolchain(ctx, ctx.attr._host_javabase), java_toolchain = find_java_toolchain(ctx, ctx.attr._java_toolchain), )