please
please copied to clipboard
Add buildlabel function
This function facilitates the creation and modification of labels in bulk or for obtaining the full label.
It also enables referencing other packages and subrepos relatively from the current one using '../' resolution.
Examples:
buildlabel(target=genrule(name="xxx", ...))->["///subrepo//pkg:xxx"]buildlabel([":a", ":b"], out="file")->["///subrepo//pkg:a|file", "///subrepo//pkg:b|out"]buildlabel(["subdir", "../uppkg"], target="build")->["///subrepo//pkg/subdir:build", "///subrepo//uppkg:build"]vis("*")->["PUBLIC"]vis("//anotherpkg/...")->["/////anotherpkg/..."]
More examples can be found in the test file.
What would be really nice is the addition of a python type label that would be returned by build_rule this would clearly separate normal strings and label ones.