diff options
author | Liam Miller-Cushon <cushon@google.com> | 2017-01-14 04:09:43 +0000 |
---|---|---|
committer | Vladimir Moskva <vladmos@google.com> | 2017-01-16 13:46:00 +0000 |
commit | 458651774467dcf30ad3dfeef54fae005b493da1 (patch) | |
tree | bad2b30de57efb282a0e480a7053e6e8473c0163 /src/test/java | |
parent | 986e3b027542ee612f6552eb18a1b30d2b14a42f (diff) |
Fix a typo
--
PiperOrigin-RevId: 144511168
MOS_MIGRATED_REVID=144511168
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java | 2 | ||||
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/testutil/BuildRuleWithDefaultsBuilder.java | 36 |
2 files changed, 19 insertions, 19 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java b/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java index b1eb61f632..c22249b24e 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java @@ -153,7 +153,7 @@ public final class BazelAnalysisMock extends AnalysisMock { BuildRuleWithDefaultsBuilder ruleBuilder = new BuildRuleWithDefaultsBuilder("android_sdk", "sdk") - .popuplateAttributes("", false); + .populateAttributes("", false); androidBuildContents.add(ruleBuilder.build()); for (BuildRuleBuilder generatedRuleBuilder : ruleBuilder.getRulesToGenerate()) { androidBuildContents.add(generatedRuleBuilder.build()); diff --git a/src/test/java/com/google/devtools/build/lib/testutil/BuildRuleWithDefaultsBuilder.java b/src/test/java/com/google/devtools/build/lib/testutil/BuildRuleWithDefaultsBuilder.java index 2e9e164577..7db103eba3 100644 --- a/src/test/java/com/google/devtools/build/lib/testutil/BuildRuleWithDefaultsBuilder.java +++ b/src/test/java/com/google/devtools/build/lib/testutil/BuildRuleWithDefaultsBuilder.java @@ -75,20 +75,20 @@ public class BuildRuleWithDefaultsBuilder extends BuildRuleBuilder { BuildRuleWithDefaultsBuilder builder = new BuildRuleWithDefaultsBuilder( referencedRuleClass.getName(), referencedRuleName, ruleClassMap, generateFiles, generateRules); - builder.popuplateAttributes(rulePkg, true); + builder.populateAttributes(rulePkg, true); generateRules.put(referencedRuleClass.getName(), builder); return referencedRuleName; } - public BuildRuleWithDefaultsBuilder popuplateLabelAttribute(String pkg, Attribute attribute) { - return popuplateLabelAttribute(pkg, pkg, attribute); + public BuildRuleWithDefaultsBuilder populateLabelAttribute(String pkg, Attribute attribute) { + return populateLabelAttribute(pkg, pkg, attribute); } /** * Populates the label type attribute with generated values. Populates with a file if possible, or * generates an appropriate rule. Note, that the rules are always generated in the same package. */ - public BuildRuleWithDefaultsBuilder popuplateLabelAttribute(String rulePkg, String filePkg, + public BuildRuleWithDefaultsBuilder populateLabelAttribute(String rulePkg, String filePkg, Attribute attribute) { Type<?> attrType = attribute.getType(); String label = null; @@ -152,41 +152,41 @@ public class BuildRuleWithDefaultsBuilder extends BuildRuleBuilder { return null; } - public BuildRuleWithDefaultsBuilder popuplateStringListAttribute(Attribute attribute) { + public BuildRuleWithDefaultsBuilder populateStringListAttribute(Attribute attribute) { addMultiValueAttributes(attribute.getName(), "x"); return this; } - public BuildRuleWithDefaultsBuilder popuplateStringAttribute(Attribute attribute) { + public BuildRuleWithDefaultsBuilder populateStringAttribute(Attribute attribute) { setSingleValueAttribute(attribute.getName(), "x"); return this; } - public BuildRuleWithDefaultsBuilder popuplateBooleanAttribute(Attribute attribute) { + public BuildRuleWithDefaultsBuilder populateBooleanAttribute(Attribute attribute) { setSingleValueAttribute(attribute.getName(), "false"); return this; } - public BuildRuleWithDefaultsBuilder popuplateIntegerAttribute(Attribute attribute) { + public BuildRuleWithDefaultsBuilder populateIntegerAttribute(Attribute attribute) { setSingleValueAttribute(attribute.getName(), 1); return this; } - public BuildRuleWithDefaultsBuilder popuplateAttributes(String rulePkg, boolean heuristics) { + public BuildRuleWithDefaultsBuilder populateAttributes(String rulePkg, boolean heuristics) { for (Attribute attribute : ruleClass.getAttributes()) { if (attribute.isMandatory()) { if (attribute.getType() == BuildType.LABEL_LIST || attribute.getType() == BuildType.OUTPUT_LIST) { if (attribute.isNonEmpty()) { - popuplateLabelAttribute(rulePkg, attribute); + populateLabelAttribute(rulePkg, attribute); } else { // TODO(bazel-team): actually here an empty list would be fine, but BuildRuleBuilder // doesn't support that, and it makes little sense anyway - popuplateLabelAttribute(rulePkg, attribute); + populateLabelAttribute(rulePkg, attribute); } } else if (attribute.getType() == BuildType.LABEL || attribute.getType() == BuildType.OUTPUT) { - popuplateLabelAttribute(rulePkg, attribute); + populateLabelAttribute(rulePkg, attribute); } else { // Non label type attributes if (attribute.getAllowedValues() instanceof AllowedValueSet) { @@ -194,13 +194,13 @@ public class BuildRuleWithDefaultsBuilder extends BuildRuleBuilder { ((AllowedValueSet) attribute.getAllowedValues()).getAllowedValues(); setSingleValueAttribute(attribute.getName(), allowedValues.iterator().next()); } else if (attribute.getType() == Type.STRING) { - popuplateStringAttribute(attribute); + populateStringAttribute(attribute); } else if (attribute.getType() == Type.BOOLEAN) { - popuplateBooleanAttribute(attribute); + populateBooleanAttribute(attribute); } else if (attribute.getType() == Type.INTEGER) { - popuplateIntegerAttribute(attribute); + populateIntegerAttribute(attribute); } else if (attribute.getType() == Type.STRING_LIST) { - popuplateStringListAttribute(attribute); + populateStringListAttribute(attribute); } } // TODO(bazel-team): populate for other data types @@ -216,9 +216,9 @@ public class BuildRuleWithDefaultsBuilder extends BuildRuleBuilder { private void populateAttributesHeuristics(String rulePkg, Attribute attribute) { if (attribute.getName().equals("srcs") && attribute.getType() == BuildType.LABEL_LIST) { // If there is a srcs attribute it might be better to populate it even if it's not mandatory - popuplateLabelAttribute(rulePkg, attribute); + populateLabelAttribute(rulePkg, attribute); } else if (attribute.getName().equals("main_class") && attribute.getType() == Type.STRING) { - popuplateStringAttribute(attribute); + populateStringAttribute(attribute); } } |