Skip to content

Commit

Permalink
Add launcher resolution for bazel Starlark java_binary
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 488022324
Change-Id: I8cde2da82dc16c58512471cfa4d75b2500c04a12
  • Loading branch information
hvadehra authored and copybara-github committed Nov 12, 2022
1 parent a5f0b8d commit 830120a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/starlark/builtins_bzl/common/java/java_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,17 @@ def _get_main_class(ctx):
main_class = helper.primary_class(ctx)
return main_class

def _get_launcher_info(ctx):
launcher = helper.launcher_artifact_for_target(ctx)
return struct(
launcher = launcher,
unstripped_launcher = launcher,
runfiles = [],
runtime_jars = [],
jvm_flags = [],
classpath_resources = [],
)

BASIC_JAVA_BINARY_ATTRIBUTES = merge_attrs(
BASIC_JAVA_LIBRARY_WITH_PROGUARD_IMPLICIT_ATTRS,
{
Expand Down Expand Up @@ -569,7 +580,7 @@ def _bazel_java_binary_impl(ctx):
if coverage_config:
main_class = coverage_config.main_class

launcher_info = None
launcher_info = _get_launcher_info(ctx)
executable = None
feature_config = helper.get_feature_config(ctx)
strip_as_default = helper.should_strip_as_default(ctx, feature_config)
Expand Down

0 comments on commit 830120a

Please sign in to comment.