diff options
author | 2016-07-25 20:12:16 +0000 | |
---|---|---|
committer | 2016-07-26 09:30:55 +0000 | |
commit | 581f2c2c2643a775a6f4c6b137d7c9b439176733 (patch) | |
tree | 0d400fa5a551db330a1333fed7860557f2eb3852 /src/main/java/com/google/devtools/build/lib/packages/RuleClass.java | |
parent | 77c4ac233ed8d9db87c0769881922f96e65ba459 (diff) |
Slim down RuleClass#createUnchecked
--
MOS_MIGRATED_REVID=128391351
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/RuleClass.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/RuleClass.java | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java index a9ef960478..269674aaa6 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java +++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java @@ -14,8 +14,8 @@ package com.google.devtools.build.lib.packages; -import static com.google.devtools.build.lib.packages.Attribute.ConfigurationTransition.HOST; import static com.google.devtools.build.lib.packages.Attribute.attr; +import static com.google.devtools.build.lib.packages.Attribute.ConfigurationTransition.HOST; import static com.google.devtools.build.lib.packages.BuildType.LABEL_LIST; import static com.google.devtools.build.lib.syntax.Type.BOOLEAN; @@ -33,6 +33,7 @@ import com.google.devtools.build.lib.cmdline.LabelSyntaxException; import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.events.Location; +import com.google.devtools.build.lib.events.NullEventHandler; import com.google.devtools.build.lib.packages.BuildType.SelectorList; import com.google.devtools.build.lib.packages.ConfigurationFragmentPolicy.MissingFragmentPolicy; import com.google.devtools.build.lib.packages.RuleClass.Builder.RuleClassType; @@ -50,7 +51,6 @@ import com.google.devtools.build.lib.syntax.Type.ConversionException; import com.google.devtools.build.lib.util.Preconditions; import com.google.devtools.build.lib.util.StringUtil; import com.google.devtools.build.lib.vfs.PathFragment; - import java.util.ArrayList; import java.util.BitSet; import java.util.Collection; @@ -62,7 +62,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.regex.Pattern; - import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; @@ -1340,8 +1339,17 @@ public final class RuleClass { Location location, AttributeContainer attributeContainer) throws LabelSyntaxException, InterruptedException { - Rule rule = createRuleUnchecked( - pkgBuilder, ruleLabel, attributeValues, eventHandler, ast, location, attributeContainer); + Rule rule = pkgBuilder.createRule(ruleLabel, this, location, attributeContainer); + populateRuleAttributeValues(rule, pkgBuilder, attributeValues, eventHandler); + checkAspectAllowedValues(rule, eventHandler); + rule.populateOutputFiles(eventHandler, pkgBuilder); + if (ast != null) { + populateAttributeLocations(rule, ast); + } + checkForDuplicateLabels(rule, eventHandler); + checkThirdPartyRuleHasLicense(rule, pkgBuilder, eventHandler); + checkForValidSizeAndTimeoutValues(rule, eventHandler); + rule.checkValidityPredicate(eventHandler); rule.checkForNullLabels(); return rule; } @@ -1355,22 +1363,12 @@ public final class RuleClass { Package.Builder pkgBuilder, Label ruleLabel, AttributeValuesMap attributeValues, - EventHandler eventHandler, - @Nullable FuncallExpression ast, Location location, AttributeContainer attributeContainer) throws LabelSyntaxException, InterruptedException { Rule rule = pkgBuilder.createRule(ruleLabel, this, location, attributeContainer); - populateRuleAttributeValues(rule, pkgBuilder, attributeValues, eventHandler); - checkAspectAllowedValues(rule, eventHandler); - rule.populateOutputFiles(eventHandler, pkgBuilder); - if (ast != null) { - populateAttributeLocations(rule, ast); - } - checkForDuplicateLabels(rule, eventHandler); - checkThirdPartyRuleHasLicense(rule, pkgBuilder, eventHandler); - checkForValidSizeAndTimeoutValues(rule, eventHandler); - rule.checkValidityPredicate(eventHandler); + populateRuleAttributeValues(rule, pkgBuilder, attributeValues, NullEventHandler.INSTANCE); + rule.populateOutputFiles(NullEventHandler.INSTANCE, pkgBuilder); return rule; } |