@Beta
public class LintRequest
extends java.lang.Object
NOTE: This is not a public or final API; if you rely on this be prepared to adjust your code for the next tools release.
Modifier and Type | Field and Description |
---|---|
protected LintClient |
client |
protected java.util.List<java.io.File> |
files |
protected java.util.Collection<Project> |
projects |
protected java.lang.Boolean |
releaseMode |
protected java.util.EnumSet<Scope> |
scope |
Constructor and Description |
---|
LintRequest(LintClient client,
java.util.List<java.io.File> files)
Creates a new LintRequest, to be passed to a
LintDriver |
Modifier and Type | Method and Description |
---|---|
LintClient |
getClient()
Returns the lint client requesting the lint check
|
java.util.List<java.io.File> |
getFiles()
Returns the set of files to check with lint.
|
Project |
getMainProject(Project project)
Returns the project to be used as the main project during analysis.
|
java.util.Collection<Project> |
getProjects()
Gets the projects for the lint requests.
|
java.util.EnumSet<Scope> |
getScope()
Sets the scope to use; lint checks which require a wider scope set
will be ignored
|
java.lang.Boolean |
isReleaseMode()
Returns
true if lint is invoked as part of a release mode build,
false if it is part of a debug mode build, and null if
the release mode is not known |
void |
setProjects(java.util.Collection<Project> projects)
Sets the projects for the lint requests.
|
LintRequest |
setReleaseMode(java.lang.Boolean releaseMode)
Sets the release mode.
|
LintRequest |
setScope(java.util.EnumSet<Scope> scope)
Sets the scope to use; lint checks which require a wider scope set
will be ignored
|
@NonNull protected final LintClient client
@NonNull protected final java.util.List<java.io.File> files
@Nullable protected java.util.EnumSet<Scope> scope
@Nullable protected java.lang.Boolean releaseMode
@Nullable protected java.util.Collection<Project> projects
public LintRequest(@NonNull LintClient client, @NonNull java.util.List<java.io.File> files)
LintDriver
client
- the tool wrapping the analyzer, such as an IDE or a CLIfiles
- the set of files to check with lint. This can reference Android projects,
or directories containing Android projects, or individual XML or Java files
(typically for incremental IDE analysis).@NonNull public LintClient getClient()
@NonNull public java.util.List<java.io.File> getFiles()
@Nullable public java.util.EnumSet<Scope> getScope()
@NonNull public LintRequest setScope(@Nullable java.util.EnumSet<Scope> scope)
scope
- the scope@Nullable public java.lang.Boolean isReleaseMode()
true
if lint is invoked as part of a release mode build,
false
if it is part of a debug mode build, and null
if
the release mode is not known@NonNull public LintRequest setReleaseMode(@Nullable java.lang.Boolean releaseMode)
true
if lint is invoked as part of a
release mode build, false
if it is part of a debug mode build,
and null
if the release mode is not knownreleaseMode
- true if this lint is running in release mode, null if not known@Nullable public java.util.Collection<Project> getProjects()
getFiles()
directories and look for projects via LintClient.isProjectDirectory(java.io.File)
. However, this method allows a lint client to
set up all the projects ahead of time, and associate those projects with native resources
(in an IDE for example, each lint project can be associated with the corresponding IDE
project).public void setProjects(@Nullable java.util.Collection<Project> projects)
getFiles()
directories and look for projects via LintClient.isProjectDirectory(java.io.File)
. However, this method allows a lint client to
set up all the projects ahead of time, and associate those projects with native resources
(in an IDE for example, each lint project can be associated with the corresponding IDE
project).projects
- a collection of projects, or null@NonNull public Project getMainProject(@NonNull Project project)
project
- the project to look up the main project for