Skip to content

Commit dc2adf4

Browse files
authored
pkl_java_deps: convert string types we're passed into Label (#84)
`Label()` is idempotent; it returns existing Labels unchanged, converting strings to Labels. This deals with the following error: ``` Error in depset: cannot add an item of type 'Label' to a depset of 'string' ```
1 parent eb2aab3 commit dc2adf4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkl/private/pkl_codegen_java.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ def pkl_java_library(name, srcs, module_path = [], generate_getters = None, deps
142142
tags = tags,
143143
)
144144

145+
# As this is a macro, make sure we're only dealing with labels.
146+
pkl_java_deps = [Label(dep) for dep in pkl_java_deps]
147+
145148
# Ensure that there are no duplicate entries in the deps
146149
all_deps = depset(
147150
pkl_java_deps + [native.package_relative_label(m) for m in module_path],

0 commit comments

Comments
 (0)