class LintOptions extends Object
DSL object for configuring lint options.
Constructor and description |
---|
LintOptions
() |
LintOptions
(Set<String> disable, Set<String> enable, Set<String> check, File lintConfig, boolean textReport, File textOutput, boolean htmlReport, File htmlOutput, boolean xmlReport, File xmlOutput, boolean abortOnError, boolean absolutePaths, boolean noLines, boolean quiet, boolean checkAllWarnings, boolean ignoreWarnings, boolean warningsAsErrors, boolean showAll, boolean explainIssues, boolean checkReleaseBuilds, Map<String, Integer> severityOverrides) |
Type | Name and description |
---|---|
void |
check(String id) Adds the id to the set of issues to check. |
void |
check(String... ids) Adds the ids to the set of issues to check. |
static com.android.builder.model.LintOptions |
create(com.android.builder.model.LintOptions source) |
void |
disable(String id) Adds the id to the set of issues to enable. |
void |
disable(String... ids) Adds the ids to the set of issues to enable. |
void |
enable(String id) Adds the id to the set of issues to enable. |
void |
enable(String... ids) Adds the ids to the set of issues to enable. |
void |
error(String id) Adds a severity override for the given issues. |
void |
error(String... ids) Adds a severity override for the given issues. |
void |
fatal(String id) Adds a severity override for the given issues. |
void |
fatal(String... ids) Adds a severity override for the given issues. |
Set<String> |
getCheck() Returns the exact set of issues to check, or null to run the issues that are enabled by default plus any issues enabled via getEnable and without issues disabled via getDisable. |
Set<String> |
getDisable() Returns the set of issue id's to suppress. |
Set<String> |
getEnable() Returns the set of issue id's to enable. |
File |
getHtmlOutput() The optional path to where an HTML report should be written |
boolean |
getHtmlReport() Whether we should write an HTML report. |
File |
getLintConfig() Returns the default configuration file to use as a fallback |
Map<String, Integer> |
getSeverityOverrides() An optional map of severity overrides. |
File |
getTextOutput() The optional path to where a text report should be written. |
boolean |
getTextReport() Whether we should write an text report. |
File |
getXmlOutput() The optional path to where an XML report should be written |
boolean |
getXmlReport() Whether we should write an XML report. |
void |
ignore(String id) Adds a severity override for the given issues. |
void |
ignore(String... ids) Adds a severity override for the given issues. |
boolean |
isAbortOnError() Whether lint should set the exit code of the process if errors are found |
boolean |
isAbsolutePaths() Whether lint should display full paths in the error output. |
boolean |
isCheckAllWarnings() Returns whether lint should check all warnings, including those off by default |
boolean |
isCheckReleaseBuilds() Returns whether lint should check for fatal errors during release builds. |
boolean |
isExplainIssues() Returns whether lint should include explanations for issue errors. |
boolean |
isIgnoreWarnings() Returns whether lint will only check for errors (ignoring warnings) |
boolean |
isNoLines() Whether lint should include the source lines in the output where errors occurred (true by default) |
boolean |
isQuiet() Returns whether lint should be quiet (for example, not write informational messages such as paths to report files written) |
boolean |
isShowAll() Returns whether lint should include all output (e.g. include all alternate locations, not truncating long messages, etc.) |
boolean |
isWarningsAsErrors() Returns whether lint should treat all warnings as errors |
void |
setAbortOnError(boolean abortOnError) Sets whether lint should set the exit code of the process if errors are found |
void |
setAbsolutePaths(boolean absolutePaths) Sets whether lint should display full paths in the error output. |
void |
setCheck(Set<String> ids) Sets the exact set of issues to check. |
void |
setCheckAllWarnings(boolean warnAll) Sets whether lint should check all warnings, including those off by default |
void |
setCheckReleaseBuilds(boolean checkReleaseBuilds) |
void |
setDisable(Set<String> ids) Sets the set of issue id's to suppress. |
void |
setEnable(Set<String> ids) Sets the set of issue id's to enable. |
void |
setExplainIssues(boolean explainIssues) |
void |
setHtmlOutput(File htmlOutput) |
void |
setHtmlReport(boolean htmlReport) |
void |
setIgnoreWarnings(boolean noWarnings) Sets whether lint will only check for errors (ignoring warnings) |
void |
setLintConfig(File lintConfig) Sets the default config file to use as a fallback. |
void |
setNoLines(boolean noLines) Sets whether lint should include the source lines in the output where errors occurred (true by default) |
void |
setQuiet(boolean quiet) Sets whether lint should be quiet (for example, not write informational messages such as paths to report files written) |
void |
setShowAll(boolean showAll) Sets whether lint should include all output (e.g. include all alternate locations, not truncating long messages, etc.) |
void |
setTextReport(boolean textReport) |
void |
setWarningsAsErrors(boolean allErrors) Sets whether lint should treat all warnings as errors |
void |
setXmlOutput(File xmlOutput) |
void |
setXmlReport(boolean xmlReport) |
void |
syncTo(com.android.tools.lint.LintCliClient client, com.android.tools.lint.LintCliFlags flags, String variantName, org.gradle.api.Project project, boolean report) |
void |
textOutput(String textOutput) |
void |
textOutput(File textOutput) |
void |
warning(String id) Adds a severity override for the given issues. |
void |
warning(String... ids) Adds a severity override for the given issues. |
Adds the id to the set of issues to check.
Adds the ids to the set of issues to check.
Adds the id to the set of issues to enable.
Adds the ids to the set of issues to enable.
Adds the id to the set of issues to enable.
Adds the ids to the set of issues to enable.
Adds a severity override for the given issues.
Adds a severity override for the given issues.
Adds a severity override for the given issues.
Adds a severity override for the given issues.
Returns the exact set of issues to check, or null to run the issues that are enabled by default plus any issues enabled via getEnable and without issues disabled via getDisable. If non-null, callers are allowed to modify this collection.
Returns the set of issue id's to suppress. Callers are allowed to modify this collection.
Returns the set of issue id's to enable. Callers are allowed to modify this collection. To enable a given issue, add the issue ID to the returned set.
Whether we should write an HTML report. Default true. The location can be controlled by getHtmlOutput().
Returns the default configuration file to use as a fallback
An optional map of severity overrides. The map maps from issue id's to the corresponding severity to use, which must be "fatal", "error", "warning", or "ignore".
The optional path to where a text report should be written. The special value "stdout" can be used to point to standard output.
Whether we should write an text report. Default false. The location can be controlled by getTextOutput().
Whether we should write an XML report. Default true. The location can be controlled by getXmlOutput().
Adds a severity override for the given issues.
Adds a severity override for the given issues.
Whether lint should set the exit code of the process if errors are found
Whether lint should display full paths in the error output. By default the paths are relative to the path lint was invoked from.
Returns whether lint should check all warnings, including those off by default
Returns whether lint should check for fatal errors during release builds. Default is true. If issues with severity "fatal" are found, the release build is aborted.
Returns whether lint should include explanations for issue errors. (Note that HTML and XML reports intentionally do this unconditionally, ignoring this setting.)
Returns whether lint will only check for errors (ignoring warnings)
Whether lint should include the source lines in the output where errors occurred (true by default)
Returns whether lint should be quiet (for example, not write informational messages such as paths to report files written)
Returns whether lint should include all output (e.g. include all alternate locations, not truncating long messages, etc.)
Returns whether lint should treat all warnings as errors
Sets whether lint should set the exit code of the process if errors are found
Sets whether lint should display full paths in the error output. By default the paths are relative to the path lint was invoked from.
Sets the exact set of issues to check.
ids
- the set of issue id's to checkSets whether lint should check all warnings, including those off by default
Sets the set of issue id's to suppress. Callers are allowed to modify this collection. Note that these ids add to rather than replace the given set of ids.
Sets the set of issue id's to enable. Callers are allowed to modify this collection. Note that these ids add to rather than replace the given set of ids.
Sets whether lint will only check for errors (ignoring warnings)
Sets the default config file to use as a fallback. This corresponds to a lint.xml
file with severities etc to use when a project does not have more specific information.
Sets whether lint should include the source lines in the output where errors occurred (true by default)
Sets whether lint should be quiet (for example, not write informational messages such as paths to report files written)
Sets whether lint should include all output (e.g. include all alternate locations, not truncating long messages, etc.)
Sets whether lint should treat all warnings as errors
Adds a severity override for the given issues.
Adds a severity override for the given issues.