commit | 5006dab687d3d32f4789b34c80f68f49e28214bd | [log] [tgz] |
---|---|---|
author | cushon <cushon@google.com> | Fri Apr 14 20:44:41 2017 +0200 |
committer | Klaus Aehlig <aehlig@google.com> | Tue Apr 18 11:27:27 2017 +0200 |
tree | d64c81be4097b35d37758a33d3434a37ff5b2c32 | |
parent | 8fd7f754771a3793d1089e3845320342cf6d61bb [diff] |
Roll forward of https://github.com/bazelbuild/bazel/commit/4a303e2cd840810b95cbc793e38bdca48e6d9556 Only unescape @@-quoted args once PiperOrigin-RevId: 153189611
diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java index feebbe2..e50b5ce 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java +++ b/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/OptionsParser.java
@@ -252,7 +252,9 @@ * @throws java.io.IOException if one of the files containing options cannot be read. */ private static void expandArgument(Deque<String> expanded, String arg) throws IOException { - if (arg.startsWith("@") && !arg.startsWith("@@")) { + if (arg.startsWith("@@")) { + expanded.add(arg.substring(1)); + } else if (arg.startsWith("@")) { for (String line : Files.readAllLines(Paths.get(arg.substring(1)), UTF_8)) { if (line.length() > 0) { expandArgument(expanded, line);
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 5f56935..9d4f5e0 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
@@ -395,12 +395,6 @@ /** Returns the canonical version of the target name. Package private for testing. */ static String canonicalizeTarget(String target) { - 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.