aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/constraints/ConstraintSemantics.java7
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java4
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/AttributeSerializer.java11
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/BuildType.java9
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/ProtoUtils.java2
-rw-r--r--src/test/java/com/google/devtools/build/lib/syntax/TypeTest.java73
7 files changed, 2 insertions, 106 deletions
diff --git a/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java b/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java
index 2182269a83..fa53ca80e6 100644
--- a/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java
+++ b/src/main/java/com/google/devtools/build/docgen/RuleDocumentationAttribute.java
@@ -49,8 +49,6 @@ public class RuleDocumentationAttribute implements Comparable<RuleDocumentationA
.put(BuildType.LABEL_LIST, "List of <a href=\"../build-ref.html#labels\">labels</a>")
.put(BuildType.LABEL_DICT_UNARY,
"Dictionary mapping strings to <a href=\"../build-ref.html#labels\">labels</a>")
- .put(BuildType.LABEL_LIST_DICT,
- "Dictionary mapping strings to lists of <a href=\"../build-ref.html#labels\">labels</a>")
.put(BuildType.NODEP_LABEL, "<a href=\"../build-ref.html#name\">Name</a>")
.put(BuildType.NODEP_LABEL_LIST, "List of <a href=\"../build-ref.html#name\">names</a>")
.put(BuildType.OUTPUT, "<a href=\"../build-ref.html#filename\">Filename</a>")
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/constraints/ConstraintSemantics.java b/src/main/java/com/google/devtools/build/lib/analysis/constraints/ConstraintSemantics.java
index 2c2f1f145f..398056c2e1 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/constraints/ConstraintSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/constraints/ConstraintSemantics.java
@@ -783,13 +783,6 @@ public class ConstraintSemantics {
for (List<Label> labels : ((BuildType.Selector<List<Label>>) select).getEntries().values()) {
set.addAll(labels);
}
- } else if (type == BuildType.LABEL_LIST_DICT) {
- for (Map<String, List<Label>> mapEntry :
- ((BuildType.Selector<Map<String, List<Label>>>) select).getEntries().values()) {
- for (List<Label> labels : mapEntry.values()) {
- set.addAll(labels);
- }
- }
} else if (type == BuildType.LABEL_DICT_UNARY) {
for (Map<String, Label> mapEntry :
((BuildType.Selector<Map<String, Label>>) select).getEntries().values()) {
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java b/src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java
index 90d4656ca2..9de8ce4914 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/AggregatingAttributeMapper.java
@@ -18,7 +18,6 @@ import static com.google.devtools.build.lib.packages.BuildType.FILESET_ENTRY_LIS
import static com.google.devtools.build.lib.packages.BuildType.LABEL;
import static com.google.devtools.build.lib.packages.BuildType.LABEL_DICT_UNARY;
import static com.google.devtools.build.lib.packages.BuildType.LABEL_LIST;
-import static com.google.devtools.build.lib.packages.BuildType.LABEL_LIST_DICT;
import static com.google.devtools.build.lib.packages.BuildType.LICENSE;
import static com.google.devtools.build.lib.packages.BuildType.NODEP_LABEL;
import static com.google.devtools.build.lib.packages.BuildType.NODEP_LABEL_LIST;
@@ -289,8 +288,7 @@ public class AggregatingAttributeMapper extends AbstractAttributeMapper {
if (attrType == STRING_DICT
|| attrType == STRING_DICT_UNARY
|| attrType == STRING_LIST_DICT
- || attrType == LABEL_DICT_UNARY
- || attrType == LABEL_LIST_DICT) {
+ || attrType == LABEL_DICT_UNARY) {
Map<Object, Object> mergedDict = new HashMap<>();
for (Object possibleValue : possibleValues) {
Map<Object, Object> stringDict = (Map<Object, Object>) possibleValue;
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AttributeSerializer.java b/src/main/java/com/google/devtools/build/lib/packages/AttributeSerializer.java
index 915244990a..4e67c39e8f 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/AttributeSerializer.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/AttributeSerializer.java
@@ -18,7 +18,6 @@ import static com.google.devtools.build.lib.packages.BuildType.FILESET_ENTRY_LIS
import static com.google.devtools.build.lib.packages.BuildType.LABEL;
import static com.google.devtools.build.lib.packages.BuildType.LABEL_DICT_UNARY;
import static com.google.devtools.build.lib.packages.BuildType.LABEL_LIST;
-import static com.google.devtools.build.lib.packages.BuildType.LABEL_LIST_DICT;
import static com.google.devtools.build.lib.packages.BuildType.LICENSE;
import static com.google.devtools.build.lib.packages.BuildType.NODEP_LABEL;
import static com.google.devtools.build.lib.packages.BuildType.NODEP_LABEL_LIST;
@@ -218,16 +217,6 @@ public class AttributeSerializer {
.setValue(dictEntry.getValue().toString());
builder.addLabelDictUnaryValue(entry);
}
- } else if (type == LABEL_LIST_DICT) {
- Map<String, List<Label>> dict = (Map<String, List<Label>>) value;
- for (Map.Entry<String, List<Label>> dictEntry : dict.entrySet()) {
- LabelListDictEntry.Builder entry =
- LabelListDictEntry.newBuilder().setKey(dictEntry.getKey());
- for (Object dictEntryValue : dictEntry.getValue()) {
- entry.addValue(dictEntryValue.toString());
- }
- builder.addLabelListDictValue(entry);
- }
} else if (type == FILESET_ENTRY_LIST) {
List<FilesetEntry> filesetEntries = (List<FilesetEntry>) value;
for (FilesetEntry filesetEntry : filesetEntries) {
diff --git a/src/main/java/com/google/devtools/build/lib/packages/BuildType.java b/src/main/java/com/google/devtools/build/lib/packages/BuildType.java
index 249839acb4..9f6518ecef 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/BuildType.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/BuildType.java
@@ -61,12 +61,6 @@ public final class BuildType {
*/
public static final ListType<Label> LABEL_LIST = ListType.create(LABEL);
/**
- * The type of a dictionary of {@linkplain #LABEL_LIST label lists}.
- */
- // TODO(gregce): remove after abi_deps is removed.
- public static final DictType<String, List<Label>> LABEL_LIST_DICT =
- DictType.create(Type.STRING, LABEL_LIST);
- /**
* This is a label type that does not cause dependencies. It is needed because
* certain rules want to verify the type of a target referenced by one of their attributes, but
* if there was a dependency edge there, it would be a circular dependency.
@@ -147,8 +141,7 @@ public final class BuildType {
*/
public static boolean isLabelType(Type<?> type) {
return type == LABEL || type == LABEL_LIST || type == LABEL_DICT_UNARY
- || type == NODEP_LABEL || type == NODEP_LABEL_LIST
- || type == LABEL_LIST_DICT || type == FILESET_ENTRY_LIST;
+ || type == NODEP_LABEL || type == NODEP_LABEL_LIST || type == FILESET_ENTRY_LIST;
}
/**
diff --git a/src/main/java/com/google/devtools/build/lib/packages/ProtoUtils.java b/src/main/java/com/google/devtools/build/lib/packages/ProtoUtils.java
index f1e6d4fe58..ceb0c8b1cb 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/ProtoUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/ProtoUtils.java
@@ -19,7 +19,6 @@ import static com.google.devtools.build.lib.packages.BuildType.FILESET_ENTRY_LIS
import static com.google.devtools.build.lib.packages.BuildType.LABEL;
import static com.google.devtools.build.lib.packages.BuildType.LABEL_DICT_UNARY;
import static com.google.devtools.build.lib.packages.BuildType.LABEL_LIST;
-import static com.google.devtools.build.lib.packages.BuildType.LABEL_LIST_DICT;
import static com.google.devtools.build.lib.packages.BuildType.LICENSE;
import static com.google.devtools.build.lib.packages.BuildType.NODEP_LABEL;
import static com.google.devtools.build.lib.packages.BuildType.NODEP_LABEL_LIST;
@@ -79,7 +78,6 @@ public class ProtoUtils {
.put(STRING_DICT, Discriminator.STRING_DICT)
.put(FILESET_ENTRY_LIST, Discriminator.FILESET_ENTRY_LIST)
.put(LABEL_DICT_UNARY, Discriminator.LABEL_DICT_UNARY)
- .put(LABEL_LIST_DICT, Discriminator.LABEL_LIST_DICT)
.put(STRING_LIST_DICT, Discriminator.STRING_LIST_DICT)
.put(BOOLEAN, Discriminator.BOOLEAN)
.put(TRISTATE, Discriminator.TRISTATE)
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/TypeTest.java b/src/test/java/com/google/devtools/build/lib/syntax/TypeTest.java
index b5f2bd8e67..d85bd79d9e 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/TypeTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/TypeTest.java
@@ -375,79 +375,6 @@ public class TypeTest {
}
@Test
- public void testLabelListDict() throws Exception {
- Object input = ImmutableMap.of("foo", Arrays.asList("//foo:bar"),
- "wiz", Arrays.asList(":bang"));
- Map<String, List<Label>> converted =
- BuildType.LABEL_LIST_DICT.convert(input, null, currentRule);
- Label fooLabel = Label
- .parseAbsolute("//foo:bar");
- Label bangLabel = Label
- .parseAbsolute("//quux:bang");
- Map<?, ?> expected = ImmutableMap.<String, List<Label>>of(
- "foo", Arrays.<Label>asList(fooLabel),
- "wiz", Arrays.<Label>asList(bangLabel));
- assertEquals(expected, converted);
- assertNotSame(expected, converted);
- assertThat(BuildType.LABEL_LIST_DICT.flatten(converted)).containsExactly(fooLabel, bangLabel);
- }
-
- @Test
- public void testLabelListDictBadFirstElement() throws Exception {
- Object input = ImmutableMap.of(2, Arrays.asList("//foo:bar"),
- "wiz", Arrays.asList(":bang"));
- try {
- BuildType.LABEL_LIST_DICT.convert(input, null, currentRule);
- fail();
- } catch (Type.ConversionException e) {
- assertThat(e).hasMessage(
- "expected value of type 'string' for dict key element, but got 2 (int)");
- }
- }
-
- @Test
- public void testLabelListDictBadSecondElement() throws Exception {
- Object input = ImmutableMap.of("foo", "//foo:bar",
- "wiz", Arrays.asList(":bang"));
- try {
- BuildType.LABEL_LIST_DICT.convert(input, null, currentRule);
- fail();
- } catch (Type.ConversionException e) {
- assertThat(e).hasMessage(
- "expected value of type 'list(label)' for dict value element, "
- + "but got \"//foo:bar\" (string)");
- }
- }
-
- @Test
- public void testLabelListDictBadElements1() throws Exception {
- Object input = ImmutableMap.of("foo", "bar",
- "bar", Arrays.asList("//foo:bar"),
- "wiz", Arrays.asList(":bang"));
- try {
- BuildType.LABEL_LIST_DICT.convert(input, null);
- fail();
- } catch (Type.ConversionException e) {
- assertThat(e).hasMessage("expected value of type 'list(label)' for dict value element, "
- + "but got \"bar\" (string)");
- }
- }
-
- @Test
- public void testLabelListDictSyntaxError() throws Exception {
- Object input = ImmutableMap.of("foo", Arrays.asList("//foo:.."),
- "wiz", Arrays.asList(":bang"));
- try {
- BuildType.LABEL_LIST_DICT.convert(input, "baz", currentRule);
- fail();
- } catch (Type.ConversionException e) {
- assertThat(e).hasMessage("invalid label '//foo:..' in element 0 of dict value element: "
- + "invalid target name '..': "
- + "target names may not contain up-level references '..'");
- }
- }
-
- @Test
public void testStringListDict() throws Exception {
Object input = ImmutableMap.of("foo", Arrays.asList("foo", "bar"),
"wiz", Arrays.asList("bang"));