@Incubating public interface ProblemSpec
ProblemReporter
Modifier and Type | Method | Description |
---|---|---|
ProblemSpec |
category(java.lang.String category,
java.lang.String... subcategories) |
A category groups related problems together.
|
ProblemSpec |
details(java.lang.String details) |
The long description of this problem.
|
ProblemSpec |
documentedAt(java.lang.String url) |
Declares where this problem is documented.
|
ProblemSpec |
fileLocation(java.lang.String path) |
Declares that this problem is in a file.
|
ProblemSpec |
label(java.lang.String label) |
Declares a short message for this problem.
|
ProblemSpec |
lineInFileLocation(java.lang.String path,
int line) |
Declares that this problem is in a file on a line.
|
ProblemSpec |
lineInFileLocation(java.lang.String path,
int line,
int column) |
Declares that this problem is in a file with on a line at a certain position.
|
ProblemSpec |
lineInFileLocation(java.lang.String path,
int line,
int column,
int length) |
Declares that this problem is in a file with on a line at a certain position.
|
ProblemSpec |
offsetInFileLocation(java.lang.String path,
int offset,
int length) |
Declares that this problem is in a file at a certain global position with a given length.
|
ProblemSpec |
pluginLocation(java.lang.String pluginId) |
Declares that this problem is emitted while applying a plugin.
|
ProblemSpec |
severity(Severity severity) |
Declares the severity of the problem.
|
ProblemSpec |
solution(java.lang.String solution) |
A description of how to solve this problem.
|
ProblemSpec |
stackLocation() |
Declares that this problem should automatically collect the location information based on the current stack trace.
|
ProblemSpec |
withException(java.lang.RuntimeException e) |
The exception causing this problem.
|
ProblemSpec label(java.lang.String label)
The label is the main, human-readable representation of the problem.
It is a mandatory property to configure when emitting a problem with ProblemReporter
.
label
- the short messageProblemSpec category(java.lang.String category, java.lang.String... subcategories)
Category is a mandatory property to configure when emitting a problem with ProblemReporter
.
A category defines the following hierarchical elements to distinguish instances:
The namespace provides separation for identical problems emitted from different components.
Problems emitted from Gradle core will use the org.gradle
namespace.
Third party plugins are expected to use their plugin id for namespace.
Problems emitted from build scripts should use the buildscript
namespace.
The namespace is bound to ProblemReporter
, hence it is absent from the argument list.
A category should contain the most broad term describing the problem.
A few examples are: compilation
, deprecation
, task-validation
.
The problem category can be refined with an optional hierarchy of subcategories.
For example, a problem covering a java compilation warning can be denoted with the following subcategories: [java, unused-variable]
.
The categorization depends on the domain and don't have any constraints. Clients (i.e. IDEs) receiving problems should use the category information for properly group and sort the received instances. However, we recommend to use the same conventions as the problems emitted from Gradle core use.
category:subcategory1:subcategory2
).
category
- the type namesubcategories
- the type subcategoriesProblemSpec documentedAt(java.lang.String url)
ProblemSpec fileLocation(java.lang.String path)
path
- the file locationProblemSpec lineInFileLocation(java.lang.String path, int line)
path
- the file locationline
- the one-indexed line numberProblemSpec lineInFileLocation(java.lang.String path, int line, int column)
path
- the file locationline
- the one-indexed line numbercolumn
- the one-indexed columnProblemSpec lineInFileLocation(java.lang.String path, int line, int column, int length)
path
- the file locationline
- the one-indexed line numbercolumn
- the one-indexed columnlength
- the length of the textProblemSpec offsetInFileLocation(java.lang.String path, int offset, int length)
path
- the file locationoffset
- the zero-indexed global offset from the beginning of the filelength
- the length of the textProblemSpec pluginLocation(java.lang.String pluginId)
pluginId
- the ID of the applied pluginProblemSpec stackLocation()
ProblemSpec details(java.lang.String details)
details
- the detailsProblemSpec solution(java.lang.String solution)
solution
- the solution.ProblemSpec withException(java.lang.RuntimeException e)
e
- the exception.ProblemSpec severity(Severity severity)
severity
- the severity