Advance options should start with -X
This commit is contained in:
parent
9c633116dc
commit
574205d548
2 changed files with 13 additions and 9 deletions
|
@ -388,7 +388,7 @@ public class CompileOptions {
|
|||
args.add("-verbose");
|
||||
}
|
||||
|
||||
// Wwrror
|
||||
// Werror
|
||||
if (wError_) {
|
||||
args.add("-Werror");
|
||||
}
|
||||
|
@ -398,9 +398,15 @@ public class CompileOptions {
|
|||
args.add("-Wextra");
|
||||
}
|
||||
|
||||
// advanced option (X)
|
||||
// advanced options (X)
|
||||
if (!advancedOptions_.isEmpty()) {
|
||||
advancedOptions_.forEach(it -> args.add("-X" + it));
|
||||
advancedOptions_.forEach(it -> {
|
||||
if (it.startsWith("-X")) {
|
||||
args.add(it);
|
||||
} else {
|
||||
args.add("-X" + it);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return args;
|
||||
|
@ -691,7 +697,7 @@ public class CompileOptions {
|
|||
* Limit the API of the JDK in the classpath to the specified Java version. Automatically sets
|
||||
* {@link #jvmTarget(String) JVM target} version.
|
||||
* <p>
|
||||
* Possible values are 1.8, 9, 10, ..., 22. The default value is 1.8.
|
||||
* Possible values are 1.8, 9, 10, ..., 23. The default value is 1.8.
|
||||
*
|
||||
* @param version the target version
|
||||
* @return this operation instance
|
||||
|
@ -706,8 +712,6 @@ public class CompileOptions {
|
|||
* <p>
|
||||
* Limit the API of the JDK in the classpath to the specified Java version. Automatically sets
|
||||
* {@link #jvmTarget(String) JVM target} version.
|
||||
* <p>
|
||||
* Possible values are 1.8, 9, 10, ..., 22. The default value is 1.8.
|
||||
*
|
||||
* @param version the target version
|
||||
* @return this operation instance
|
||||
|
@ -731,7 +735,7 @@ public class CompileOptions {
|
|||
/**
|
||||
* Specify the target version of the generated JVM bytecode.
|
||||
* <p>
|
||||
* Possible values are 1.8, 9, 10, ..., 22. The default value is 1.8.
|
||||
* Possible values are 1.8, 9, 10, ..., 23. The default value is 1.8.
|
||||
*
|
||||
* @param target the target version
|
||||
* @return this operation instance
|
||||
|
|
|
@ -112,7 +112,7 @@ class CompileOptionsTest {
|
|||
|
||||
@Test
|
||||
void testArgsCollections() {
|
||||
var advanceOptions = List.of("Xoption1", "Xoption2");
|
||||
var advanceOptions = List.of("-Xoption1", "option=2");
|
||||
var argFile = List.of(new File("arg1.txt"), new File("arg2.txt"));
|
||||
var classpath = List.of(new File("path1"), new File("path2"));
|
||||
var optIn = List.of("opt1", "opt2");
|
||||
|
@ -160,7 +160,7 @@ class CompileOptionsTest {
|
|||
"-foo", "-bar",
|
||||
"-script-templates",
|
||||
"temp1,temp2",
|
||||
"-XXoption1", "-XXoption2",
|
||||
"-Xoption1", "-Xoption=2",
|
||||
"-P", "plugin:id:name:value",
|
||||
"-P", "plugin:id2:name2:value2");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue