diff options
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/generatedprojecttest/util/RuleSetUtils.java | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/generatedprojecttest/util/RuleSetUtils.java b/src/test/java/com/google/devtools/build/lib/generatedprojecttest/util/RuleSetUtils.java index a9dbbc8aa8..2bb34a9f21 100644 --- a/src/test/java/com/google/devtools/build/lib/generatedprojecttest/util/RuleSetUtils.java +++ b/src/test/java/com/google/devtools/build/lib/generatedprojecttest/util/RuleSetUtils.java @@ -30,10 +30,8 @@ import com.google.devtools.build.lib.util.Pair; import java.util.ArrayList; import java.util.Collection; -import java.util.HashSet; import java.util.Iterator; import java.util.List; -import java.util.Set; /** * Utility class for providing static predicates for rules, to help filter the rules. @@ -67,16 +65,6 @@ public class RuleSetUtils { }; /** - * Predicate for checking if a rule allows an empty srcs attribute. - */ - public static final Predicate<RuleClass> EMPTY_SOURCES_ALLOWED = new Predicate<RuleClass>() { - @Override - public boolean apply(final RuleClass input) { - return !input.getAttributeByName("srcs").isNonEmpty(); - } - }; - - /** * Predicate for checking that the rule can have a deps attribute, and does not have any * other mandatory attributes besides deps. */ @@ -103,7 +91,7 @@ public class RuleSetUtils { */ public static class HasAttributes implements Predicate<RuleClass> { - private static enum Operator { + private enum Operator { ANY, ALL } @@ -137,16 +125,11 @@ public class RuleSetUtils { } } - public static final Predicate<RuleClass> hasAnyAttributes( + public static Predicate<RuleClass> hasAnyAttributes( Collection<Pair<String, Type<?>>> attributes) { return new HasAttributes(attributes, HasAttributes.Operator.ANY); } - public static final Predicate<RuleClass> hasAllAttributes( - Collection<Pair<String, Type<?>>> attributes) { - return new HasAttributes(attributes, HasAttributes.Operator.ALL); - } - /** * Predicate for checking if an attribute is mandatory. */ @@ -168,18 +151,6 @@ public class RuleSetUtils { }; /** - * Predicate for checking if all the strings in a list of strings are different. - */ - public static final Predicate<List<String>> ELEMENTS_ALL_DIFFERENT = - new Predicate<List<String>>() { - @Override - public boolean apply(final List<String> input) { - Set<String> inputAsSet = new HashSet<>(input); - return input.size() == inputAsSet.size(); - } - }; - - /** * Predicate for checking if a rule class is not in excluded. */ public static Predicate<String> notContainsAnyOf(final ImmutableSet<String> excluded) { |