aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib')
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryModule.java4
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/WorkspaceFactory.java6
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/WorkspaceFactoryHelper.java (renamed from src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java)6
3 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryModule.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryModule.java
index 6469ca8e98..ef6391b254 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryModule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/skylark/SkylarkRepositoryModule.java
@@ -24,7 +24,6 @@ import com.google.devtools.build.lib.analysis.BaseRuleClasses;
import com.google.devtools.build.lib.analysis.skylark.SkylarkAttr.Descriptor;
import com.google.devtools.build.lib.cmdline.LabelSyntaxException;
import com.google.devtools.build.lib.packages.AttributeValueSource;
-import com.google.devtools.build.lib.packages.ExternalPackageBuilder;
import com.google.devtools.build.lib.packages.Package.NameConflictException;
import com.google.devtools.build.lib.packages.PackageFactory;
import com.google.devtools.build.lib.packages.PackageFactory.PackageContext;
@@ -32,6 +31,7 @@ import com.google.devtools.build.lib.packages.RuleClass;
import com.google.devtools.build.lib.packages.RuleClass.Builder;
import com.google.devtools.build.lib.packages.RuleClass.Builder.RuleClassType;
import com.google.devtools.build.lib.packages.RuleFactory.InvalidRuleException;
+import com.google.devtools.build.lib.packages.WorkspaceFactoryHelper;
import com.google.devtools.build.lib.skylarkinterface.Param;
import com.google.devtools.build.lib.skylarkinterface.SkylarkSignature;
import com.google.devtools.build.lib.syntax.BaseFunction;
@@ -174,7 +174,7 @@ public class SkylarkRepositoryModule {
PackageContext context = PackageFactory.getContext(env, ast);
@SuppressWarnings("unchecked")
Map<String, Object> attributeValues = (Map<String, Object>) args[0];
- return ExternalPackageBuilder.createAndAddRepositoryRule(
+ return WorkspaceFactoryHelper.createAndAddRepositoryRule(
context.getBuilder(), ruleClass, null, attributeValues, ast);
} catch (InvalidRuleException | NameConflictException | LabelSyntaxException e) {
throw new EvalException(ast.getLocation(), e.getMessage());
diff --git a/src/main/java/com/google/devtools/build/lib/packages/WorkspaceFactory.java b/src/main/java/com/google/devtools/build/lib/packages/WorkspaceFactory.java
index 7ab3e7bbf7..2d7176aba8 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/WorkspaceFactory.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/WorkspaceFactory.java
@@ -334,7 +334,7 @@ public class WorkspaceFactory {
try {
// This effectively adds a "local_repository(name = "<ws>", path = ".")"
// definition to the WORKSPACE file.
- ExternalPackageBuilder.createAndAddRepositoryRule(
+ WorkspaceFactoryHelper.createAndAddRepositoryRule(
builder, localRepositoryRuleClass, bindRuleClass, kwargs, ast);
} catch (InvalidRuleException | NameConflictException | LabelSyntaxException e) {
throw new EvalException(ast.getLocation(), e.getMessage());
@@ -366,7 +366,7 @@ public class WorkspaceFactory {
try {
Package.Builder builder = PackageFactory.getContext(env, ast).pkgBuilder;
RuleClass ruleClass = ruleFactory.getRuleClass("bind");
- ExternalPackageBuilder.addBindRule(
+ WorkspaceFactoryHelper.addBindRule(
builder,
ruleClass,
nameLabel,
@@ -464,7 +464,7 @@ public class WorkspaceFactory {
RuleClass ruleClass = ruleFactory.getRuleClass(ruleClassName);
RuleClass bindRuleClass = ruleFactory.getRuleClass("bind");
Rule rule =
- ExternalPackageBuilder.createAndAddRepositoryRule(
+ WorkspaceFactoryHelper.createAndAddRepositoryRule(
builder, ruleClass, bindRuleClass, kwargs, ast);
if (!isLegalWorkspaceName(rule.getName())) {
throw new EvalException(
diff --git a/src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java b/src/main/java/com/google/devtools/build/lib/packages/WorkspaceFactoryHelper.java
index 6a5d027c32..af96a3a18d 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/ExternalPackageBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/WorkspaceFactoryHelper.java
@@ -26,10 +26,8 @@ import com.google.devtools.build.lib.syntax.FuncallExpression;
import com.google.devtools.build.lib.util.Preconditions;
import java.util.Map;
-/**
- * A builder that helps constructing the //external package.
- */
-public class ExternalPackageBuilder {
+/** A helper for the {@link WorkspaceFactory} to create repository rules */
+public class WorkspaceFactoryHelper {
public static Rule createAndAddRepositoryRule(
Package.Builder pkg,