mirror of
https://github.com/rife2/bld
synced 2026-02-04 01:03:42 +01:00
Add support for -Xlint options in JavacOptions
This commit is contained in:
parent
9c5928f9b1
commit
7a419ed197
|
|
@ -35,6 +35,49 @@ public class JavacOptions extends ArrayList<String> {
|
|||
FULL, NONE, ONLY
|
||||
}
|
||||
|
||||
public enum XLintKey {
|
||||
ALL,
|
||||
AUXILIARYCLASS,
|
||||
CAST,
|
||||
CLASSFILE,
|
||||
DANGLING_DOC_COMMENTS,
|
||||
DEP_ANN,
|
||||
DEPRECATION,
|
||||
DIVZERO,
|
||||
EMPTY,
|
||||
EXPORTS,
|
||||
FALLTHROUGH,
|
||||
FINALLY,
|
||||
IDENTITY,
|
||||
INCUBATING,
|
||||
LOSSY_CONVERSIONS,
|
||||
MISSING_EXPLICIT_CTOR,
|
||||
MODULE,
|
||||
NONE,
|
||||
OPENS,
|
||||
OPTIONS,
|
||||
OUTPUT_FILE_CLASH,
|
||||
OVERLOADS,
|
||||
OVERRIDES,
|
||||
PATH,
|
||||
PREVIEW,
|
||||
PROCESSING,
|
||||
RAWTYPES,
|
||||
REMOVAL,
|
||||
REQUIRES_AUTOMATIC,
|
||||
REQUIRES_TRANSITIVE_AUTOMATIC,
|
||||
RESTRICTED,
|
||||
SERIAL,
|
||||
STATIC,
|
||||
STRICTFP,
|
||||
SYNCHRONIZATION,
|
||||
TEXT_BLOCKS,
|
||||
THIS_ESCAPE,
|
||||
TRY,
|
||||
UNCHECKED,
|
||||
VARARGS
|
||||
}
|
||||
|
||||
/**
|
||||
* Option to pass to annotation processors
|
||||
*
|
||||
|
|
@ -776,4 +819,56 @@ public class JavacOptions extends ArrayList<String> {
|
|||
add("-Werror");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable recommended warning categories
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions xLint() {
|
||||
add("-Xlint");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning categories to enable
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions xLint(XLintKey... keys) {
|
||||
return xLint(Arrays.asList(keys));
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning categories to enable
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions xLint(List<XLintKey> keys) {
|
||||
add("-Xlint:" + StringUtils.join(keys, ",").replaceAll("_", "-").toLowerCase());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning categories to disable
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions xLintDisable(XLintKey... keys) {
|
||||
return xLintDisable(Arrays.asList(keys));
|
||||
}
|
||||
/**
|
||||
* Warning categories to disable
|
||||
*
|
||||
* @return this list of options
|
||||
* @since 2.3.1
|
||||
*/
|
||||
public JavacOptions xLintDisable(List<XLintKey> keys) {
|
||||
add("-Xlint:-" + StringUtils.join(keys, ",-").replaceAll("_", "-").toLowerCase());
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue