From c1de292d610918f17e2d1571d8ae7808e085353c Mon Sep 17 00:00:00 2001 From: Googler Date: Tue, 6 Dec 2022 06:40:05 -0800 Subject: [PATCH] Fix licenses error inside java_import Use the same logic for java_import.licenses as for the java_library. PiperOrigin-RevId: 493290036 Change-Id: Id8f99991a711c2d0b94758afb550385629e5cbd0 --- src/main/starlark/builtins_bzl/common/java/java_import.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/starlark/builtins_bzl/common/java/java_import.bzl b/src/main/starlark/builtins_bzl/common/java/java_import.bzl index 3cabd559e64305..453f2ce4779588 100644 --- a/src/main/starlark/builtins_bzl/common/java/java_import.bzl +++ b/src/main/starlark/builtins_bzl/common/java/java_import.bzl @@ -252,7 +252,7 @@ JAVA_IMPORT_ATTRS = merge_attrs( allow_files = True, ), # Additional attrs - "licenses": attr.string_list(), + "licenses": attr.license() if hasattr(attr, "license") else attr.string_list(), "_java_toolchain_type": attr.label(default = semantics.JAVA_TOOLCHAIN_TYPE), }, )