From 5590dc4259c3e850282f0916fb05d5aadc7ec861 Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Tue, 14 Apr 2015 15:58:54 +0000 Subject: Make the indirect dependency message show the correct label for external deps Previously it would show the relative path within the external dep (e.g., in the given test, "** Please add the following dependencies: x to //a:a"). Fixes https://github.com/google/bazel/issues/112. -- MOS_MIGRATED_REVID=91093258 --- .../buildjar/javac/plugins/dependency/StrictJavaDepsPlugin.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/java_tools/buildjar/java/com') diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/StrictJavaDepsPlugin.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/StrictJavaDepsPlugin.java index 7c6999b5d9..da57a8f970 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/StrictJavaDepsPlugin.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/plugins/dependency/StrictJavaDepsPlugin.java @@ -359,6 +359,12 @@ public final class StrictJavaDepsPlugin extends BlazeJavaCompilerPlugin { if (replacement != null) { return replacement; } + int atIndex = target.indexOf('@'); + if (atIndex != -1) { + // target starts with @@repo ('@' is escaped for the params file parsing) so one @ needs to + // be stripped. + target = target.substring(1); + } int colonIndex = target.indexOf(':'); if (colonIndex == -1) { // No ':' in target, nothing to do. -- cgit v1.2.3