Skip to content

Commit

Permalink
If both java_library and java_package_configuration override the …
Browse files Browse the repository at this point in the history
…bootclasspath, the java_library override should be used

Follow-up to bazelbuild@d12959c

PiperOrigin-RevId: 689861371
Change-Id: If89f9d425e7b6559c1634bae867af8025faa62ec
  • Loading branch information
cushon authored and copybara-github committed Oct 25, 2024
1 parent 1bb3185 commit 3f70ca1
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,16 @@ def compile(
["-Abazel.repository=" + ctx.label.workspace_name],
order = "preorder",
))
system_override = False
system_bootclasspath = None
for package_config in java_toolchain._package_configuration:
if package_config.matches(ctx.label):
all_javac_opts.append(package_config.javac_opts)
if package_config.system:
if system_override:
if system_bootclasspath:
fail("Multiple system package configurations found for %s" % ctx.label)
bootclasspath = package_config.system
system_override = True
system_bootclasspath = package_config.system
if not bootclasspath:
bootclasspath = system_bootclasspath

all_javac_opts.append(depset(
["--add-exports=%s=ALL-UNNAMED" % x for x in add_exports],
Expand Down

0 comments on commit 3f70ca1

Please sign in to comment.