aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-05-06 09:25:21 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-05-06 09:35:27 +0000
commitcda4b4eae0c495a8f90f2a70a8db46e34062ee26 (patch)
tree1de10e0c9f937be58f8ff6e8fae5ac942115f059 /src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java
parent8a142fef810435ca0f45b410e67c3a6b29919c75 (diff)
*** Reason for rollback *** Broke ci.bazel.io. See #1234. *** Original change description *** Allow modules to inject a custom AttributeContainer. -- MOS_MIGRATED_REVID=121658474
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java36
1 files changed, 5 insertions, 31 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java b/src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java
index 91e6c06368..ebafff7355 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java
@@ -20,7 +20,6 @@ import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.cmdline.LabelSyntaxException;
import com.google.devtools.build.lib.events.Location;
import com.google.devtools.build.lib.events.StoredEventHandler;
-import com.google.devtools.build.lib.packages.Package.Builder;
import com.google.devtools.build.lib.packages.RuleFactory.BuildLangTypedAttributeValuesMap;
import com.google.devtools.build.lib.syntax.FuncallExpression;
import com.google.devtools.build.lib.util.Preconditions;
@@ -45,37 +44,19 @@ public class ExternalPackageBuilder {
BuildLangTypedAttributeValuesMap attributeValues = new BuildLangTypedAttributeValuesMap(kwargs);
Rule rule =
RuleFactory.createRule(
- pkg,
- ruleClass,
- attributeValues,
- eventHandler,
- ast,
- ast.getLocation(),
- /*env=*/ null,
- new AttributeContainer(ruleClass));
+ pkg, ruleClass, attributeValues, eventHandler, ast, ast.getLocation(), /*env=*/ null);
pkg.addEvents(eventHandler.getEvents());
overwriteRule(pkg, rule);
for (Map.Entry<String, Label> entry :
ruleClass.getExternalBindingsFunction().apply(rule).entrySet()) {
Label nameLabel = Label.parseAbsolute("//external:" + entry.getKey());
- addBindRule(
- pkg,
- bindRuleClass,
- nameLabel,
- entry.getValue(),
- rule.getLocation(),
- new AttributeContainer(ruleClass));
+ addBindRule(pkg, bindRuleClass, nameLabel, entry.getValue(), rule.getLocation());
}
return rule;
}
- void addBindRule(
- Builder pkg,
- RuleClass bindRuleClass,
- Label virtual,
- Label actual,
- Location location,
- AttributeContainer attributeContainer)
+ public void addBindRule(
+ Package.Builder pkg, RuleClass bindRuleClass, Label virtual, Label actual, Location location)
throws RuleFactory.InvalidRuleException, Package.NameConflictException, InterruptedException {
Map<String, Object> attributes = Maps.newHashMap();
@@ -90,14 +71,7 @@ public class ExternalPackageBuilder {
new BuildLangTypedAttributeValuesMap(attributes);
Rule rule =
RuleFactory.createRule(
- pkg,
- bindRuleClass,
- attributeValues,
- handler,
- /*ast=*/ null,
- location,
- /*env=*/ null,
- attributeContainer);
+ pkg, bindRuleClass, attributeValues, handler, /*ast=*/ null, location, /*env=*/ null);
overwriteRule(pkg, rule);
rule.setVisibility(ConstantRuleVisibility.PUBLIC);
}