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

[7.1.0] Auto-create deploy jars for Bazel java_test targets if requested #20762

Merged
merged 2 commits into from
Jan 11, 2024
Merged
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
23 changes: 23 additions & 0 deletions src/main/starlark/builtins_bzl/common/java/java_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,29 @@ def basic_java_binary(
manifest_lines = ctx.attr.deploy_manifest_lines,
)

# "temporary" workaround for https://github.com/bazelbuild/intellij/issues/5845
extra_files = []
if is_test_rule_class and ctx.fragments.java.auto_create_java_test_deploy_jars():
extra_files.append(_auto_create_deploy_jar(ctx, internal_deploy_jar_info))

internal_deploy_jar_info = InternalDeployJarInfo(
java_attrs = java_attrs,
launcher_info = struct(
runtime_jars = launcher_info.runtime_jars,
launcher = launcher_info.launcher,
unstripped_launcher = launcher_info.unstripped_launcher,
),
shared_archive = shared_archive,
main_class = main_class,
coverage_main_class = coverage_main_class,
strip_as_default = strip_as_default,
stamp = ctx.attr.stamp,
hermetic = hasattr(ctx.attr, "hermetic") and ctx.attr.hermetic,
add_exports = add_exports,
add_opens = add_opens,
manifest_lines = ctx.attr.deploy_manifest_lines,
)

# "temporary" workaround for https://github.com/bazelbuild/intellij/issues/5845
extra_files = []
if is_test_rule_class and ctx.fragments.java.auto_create_java_test_deploy_jars():
Expand Down
Loading