Skip to content

Commit

Permalink
Add support for --javacopt flags terminated by -- to JavaBuilder
Browse files Browse the repository at this point in the history
JDK 9 adds javac flags that start with `--`, so we can't assume that `--` flags
belong to JavaBuilder. Instead, we will use `--` by itself as a delimiter to parse
e.g. `--javacopts --release 8 -- sources Hello.java`.

This change just adds support for dropping a trailing `--` after parsing javacopts.
We can't rely on the delimiter until after the next Blaze release.

PiperOrigin-RevId: 179589863
  • Loading branch information
cushon authored and Copybara-Service committed Dec 19, 2017
1 parent 2258b81 commit 9440289
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ private void processCommandlineArgs(Deque<String> argQueue) throws InvalidComman
// terminator to the passed arguments.
collectFlagArguments(javacOpts, argQueue, "--");
sourcePathFromJavacOpts();
if (!argQueue.isEmpty() && argQueue.peekFirst().equals("--")) {
// Support --javacopts terminated with "--", in preparation for requiring javacopts
// to be terminated with "--", in preparation for supporting --javacopts that start
// with "--".
argQueue.removeFirst();
}
break;
case "--direct_dependency":
{
Expand Down

0 comments on commit 9440289

Please sign in to comment.