diff --git a/src/main/starlark/builtins_bzl/common/java/proto/java_lite_proto_library.bzl b/src/main/starlark/builtins_bzl/common/java/proto/java_lite_proto_library.bzl index 56afa3f41c0dca..fbe4f387dda8c9 100644 --- a/src/main/starlark/builtins_bzl/common/java/proto/java_lite_proto_library.bzl +++ b/src/main/starlark/builtins_bzl/common/java/proto/java_lite_proto_library.bzl @@ -15,8 +15,8 @@ """A Starlark implementation of the java_lite_proto_library rule.""" load(":common/java/java_semantics.bzl", "semantics") +load(":common/java/proto/java_proto_library.bzl", "JavaProtoAspectInfo", "java_compile_for_protos") load(":common/proto/proto_common.bzl", "ProtoLangToolchainInfo", proto_common = "proto_common_do_not_use") -load(":common/java/proto/java_proto_library.bzl", "JavaProtoAspectInfo", "bazel_java_proto_library_rule", "java_compile_for_protos") PROTO_TOOLCHAIN_ATTR = "_aspect_proto_toolchain_for_javalite" @@ -106,13 +106,20 @@ def _rule_impl(ctx): else: proguard_provider_specs = ProguardSpecProvider(depset()) - java_info, DefaultInfo, OutputGroupInfo = bazel_java_proto_library_rule(ctx) + java_info = java_common.merge([dep[JavaInfo] for dep in ctx.attr.deps], merge_java_outputs = False) + + transitive_src_and_runtime_jars = depset(transitive = [dep[JavaProtoAspectInfo].jars for dep in ctx.attr.deps]) + transitive_runtime_jars = depset(transitive = [java_info.transitive_runtime_jars]) + java_info = semantics.add_constraints(java_info, ["android"]) return [ java_info, - DefaultInfo, - OutputGroupInfo, + DefaultInfo( + files = transitive_src_and_runtime_jars, + runfiles = ctx.runfiles(transitive_files = transitive_runtime_jars), + ), + OutputGroupInfo(default = depset()), proguard_provider_specs, ] diff --git a/src/main/starlark/builtins_bzl/common/java/proto/java_proto_library.bzl b/src/main/starlark/builtins_bzl/common/java/proto/java_proto_library.bzl index 09690f027282ce..334eeba5d948d6 100644 --- a/src/main/starlark/builtins_bzl/common/java/proto/java_proto_library.bzl +++ b/src/main/starlark/builtins_bzl/common/java/proto/java_proto_library.bzl @@ -149,7 +149,6 @@ def bazel_java_proto_library_rule(ctx): Returns: ([JavaInfo, DefaultInfo, OutputGroupInfo]) """ - java_info = java_common.merge([dep[JavaInfo] for dep in ctx.attr.deps], merge_java_outputs = False) transitive_src_and_runtime_jars = depset(transitive = [dep[JavaProtoAspectInfo].jars for dep in ctx.attr.deps])