Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add config output jars to current_jars #53

Merged
merged 3 commits into from
Jul 19, 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
11 changes: 6 additions & 5 deletions jar_jar_aspect.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ShadedJars = provider(fields = [
"transitive_shaded",
])

ConfigJavaInfo = provider(fields = [
"config_java_info"
ExtraDependencyProviders = provider(fields = [
"extra_java_deps"
])

def merge_shaded_jars_info(shaded_jars):
Expand Down Expand Up @@ -67,9 +67,10 @@ def _jar_jar_aspect_impl(target, ctx):
current_jars.extend([e.class_jar for e in target[JavaInfo].java_outputs])
java_info_runtime_deps = []

if ConfigJavaInfo in target:
java_info_runtime_deps.append(target[ConfigJavaInfo].config_java_info)
#current_jars.extend([e.class_jar for e in target[ConfigJavaInfo].config_java_info.java_outputs])
if ExtraDependencyProviders in target:
for config in target[ExtraDependencyProviders].extra_java_deps:
java_info_runtime_deps.append(config.extra_java_deps)
current_jars.extend([e.class_jar for e in config.extra_java_deps.java_outputs])
Comment on lines +72 to +73
Copy link
Contributor

@eed3si9n eed3si9n Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are somewhat conflicting adds.

  1. java_info_runtime_deps would bypass the jarjar (Jar Jar Abrams), and will NOT be shaded thus I've suggested the name ConfigJavaInfo indicating this should contain text files only.
  2. current_jars would go through the jarjar, and the contents will be subject to jarjar rule. I guess we've confirmed that JSON would pass through, so should be ok.

I think having both are wrong here.

toolchain_cfg = ctx.toolchains["//toolchains:toolchain_type"]
rules = toolchain_cfg.rules.files.to_list()[0]
duplicate_to_warn = toolchain_cfg.duplicate_class_to_warn
Expand Down