Skip to content

Commit

Permalink
Add the necessary methods for FakeStarlarkAttrModuleApi.
Browse files Browse the repository at this point in the history
  • Loading branch information
lberki committed Oct 16, 2024
1 parent 42ff626 commit 39c8059
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,32 @@ public Descriptor labelListAttribute(
AttributeType.LABEL_LIST, toTrimmedString(doc), mandatory, allNameGroups, defaultList);
}

@Override
public Descriptor stringKeyedLabelDictAttribute(
Boolean allowEmpty,
Object defaultList,
Object doc,
Object allowFiles,
Object allowRules,
Sequence<?> providers,
Sequence<?> flags,
Boolean mandatory,
Object cfg,
Sequence<?> aspects,
StarlarkThread thread)
throws EvalException {
List<List<String>> allNameGroups = new ArrayList<>();
if (providers != null) {
allNameGroups = allProviderNameGroups(providers, thread);
}
return new FakeDescriptor(
AttributeType.LABEL_DICT_UNARY,
toTrimmedString(doc),
mandatory,
allNameGroups,
defaultList);
}

@Override
public Descriptor labelKeyedStringDictAttribute(
Boolean allowEmpty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ enum AttributeType {
STRING_LIST_DICT = 11;
OUTPUT = 12;
OUTPUT_LIST = 13;
LABEL_DICT_UNARY = 14;
}

// Representation of a Starlark rule definition.
Expand Down

0 comments on commit 39c8059

Please sign in to comment.