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

Forward restricted_to and target_compatible_with attributes to rules #219

Merged
merged 1 commit into from
Dec 3, 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
24 changes: 24 additions & 0 deletions springboot/springboot.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ def springboot(
duplicate_class_allowlist = None, # deprecated
jvm_flags = "", # deprecated
data = [], # deprecated
restricted_to = [],
target_compatible_with = [],
):
"""Bazel rule for packaging an executable Spring Boot application.

Expand Down Expand Up @@ -502,6 +504,8 @@ def springboot(
deps_exclude_paths = deps_exclude_paths,
tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
)

# SUBRULE 2: GENERATE THE MANIFEST
Expand All @@ -516,6 +520,8 @@ def springboot(
outs = [genmanifest_out],
tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
toolchains = jartools_toolchains, # so that JAVABASE is computed
)

Expand All @@ -528,6 +534,8 @@ def springboot(
outs = [gengitinfo_out],
tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
stamp = 1,
)

Expand All @@ -538,6 +546,8 @@ def springboot(
app_dep = java_library,
tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
)

# SUBRULE 3: INVOKE THE BASH SCRIPT THAT DOES THE PACKAGING
Expand Down Expand Up @@ -578,6 +588,8 @@ def springboot(
],
tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
outs = [_get_springboot_jar_file_name(name)],
toolchains = jartools_toolchains, # so that JAVABASE is computed
visibility = visibility,
Expand All @@ -597,6 +609,8 @@ def springboot(
outs = [genbazelrunenv_out],
tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
)

# SUBRULE 4a: RUN THE DUPE CHECKER (if enabled)
Expand All @@ -614,6 +628,8 @@ def springboot(
out = "dupecheck_results.txt",
tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
)
dupecheck_rule_label = ":" + dupecheck_rule

Expand All @@ -632,6 +648,8 @@ def springboot(
out = "javaxdetect_results.txt",
tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
)
javaxdetect_rule_label = ":" + javaxdetect_rule

Expand All @@ -649,6 +667,8 @@ def springboot(
out = "bannedcheck_results.txt",
tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
)
bannedcheck_rule_label = ":" + bannedcheck_rule

Expand All @@ -665,6 +685,8 @@ def springboot(
runtime_deps = java_deps,
tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
)

if bazelrun_script == None:
Expand All @@ -689,6 +711,8 @@ def springboot(

tags = tags,
testonly = testonly,
restricted_to = restricted_to,
target_compatible_with = target_compatible_with,
visibility = visibility,
)

Expand Down