public final class GradleBaseProject extends Object implements Serializable, ModuleSearchSupport
Note: Caching / storing this object inn a member field is discouraged. Use
GradleBaseProject.get(Project)
instead.
org.gradle.api.Project
,
Serialized FormModifier and Type | Field and Description |
---|---|
static String |
PRIVATE_TASK_GROUP |
Modifier and Type | Method and Description |
---|---|
Set<GradleDependency.ModuleDependency> |
findModules(String gav)
Search for module dependencies, matches the given filter criteria.
|
Set<GradleDependency.ModuleDependency> |
findModules(String group,
String artifact,
String version)
Search for module dependencies, matches the given filter criteria.
|
String |
findProjectGav(String projectPath)
Finds a GAV for the given project.
|
static GradleBaseProject |
get(Project project)
Retrieve the actual GradleBaseProject from the given NetBeans
project lookup. |
Set<File> |
getBuildClassPath() |
File |
getBuildDir() |
Map<String,GradleConfiguration> |
getConfigurations() |
String |
getDescription() |
String |
getDisplayName() |
Set<File> |
getGradleClassPath()
The classpath used to
|
String |
getGroup() |
Map<String,File> |
getIncludedBuilds() |
String |
getLicense()
Returns the license identifier used in this Gradle project.
|
String |
getName()
This Gradle project name.
|
String |
getNetBeansProperty(String key)
Return the value of the property defined
netbeans.<key> as
in this Gradle project or inherited from the root project. |
Set<File> |
getOutputPaths() |
String |
getParentName() |
String |
getPath() |
Set<String> |
getPlugins()
The set of Gradle plugin ids used applied in this project.
|
Set<GradleReport> |
getProblems()
Return the list of problems reported by Gradle on
project inspection.
|
Set<GradleDependency.ProjectDependency> |
getProjectDependencies() |
File |
getProjectDir() |
File |
getRootDir()
The project directory of the root project.
|
String |
getStatus() |
Map<String,File> |
getSubProjects()
Returns the sub-project of this project, in a map as Gradle project path
and project directory pairs.
|
GradleTask |
getTaskByName(String name) |
Set<String> |
getTaskGroups() |
Set<String> |
getTaskNames() |
List<GradleTask> |
getTaskPredecessors(GradleTask gt,
boolean directs)
For a given task, lists all predecessors of the task within the current project.
|
List<GradleTask> |
getTasks() |
List<GradleTask> |
getTasks(String group) |
String |
getVersion() |
boolean |
hasPlugins(String... plugins) |
boolean |
isResolved()
Returns
true if all resolvable configurations are resolved. |
boolean |
isRoot()
Returns true if the project directory is the same as the root project's
project directory, in short if this project is a root project.
|
boolean |
isRootOf(GradleBaseProject other) |
boolean |
isSibling(GradleBaseProject other) |
boolean |
isTaskInstanceOf(String name,
String gradleFQN)
Determines if a task is a subtype of a certain Gradle type.
|
boolean |
isVersionSpecified() |
String |
toString() |
public static final String PRIVATE_TASK_GROUP
public String getName()
public String getPath()
public String getStatus()
public String getParentName()
public String getGroup()
public String getDescription()
public String getDisplayName()
public boolean isVersionSpecified()
public String getVersion()
public File getBuildDir()
public File getProjectDir()
public Set<String> getPlugins()
public File getRootDir()
public Set<GradleReport> getProblems()
public boolean isRoot()
public String getNetBeansProperty(String key)
netbeans.<key>
as
in this Gradle project or inherited from the root project.key
- the property name after the netbeans.
prefix.null
if it is not defined.public String getLicense()
netbeans.license
property of the project,
if that's not found license
property is used. If even that
would be undefined the license "default"
is used.default
if no license has
been specified.public Map<String,File> getSubProjects()
public String findProjectGav(@NonNull String projectPath)
null
if the project path
is not known (it is not referenced anywhere by this project), or has no known
GAV. The project's own GAV should be always present, if defined by the project
file(s).projectPath
- Gradle project pathnull
public List<GradleTask> getTasks(String group)
public List<GradleTask> getTasks()
public GradleTask getTaskByName(String name)
public List<GradleTask> getTaskPredecessors(GradleTask gt, boolean directs)
The result is partially sorted so that dependencies always precede the dependent task.
gt
- gradle task to inspectdirects
- if true, only direct predecessors are returnedpublic boolean isTaskInstanceOf(String name, String gradleFQN)
gradleFQN
parameter.gradleFQN
- the fully qualified type namepublic Map<String,GradleConfiguration> getConfigurations()
public Set<GradleDependency.ProjectDependency> getProjectDependencies()
public boolean hasPlugins(String... plugins)
public Set<GradleDependency.ModuleDependency> findModules(String group, String artifact, String version)
ModuleSearchSupport
null
for any of the parameters would mean match
all for that parameter.findModules
in interface ModuleSearchSupport
group
- regexp matcher for the group part.artifact
- regexp matcher for the artifact part.version
- regexp matcher for the version part.{@
public Set<GradleDependency.ModuleDependency> findModules(String gav) throws IllegalArgumentException
ModuleSearchSupport
findModules
in interface ModuleSearchSupport
gav
- the filter criteria in string formIllegalArgumentException
ModuleSearchSupport.findModules(java.lang.String, java.lang.String, java.lang.String)
public boolean isResolved()
true
if all resolvable configurations are resolved.public boolean isRootOf(GradleBaseProject other)
public boolean isSibling(GradleBaseProject other)
public static GradleBaseProject get(Project project)
project
lookup. If the project is not a Gradle project it
returns null
. It always returns a non-null value for a Gradle
project.project
- a NetBeans projectnull
for non-Gradle projects.NbGradleProject.Quality