From 1b5bc936be8ab8a1b53b76eb76405644b8c7b6e1 Mon Sep 17 00:00:00 2001 From: ramya Date: Thu, 18 Jul 2024 21:00:47 -0700 Subject: [PATCH 1/3] Add config output jars to current_jars --- jar_jar_aspect.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jar_jar_aspect.bzl b/jar_jar_aspect.bzl index 0d570f3..c68900b 100644 --- a/jar_jar_aspect.bzl +++ b/jar_jar_aspect.bzl @@ -69,7 +69,7 @@ def _jar_jar_aspect_impl(target, ctx): 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]) + current_jars.extend([e.class_jar for e in target[ConfigJavaInfo].config_java_info.java_outputs]) toolchain_cfg = ctx.toolchains["//toolchains:toolchain_type"] rules = toolchain_cfg.rules.files.to_list()[0] duplicate_to_warn = toolchain_cfg.duplicate_class_to_warn From 2a95862af2ac97249c2c0abfe3adc8a058201c5a Mon Sep 17 00:00:00 2001 From: ramya Date: Thu, 18 Jul 2024 22:33:01 -0700 Subject: [PATCH 2/3] fix handling list of deps --- jar_jar_aspect.bzl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jar_jar_aspect.bzl b/jar_jar_aspect.bzl index c68900b..462ae92 100644 --- a/jar_jar_aspect.bzl +++ b/jar_jar_aspect.bzl @@ -68,8 +68,9 @@ def _jar_jar_aspect_impl(target, ctx): 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]) + for config in target[ConfigJavaInfo].config_java_info: + java_info_runtime_deps.append(config.config_java_info) + current_jars.extend([e.class_jar for e in config.config_java_info.java_outputs]) toolchain_cfg = ctx.toolchains["//toolchains:toolchain_type"] rules = toolchain_cfg.rules.files.to_list()[0] duplicate_to_warn = toolchain_cfg.duplicate_class_to_warn From 89537788e535f9fd11ea6c266debdf70ab37a021 Mon Sep 17 00:00:00 2001 From: ramya Date: Fri, 19 Jul 2024 16:51:34 +0000 Subject: [PATCH 3/3] rename --- jar_jar_aspect.bzl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jar_jar_aspect.bzl b/jar_jar_aspect.bzl index 462ae92..7c551be 100644 --- a/jar_jar_aspect.bzl +++ b/jar_jar_aspect.bzl @@ -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): @@ -67,10 +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: - for config in target[ConfigJavaInfo].config_java_info: - java_info_runtime_deps.append(config.config_java_info) - current_jars.extend([e.class_jar for e in config.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]) toolchain_cfg = ctx.toolchains["//toolchains:toolchain_type"] rules = toolchain_cfg.rules.files.to_list()[0] duplicate_to_warn = toolchain_cfg.duplicate_class_to_warn