aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-10-06 13:20:12 +0000
committerGravatar Lukacs Berki <lberki@google.com>2015-10-07 07:08:41 +0000
commit6f9a1f8dd4b06fdbfae8edb0b9b9b40852bc65fb (patch)
tree4c188c2d6b1aab82658ae86fe2eba5258d1498fc /src
parent4b40a5fccd3c9c63eea44b3eb173760dc88be743 (diff)
Partially revert []: move the tools/defaults package back to the main repository.
This is necessary because we copy labels from the command line into tools/defaults/BUILD and currently there is no syntax to make a label in a remote repository refer to one in the main repository. -- MOS_MIGRATED_REVID=104755206
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCppRuleClasses.java3
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaRuleClasses.java6
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/java/JavaSemantics.java24
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java2
5 files changed, 13 insertions, 24 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
index 154c41f595..a7b7ae6ee8 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
@@ -56,7 +56,7 @@ public class BaseRuleClasses {
* for running tests in coverage mode.
*/
private static final Label COVERAGE_SUPPORT_LABEL =
- Label.parseAbsoluteUnchecked(Constants.TOOLS_REPOSITORY + "//tools/defaults:coverage");
+ Label.parseAbsoluteUnchecked("//tools/defaults:coverage");
private static final Attribute.ComputedDefault testonlyDefault =
new Attribute.ComputedDefault() {
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCppRuleClasses.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCppRuleClasses.java
index 60618ff18d..99669fb6bf 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCppRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/BazelCppRuleClasses.java
@@ -153,8 +153,7 @@ public class BazelCppRuleClasses {
* Label of a pseudo-filegroup that contains all crosstool and libcfiles for
* all configurations, as specified on the command-line.
*/
- public static final String CROSSTOOL_LABEL =
- Constants.TOOLS_REPOSITORY + "//tools/defaults:crosstool";
+ public static final String CROSSTOOL_LABEL = "//tools/defaults:crosstool";
public static final LateBoundLabel<BuildConfiguration> CC_TOOLCHAIN =
new LateBoundLabel<BuildConfiguration>(CROSSTOOL_LABEL) {
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaRuleClasses.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaRuleClasses.java
index 4925cb7fcd..a360e7c8c4 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaRuleClasses.java
@@ -25,7 +25,6 @@ import static com.google.devtools.build.lib.syntax.Type.STRING;
import static com.google.devtools.build.lib.syntax.Type.STRING_LIST;
import com.google.common.collect.ImmutableSet;
-import com.google.devtools.build.lib.Constants;
import com.google.devtools.build.lib.analysis.BaseRuleClasses;
import com.google.devtools.build.lib.analysis.RuleDefinition;
import com.google.devtools.build.lib.analysis.RuleDefinitionEnvironment;
@@ -70,8 +69,7 @@ public class BazelJavaRuleClasses {
@Override
public RuleClass build(Builder builder, RuleDefinitionEnvironment env) {
return builder
- .add(attr("$ijar", LABEL).cfg(HOST).exec().value(env.getLabel(
- Constants.TOOLS_REPOSITORY + "//tools/defaults:ijar")))
+ .add(attr("$ijar", LABEL).cfg(HOST).exec().value(env.getLabel("//tools/defaults:ijar")))
.setPreferredDependencyPredicate(JavaSemantics.JAVA_SOURCE)
.build();
}
@@ -99,7 +97,7 @@ public class BazelJavaRuleClasses {
.add(attr("$javac_extdir", LABEL).cfg(HOST)
.value(env.getLabel(JavaSemantics.JAVAC_EXTDIR_LABEL)))
.add(attr("$java_langtools", LABEL).cfg(HOST)
- .value(env.getLabel(Constants.TOOLS_REPOSITORY + "//tools/defaults:java_langtools")))
+ .value(env.getLabel("//tools/defaults:java_langtools")))
.add(attr("$javac_bootclasspath", LABEL).cfg(HOST)
.value(env.getLabel(JavaSemantics.JAVAC_BOOTCLASSPATH_LABEL)))
.add(attr("$javabuilder", LABEL).cfg(HOST)
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaSemantics.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaSemantics.java
index ba94706a4b..83d10c59f6 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaSemantics.java
@@ -18,7 +18,6 @@ import static com.google.devtools.build.lib.packages.ImplicitOutputsFunction.fro
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
-import com.google.devtools.build.lib.Constants;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.LanguageDependentFragment.LibraryLanguage;
import com.google.devtools.build.lib.analysis.OutputGroupProvider;
@@ -80,8 +79,7 @@ public interface JavaSemantics {
/**
* Label to the Java Toolchain rule. It is resolved from a label given in the java options.
*/
- static final String JAVA_TOOLCHAIN_LABEL =
- Constants.TOOLS_REPOSITORY + "//tools/defaults:java_toolchain";
+ static final String JAVA_TOOLCHAIN_LABEL = "//tools/defaults:java_toolchain";
public static final LateBoundLabel<BuildConfiguration> JAVA_TOOLCHAIN =
new LateBoundLabel<BuildConfiguration>(JAVA_TOOLCHAIN_LABEL, JavaConfiguration.class) {
@@ -108,39 +106,33 @@ public interface JavaSemantics {
* Label of a pseudo-filegroup that contains all jdk files for all
* configurations, as specified on the command-line.
*/
- public static final String JDK_LABEL =
- Constants.TOOLS_REPOSITORY + "//tools/defaults:jdk";
+ public static final String JDK_LABEL = "//tools/defaults:jdk";
/**
* Label of a pseudo-filegroup that contains the boot-classpath entries.
*/
- public static final String JAVAC_BOOTCLASSPATH_LABEL =
- Constants.TOOLS_REPOSITORY + "//tools/defaults:javac_bootclasspath";
+ public static final String JAVAC_BOOTCLASSPATH_LABEL = "//tools/defaults:javac_bootclasspath";
/**
* Label of the javac extdir used for compiling Java source code.
*/
- public static final String JAVAC_EXTDIR_LABEL =
- Constants.TOOLS_REPOSITORY + "//tools/defaults:javac_extdir";
+ public static final String JAVAC_EXTDIR_LABEL = "//tools/defaults:javac_extdir";
/**
* Label of the JavaBuilder JAR used for compiling Java source code.
*/
- public static final String JAVABUILDER_LABEL =
- Constants.TOOLS_REPOSITORY + "//tools/defaults:javabuilder";
+ public static final String JAVABUILDER_LABEL = "//tools/defaults:javabuilder";
/**
* Label of the SingleJar JAR used for creating deploy jars.
*/
- public static final String SINGLEJAR_LABEL =
- Constants.TOOLS_REPOSITORY + "//tools/defaults:singlejar";
+ public static final String SINGLEJAR_LABEL = "//tools/defaults:singlejar";
/**
* Label of the GenClass JAR used for creating the jar for classes from sources generated from
* annotation processors.
*/
- public static final String GENCLASS_LABEL =
- Constants.TOOLS_REPOSITORY + "//tools/defaults:genclass";
+ public static final String GENCLASS_LABEL = "//tools/defaults:genclass";
/**
* Label of pseudo-cc_binary that tells Blaze a java target's JAVABIN is never to be replaced by
@@ -196,7 +188,7 @@ public interface JavaSemantics {
}
};
- public static final String IJAR_LABEL = Constants.TOOLS_REPOSITORY + "//tools/defaults:ijar";
+ public static final String IJAR_LABEL = "//tools/defaults:ijar";
/**
* Verifies if the rule contains and errors.
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
index 73b5f997be..f6745d3e91 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/PackageFunction.java
@@ -432,7 +432,7 @@ public class PackageFunction implements SkyFunction {
Path buildFilePath = buildFileRootedPath.asPath();
String replacementContents = null;
- if (packageName.equals(DEFAULTS_PACKAGE_NAME)) {
+ if (packageName.equals(DEFAULTS_PACKAGE_NAME) && packageId.getRepository().isDefault()) {
replacementContents = PrecomputedValue.DEFAULTS_PACKAGE_CONTENTS.get(env);
if (replacementContents == null) {
return null;