diff options
Diffstat (limited to 'src/main')
5 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/Constants.java b/src/main/java/com/google/devtools/build/lib/Constants.java index d4d643662f..940fa0e535 100644 --- a/src/main/java/com/google/devtools/build/lib/Constants.java +++ b/src/main/java/com/google/devtools/build/lib/Constants.java @@ -38,7 +38,7 @@ public class Constants { public static final ImmutableList<String> ANDROID_DEFAULT_FAT_APK_CPUS = ImmutableList.<String>of("armeabi-v7a"); public static final String ANDROID_DEP_PREFIX = "//external:android/".toString(); - public static final String TOOLS_REPOSITORY = "".toString(); + public static final String TOOLS_REPOSITORY = "@bazel_tools".toString(); /** * Whether C++ include scanning should be disabled no matter what the --cc_include_scanning flag diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java index c315c3cf3f..38fb0bb026 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java @@ -280,6 +280,8 @@ public class BazelRuleClassProvider { try { builder.addWorkspaceFile( + ResourceFileLoader.loadResource(BazelRuleClassProvider.class, "tools.WORKSPACE")); + builder.addWorkspaceFile( ResourceFileLoader.loadResource(BazelJavaRuleClasses.class, "jdk.WORKSPACE")); builder.addWorkspaceFile( ResourceFileLoader.loadResource(BazelAndroidSemantics.class, "android.WORKSPACE")); diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/tools.WORKSPACE b/src/main/java/com/google/devtools/build/lib/bazel/rules/tools.WORKSPACE new file mode 100644 index 0000000000..4059c9e245 --- /dev/null +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/tools.WORKSPACE @@ -0,0 +1 @@ +local_repository(name = "bazel_tools", path = __embedded_dir__ + "/embedded_tools") diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java index 83cde77f04..2a34ed02d3 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidRuleClasses.java @@ -281,16 +281,16 @@ public final class AndroidRuleClasses { new SafeImplicitOutputsFunction() { @Override public Iterable<String> getImplicitOutputs(AttributeMap attributes) { - + ImmutableList.Builder<SafeImplicitOutputsFunction> implicitOutputs = ImmutableList.builder(); - + implicitOutputs.add( AndroidRuleClasses.ANDROID_LIBRARY_CLASS_JAR, AndroidRuleClasses.ANDROID_LIBRARY_SOURCE_JAR, AndroidRuleClasses.ANDROID_LIBRARY_JACK_FILE, AndroidRuleClasses.ANDROID_LIBRARY_AAR); - + if (LocalResourceContainer.definesAndroidResources(attributes)) { implicitOutputs.add( AndroidRuleClasses.ANDROID_JAVA_SOURCE_JAR, @@ -535,7 +535,8 @@ public final class AndroidRuleClasses { // TODO(ahumesky): It would be better to put this dependency in //tools/android somehow // like all the rest of android tools. .add(attr("$jarjar_bin", LABEL).cfg(HOST).exec() - .value(env.getLabel("//third_party/java/jarjar:jarjar_bin"))) + .value(env.getLabel( + Constants.TOOLS_REPOSITORY + "//third_party/java/jarjar:jarjar_bin"))) .add(attr("$idlclass", LABEL).cfg(HOST).exec() .value(env.getLabel(Constants.ANDROID_DEP_PREFIX + "IdlClass"))) .build(); diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframePackageLoaderWithValueEnvironment.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframePackageLoaderWithValueEnvironment.java index 107ef1f11c..95ff677240 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframePackageLoaderWithValueEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframePackageLoaderWithValueEnvironment.java @@ -65,7 +65,7 @@ class SkyframePackageLoaderWithValueEnvironment implements PackageProviderForCon @Override public void addDependency(Package pkg, String fileName) throws LabelSyntaxException, IOException { RootedPath fileRootedPath = RootedPath.toRootedPath(pkg.getSourceRoot(), - pkg.getNameFragment().getRelative(fileName)); + pkg.getPackageIdentifier().getPathFragment().getRelative(fileName)); FileValue result = (FileValue) env.getValue(FileValue.key(fileRootedPath)); if (result != null && !result.exists()) { throw new IOException(); |