Project related utility methods.
| Type | Name and description |
|---|---|
static org.gradle.api.internal.file.FileResolver |
createBaseDirectoryFileResolver(org.gradle.api.Project pProject, java.lang.Object pBaseDirectory)Create a file resolver that resolves paths relative to a base directory. |
static java.io.File |
createReportDirectorySpec(org.gradle.api.Project pProject, java.lang.String pDirectoryItemName)Create a file specification for a file or directory within the project's main report directory. |
static java.io.File |
createTemporaryDirectorySpec(org.gradle.api.Project pProject, java.lang.String pDirectoryItemName)Create a file specification for a temporary directory. |
static boolean |
extractResource(java.lang.String pResource, java.io.File pFile)Extract a classpath resource to a file. |
static T |
getConventionPlugin(org.gradle.api.Project pProject, java.lang.String pName, java.lang.Class<T> pPluginClass)Get a plugin from a project's convention. |
static T |
getExtension(org.gradle.api.Project pProject, java.lang.String pName, java.lang.Class<T> pExtensionClass)Get an extension from a project. |
static org.gradle.api.internal.file.FileResolver |
getFileResolver(org.gradle.api.Project pProject)Get a project's file resolver. |
static org.gradle.api.tasks.SourceSet |
getSourceSet(org.gradle.api.Project pProject, java.lang.String pName)Get a source set from a project. |
static T |
getTask(org.gradle.api.Project pProject, java.lang.String pName, java.lang.Class<T> pTaskClass)Get a task from a project. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Create a file resolver that resolves paths relative to a base directory.
pProject - The project to create the resolver with.pBaseDirectory - The resolver's base directory, this path will be resolved relative
to the specified project's project directory before the resolver is
created.FileResolver, or null if one couldn't be created. Create a file specification for a file or directory within the project's main report
directory. If the specified project has the reporting extension installed, that extension's
baseDir property is used as the main reporting directory, otherwise the project's
build directory is used as the main reporting directory.
pProject - The project to create the report directory spec for.pDirectoryItemName - If non-null, the name of the directory item (file or
subdirectory) within the project's main report directory to
create the file spec for. If null, the file spec for the main
report directory will be returned.Create a file specification for a temporary directory.
pProject - The project to create the temporary directory spec for.pDirectoryItemName - If non-null, the name of the directory item (file or
subdirectory) within the project's temporary directory to create
the file spec for. If null, the file spec for the project's
temporary directory itself will be returned. Extract a classpath resource to a file. The resource will be accessed through the class
loader of the Projects class.
pResource - The name of the resource.pFile - The file to extract the resource to.Get a plugin from a project's convention.
pProject - The project.pName - The name of the plugin.pPluginClass
- The plugin's class (or a superclass of its class).Get an extension from a project.
pProject - The project.pName - The name of the extension.pExtensionClass
- The extension's class (or a superclass of its class).Get a project's file resolver.
pProject - The project to get the file resolver from.Get a source set from a project.
pProject - The project.pName - The name of the source set.Get a task from a project.
pProject - The project.pName - The name of the task.pTaskClass - The task's class (or a superclass of its class).