Fix escaping of '@' in javabuilder command lines
"@" is used to denote params files, so when it appears in labels it is
escaped as "@@". The second "@" should be removed during flag parsing
to avoid e.g. having it show up in strict deps errors.
See bazelbuild/buildtools#83
@@ -252,7 +252,9 @@ public final class OptionsParser {
* @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);
