Skip to content

Commit

Permalink
When normalizing -source and --release options, allow the last one to…
Browse files Browse the repository at this point in the history
… win

previously --release always took precedence.

if/when Bazel defaults to using e.g. --release 9, legacy -source and -target
javacopts should be respected.

PiperOrigin-RevId: 192844963
  • Loading branch information
cushon authored and Copybara-Service committed Apr 13, 2018
1 parent f477e86 commit 9666ecc
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,22 +243,28 @@ public boolean processOption(String option, Iterator<String> remaining) {
case "-source":
if (remaining.hasNext()) {
source = remaining.next();
release = null;
}
return true;
case "-target":
if (remaining.hasNext()) {
target = remaining.next();
release = null;
}
return true;
case "--release":
if (remaining.hasNext()) {
release = remaining.next();
source = null;
target = null;
}
return true;
default: // fall out
}
if (option.startsWith("--release=")) {
release = option.substring("--release=".length());
source = null;
target = null;
return true;
}
return false;
Expand Down

0 comments on commit 9666ecc

Please sign in to comment.