Skip to content

Commit

Permalink
Do not instanatiate deploy jars for java_test
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 509496793
Change-Id: Ia902648c803880da876fe90d85585853465466ff
  • Loading branch information
hvadehra authored and copybara-github committed Feb 14, 2023
1 parent 99cff33 commit af4b48c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ def java_binary(**kwargs):
java_bin_nonexec,
java_bin_exec_no_launcher_flag,
java_bin_exec,
deploy_jars,
rule_deploy_jars = deploy_jars,
**kwargs
)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ the supplied value of the `create_executable` attribute.

load(":common/java/java_binary_deploy_jar.bzl", "DEPLOY_JAR_RULE_NAME_SUFFIX")

def register_java_binary_rules(rule_exec, rule_nonexec, rule_nolauncher, rule_customlauncher, rule_deploy_jars, is_test_rule_class = False, **kwargs):
def register_java_binary_rules(rule_exec, rule_nonexec, rule_nolauncher, rule_customlauncher, rule_deploy_jars = None, is_test_rule_class = False, **kwargs):
"""Registers the correct java_binary rule and deploy jar rule
Args:
Expand All @@ -45,7 +45,9 @@ def register_java_binary_rules(rule_exec, rule_nonexec, rule_nolauncher, rule_cu
else:
rule_exec(**kwargs)

if not kwargs.get("tags", []) or "nodeployjar" not in kwargs.get("tags", []):
if rule_deploy_jars and (
not kwargs.get("tags", []) or "nodeployjar" not in kwargs.get("tags", [])
):
deploy_jar_args = _filtered_dict(kwargs, _DEPLOY_JAR_RULE_ATTRS)
if is_test_rule_class:
deploy_jar_args["testonly"] = True
Expand Down

0 comments on commit af4b48c

Please sign in to comment.