interface Project : Comparable<Project>, ExtensionAware, PluginAware
This interface is the main API you use to interact with Gradle from your build file. From a Project
, you have programmatic access to all of Gradle's features.
There is a one-to-one relationship between a Project
and a {@value #DEFAULT_BUILD_FILE}
file. During build initialisation, Gradle assembles a Project
object for each project which is to participate in the build, as follows:
{@value org.gradle.api.initialization.Settings#DEFAULT_SETTINGS_FILE}
script, if present, against the org.gradle.api.initialization.Settings object to configure it.Project
instances.Project
by executing its {@value #DEFAULT_BUILD_FILE}
file, if present, against the project. The projects are evaluated in breadth-wise order, such that a project is evaluated before its child projects. This order can be overridden by calling #evaluationDependsOnChildren()
or by adding an explicit evaluation dependency using #evaluationDependsOn(String)
.A project is essentially a collection of Task objects. Each task performs some basic piece of work, such as compiling classes, or running unit tests, or zipping up a WAR file. You add tasks to a project using one of the create()
methods on TaskContainer, such as TaskContainer#create(String)
. You can locate existing tasks using one of the lookup methods on TaskContainer, such as org.gradle.api.tasks.TaskCollection#getByName(String)
.
A project generally has a number of dependencies it needs in order to do its work. Also, a project generally produces a number of artifacts, which other projects can use. Those dependencies are grouped in configurations, and can be retrieved and uploaded from repositories. You use the org.gradle.api.artifacts.ConfigurationContainer returned by #getConfigurations()
method to manage the configurations. The returned by #getDependencies()
method to manage the dependencies. The org.gradle.api.artifacts.dsl.ArtifactHandler returned by #getArtifacts()
method to manage the artifacts. The org.gradle.api.artifacts.dsl.RepositoryHandler returned by
method to manage the repositories.
Projects are arranged into a hierarchy of projects. A project has a name, and a fully qualified path which uniquely identifies it in the hierarchy.
Plugins Plugins can be used to modularise and reuse project configuration. Plugins can be applied using the PluginAware#apply(java.util.Map)
method, or by using the org.gradle.plugin.use.PluginDependenciesSpec plugins script block.
Gradle executes the project's build file against the Project
instance to configure the project. Any property or method which your script uses is delegated through to the associated Project
object. This means, that you can use any of the methods and properties on the Project
interface directly in your script.
For example:
defaultTasks('some-task') // Delegates to Project.defaultTasks() reportsDir = file('reports') // Delegates to Project.file() and the Java Plugin
You can also access the Project
instance using the project
property. This can make the script clearer in some cases. For example, you could use project.name
rather than name
to access the project's name.
A project has 5 property 'scopes', which it searches for properties. You can access these properties by name in your build file, or by calling the project's #property(String)
method. The scopes are:
Project
object itself. This scope includes any property getters and setters declared by the Project
implementation class. For example, #getRootProject()
is accessible as the rootProject
property. The properties of this scope are readable or writable depending on the presence of the corresponding getter or setter method.compile
is accessible as the compile
property.When reading a property, the project searches the above scopes in order, and returns the value from the first scope it finds the property in. If not found, an exception is thrown. See #property(String)
for more details.
When writing a property, the project searches the above scopes in order, and sets the property in the first scope it finds the property in. If not found, an exception is thrown. See #setProperty(String, Object)
for more details.
project.ext.prop1 = "foo" task doStuff { ext.prop2 = "bar" } subprojects { ext.${prop3} = false }
Reading extra properties is done through the "ext" or through the owning object. ext.isSnapshot = version.endsWith("-SNAPSHOT") if (isSnapshot) { // do snapshot stuff }
Dynamic Methods
A project has 5 method 'scopes', which it searches for methods:
Project
object itself.Task#configure(groovy.lang.Closure)
method for the associated task with the provided closure. For example, if the project has a task called compile
, then a method is added with the following signature: void compile(Closure configureClosure)
.
static val DEFAULT_BUILD_DIR_NAME: String
The default build directory name. |
|
static val DEFAULT_BUILD_FILE: String
The default project build file name. |
|
static val DEFAULT_STATUS: String |
|
static val DEFAULT_VERSION: String |
|
static val GRADLE_PROPERTIES: String |
|
static val PATH_SEPARATOR: String
The hierarchy separator for project and task path names. |
|
static val SYSTEM_PROP_PREFIX: String |
abstract fun absoluteProjectPath(path: String): String
Converts a name to an absolute project path, resolving names relative to this project. |
|
abstract fun afterEvaluate(action: Action<in Project>): Unit
Adds an action to execute immediately after this project is evaluated. abstract fun afterEvaluate(closure: Closure<Any>): Unit
Adds a closure to be called immediately after this project has been evaluated. The project is passed to the closure as a parameter. Such a listener gets notified when the build file belonging to this project has been executed. A parent project may for example add such a listener to its child project. Such a listener can further configure those child projects based on the state of the child projects after their build files have been run. |
|
abstract fun allprojects(action: Action<in Project>): Unit
Configures this project and each of its sub-projects. This method executes the given Action against this project and each of its sub-projects. abstract fun allprojects(configureClosure: Closure<Any>): Unit
Configures this project and each of its sub-projects. This method executes the given closure against this project and its sub-projects. The target Project is passed to the closure as the closure's delegate. |
|
abstract fun ant(configureClosure: Closure<Any>): AntBuilder
Executes the given closure against the abstract fun ant(configureAction: Action<in AntBuilder>): AntBuilder
Executes the given action against the |
|
abstract fun artifacts(configureClosure: Closure<Any>): Unit
Configures the published artifacts for this project. This method executes the given closure against the ArtifactHandler for this project. The is passed to the closure as the closure's delegate. Example:
abstract fun artifacts(configureAction: Action<in ArtifactHandler>): Unit
Configures the published artifacts for this project. This method executes the given action against the ArtifactHandler for this project. Example:
|
|
abstract fun beforeEvaluate(action: Action<in Project>): Unit
Adds an action to execute immediately before this project is evaluated. abstract fun beforeEvaluate(closure: Closure<Any>): Unit
Adds a closure to be called immediately before this project is evaluated. The project is passed to the closure as a parameter. |
|
abstract fun buildscript(configureClosure: Closure<Any>): Unit
Configures the build script classpath for this project. The given closure is executed against this project's ScriptHandler. The ScriptHandler is passed to the closure as the closure's delegate. |
|
abstract fun configurations(configureClosure: Closure<Any>): Unit
Configures the dependency configurations for this project. This method executes the given closure against the ConfigurationContainer for this project. The ConfigurationContainer is passed to the closure as the closure's delegate. Examples: See docs for ConfigurationContainer |
|
abstract fun configure(object: Any, configureClosure: Closure<Any>): Any
Configures an object via a closure, with the closure's delegate set to the supplied object. This way you don't have to specify the context of a configuration statement multiple times. Instead of:
you can do:
The object being configured is also passed to the closure as a parameter, so you can access it explicitly if required:
abstract fun configure(objects: MutableIterable<*>, configureClosure: Closure<Any>): MutableIterable<*>
Configures a collection of objects via a closure. This is equivalent to calling abstract fun <T : Any> configure(objects: MutableIterable<T>, configureAction: Action<in T>): MutableIterable<T>
Configures a collection of objects via an action. |
|
abstract fun <T : Any> container(type: Class<T>): NamedDomainObjectContainer<T>
Creates a container for managing named objects of the specified type. The specified type must have a public constructor which takes the name as a String parameter. All objects MUST expose their name as a bean property named "name". The name must be constant for the life of the object. abstract fun <T : Any> container(type: Class<T>, factory: NamedDomainObjectFactory<T>): NamedDomainObjectContainer<T>
Creates a container for managing named objects of the specified type. The given factory is used to create object instances. All objects MUST expose their name as a bean property named "name". The name must be constant for the life of the object. abstract fun <T : Any> container(type: Class<T>, factoryClosure: Closure<Any>): NamedDomainObjectContainer<T>
Creates a container for managing named objects of the specified type. The given closure is used to create object instances. The name of the instance to be created is passed as a parameter to the closure. All objects MUST expose their name as a bean property named "name". The name must be constant for the life of the object. |
|
abstract fun copy(closure: Closure<Any>): WorkResult
Copies the specified files. The given closure is used to configure a CopySpec, which is then used to copy the files. Example: Note that CopySpecs can be nested:
abstract fun copy(action: Action<in CopySpec>): WorkResult
Copies the specified files. The given action is used to configure a CopySpec, which is then used to copy the files. |
|
abstract fun copySpec(closure: Closure<Any>): CopySpec
Creates a CopySpec which can later be used to copy files or create an archive. The given closure is used to configure the CopySpec before it is returned by this method.
abstract fun copySpec(action: Action<in CopySpec>): CopySpec
Creates a CopySpec which can later be used to copy files or create an archive. The given action is used to configure the CopySpec before it is returned by this method. abstract fun copySpec(): CopySpec
Creates a CopySpec which can later be used to copy files or create an archive. |
|
abstract fun createAntBuilder(): AntBuilder
Creates an additional |
|
abstract fun defaultTasks(vararg defaultTasks: String): Unit
Sets the names of the default tasks of this project. These are used when no tasks names are provided when starting the build. |
|
abstract fun delete(vararg paths: Any): Boolean
Deletes files and directories. This will not follow symlinks. If you need to follow symlinks too use abstract fun delete(action: Action<in DeleteSpec>): WorkResult
Deletes the specified files. The given action is used to configure a DeleteSpec, which is then used to delete the files. Example:
|
|
abstract fun dependencies(configureClosure: Closure<Any>): Unit
Configures the dependencies for this project. This method executes the given closure against the DependencyHandler for this project. The is passed to the closure as the closure's delegate. Examples: See docs for DependencyHandler |
|
abstract fun dependencyLocking(configuration: Action<in DependencyLockingHandler>): Unit
Configures dependency locking |
|
abstract fun depthCompare(otherProject: Project): Int
Compares the nesting level of this project with another project of the multi-project hierarchy. |
|
abstract fun evaluationDependsOn(path: String): Project
Declares that this project has an evaluation dependency on the project with the given path. |
|
abstract fun evaluationDependsOnChildren(): Unit
Declares that this project has an evaluation dependency on each of its child projects. |
|
abstract fun exec(closure: Closure<Any>): ExecResult
Executes an external command. The closure configures a org.gradle.process.ExecSpec. abstract fun exec(action: Action<in ExecSpec>): ExecResult
Executes an external command. The given action configures a org.gradle.process.ExecSpec, which is used to launch the process. This method blocks until the process terminates, with its result being returned. |
|
abstract fun file(path: Any): File
Resolves a file path relative to the project directory of this project. This method converts the supplied path based on its type:
abstract fun file(path: Any, validation: PathValidation): File
Resolves a file path relative to the project directory of this project and validates it using the given scheme. See PathValidation for the list of possible validations. |
|
abstract fun fileTree(baseDir: Any): ConfigurableFileTree
Creates a new The returned file tree is lazy, so that it scans for files only when the contents of the file tree are queried. The file tree is also live, so that it scans for files each time the contents of the file tree are queried.
abstract fun fileTree(baseDir: Any, configureClosure: Closure<Any>): ConfigurableFileTree
Creates a new
The returned file tree is lazy, so that it scans for files only when the contents of the file tree are queried. The file tree is also live, so that it scans for files each time the contents of the file tree are queried. abstract fun fileTree(baseDir: Any, configureAction: Action<in ConfigurableFileTree>): ConfigurableFileTree
Creates a new
The returned file tree is lazy, so that it scans for files only when the contents of the file tree are queried. The file tree is also live, so that it scans for files each time the contents of the file tree are queried. abstract fun fileTree(args: MutableMap<String, *>): ConfigurableFileTree
Creates a new
The returned file tree is lazy, so that it scans for files only when the contents of the file tree are queried. The file tree is also live, so that it scans for files each time the contents of the file tree are queried. |
|
abstract fun files(vararg paths: Any): ConfigurableFileCollection
Returns a ConfigurableFileCollection containing the given files. You can pass any of the following types to this method:
The returned file collection is lazy, so that the paths are evaluated only when the contents of the file collection are queried. The file collection is also live, so that it evaluates the above each time the contents of the collection is queried. The returned file collection maintains the iteration order of the supplied paths. The returned file collection maintains the details of the tasks that produce the files, so that these tasks are executed if this file collection is used as an input to some task. This method can also be used to create an empty collection, which can later be mutated to add elements. abstract fun files(paths: Any, configureClosure: Closure<Any>): ConfigurableFileCollection
Creates a new
The returned file collection is lazy, so that the paths are evaluated only when the contents of the file collection are queried. The file collection is also live, so that it evaluates the above each time the contents of the collection is queried. abstract fun files(paths: Any, configureAction: Action<in ConfigurableFileCollection>): ConfigurableFileCollection
Creates a new
The returned file collection is lazy, so that the paths are evaluated only when the contents of the file collection are queried. The file collection is also live, so that it evaluates the above each time the contents of the collection is queried. |
|
abstract fun findProject(path: String): Project
Locates a project by path. If the path is relative, it is interpreted relative to this project. |
|
abstract fun findProperty(propertyName: String): Any
Returns the value of the given property or null if not found. This method locates a property as follows:
|
|
abstract fun getAllTasks(recursive: Boolean): MutableMap<Project, MutableSet<Task>>
Returns a map of the tasks contained in this project, and optionally its subprojects. |
|
abstract fun getAllprojects(): MutableSet<Project>
Returns the set containing this project and its subprojects. |
|
abstract fun getAnt(): AntBuilder
Returns the Consider following example of ant target: Here's how it would look like in gradle. Observe how the ant XML is represented in groovy by the ant builder
|
|
abstract fun getArtifacts(): ArtifactHandler
Returns a handler for assigning artifacts produced by the project to configurations. Examples:See docs for ArtifactHandler |
|
abstract fun getBuildDir(): File
Returns the build directory of this project. The build directory is the directory which all artifacts are generated into. The default value for the build directory is |
|
abstract fun getBuildFile(): File
The build script for this project. If the file exists, it will be evaluated against this project when this project is configured. |
|
abstract fun getBuildscript(): ScriptHandler
Returns the build script handler for this project. You can use this handler to query details about the build script for this project, and manage the classpath used to compile and execute the project's build script. |
|
abstract fun getChildProjects(): MutableMap<String, Project>
Returns the direct children of this project. |
|
abstract fun getComponents(): SoftwareComponentContainer
Returns the software components produced by this project. |
|
abstract fun getConfigurations(): ConfigurationContainer
Returns the configurations of this project. Examples: See docs for ConfigurationContainer |
|
abstract fun getConvention(): Convention
Returns the Convention for this project. You can access this property in your build file using |
|
abstract fun getDefaultTasks(): MutableList<String>
Returns the names of the default tasks of this project. These are used when no tasks names are provided when starting the build. |
|
abstract fun getDependencies(): DependencyHandler
Returns the dependency handler of this project. The returned dependency handler instance can be used for adding new dependencies. For accessing already declared dependencies, the configurations can be used. Examples: See docs for DependencyHandler |
|
abstract fun getDependencyLocking(): DependencyLockingHandler
Provides access to configuring dependency locking |
|
abstract fun getDepth(): Int
Returns the nesting level of a project in a multi-project hierarchy. For single project builds this is always 0. In a multi-project hierarchy 0 is returned for the root project. |
|
abstract fun getDescription(): String
Returns the description of this project, if any. |
|
abstract fun getDisplayName(): String
Returns a human-consumable display name for this project. |
|
abstract fun getExtensions(): ExtensionContainer
Allows adding DSL extensions to the project. Useful for plugin authors. |
|
abstract fun getGradle(): Gradle
Returns the org.gradle.api.invocation.Gradle invocation which this project belongs to. |
|
abstract fun getGroup(): Any
Returns the group of this project. Gradle always uses the |
|
abstract fun getLayout(): ProjectLayout
Provides access to various important directories for this project. |
|
abstract fun getLogger(): Logger
Returns the logger for this project. You can use this in your build file to write log messages. |
|
abstract fun getLogging(): LoggingManager
Returns the org.gradle.api.logging.LoggingManager which can be used to receive logging and to control the standard output/error capture for this project's build script. By default, System.out is redirected to the Gradle logging system at the QUIET log level, and System.err is redirected at the ERROR log level. |
|
abstract fun getName(): String
Returns the name of this project. The project's name is not necessarily unique within a project hierarchy. You should use the |
|
abstract fun getNormalization(): InputNormalizationHandler
Provides access to configuring input normalization. |
|
abstract fun getObjects(): ObjectFactory
Provides access to methods to create various kinds of model objects. |
|
abstract fun getParent(): Project
Returns the parent project of this project, if any. |
|
abstract fun getPath(): String
Returns the path of this project. The path is the fully qualified name of the project. |
|
abstract fun getProject(): Project
Returns this project. This method is useful in build files to explicitly access project properties and methods. For example, using |
|
abstract fun getProjectDir(): File
The directory containing the project build file. |
|
abstract fun getProperties(): MutableMap<String, *>
Returns the properties of this project. See here for details of the properties which are available for a project. |
|
abstract fun getProviders(): ProviderFactory
Provides access to methods to create various kinds of Provider instances. |
|
abstract fun getRepositories(): RepositoryHandler
Returns a handler to create repositories which are used for retrieving dependencies and uploading artifacts produced by the project. |
|
abstract fun getResources(): ResourceHandler
Provides access to resource-specific utility methods, for example factory methods that create various resources. |
|
abstract fun getRootDir(): File
Returns the root directory of this project. The root directory is the project directory of the root project. |
|
abstract fun getRootProject(): Project
Returns the root project for the hierarchy that this project belongs to. In the case of a single-project build, this method returns this project. |
|
abstract fun getState(): ProjectState
Returns the evaluation state of this project. You can use this to access information about the evaluation of this project, such as whether it has failed. |
|
abstract fun getStatus(): Any
Returns the status of this project. Gradle always uses the The status of the project is only relevant, if you upload libraries together with a module descriptor. The status specified here, will be part of this module descriptor. |
|
abstract fun getSubprojects(): MutableSet<Project>
Returns the set containing the subprojects of this project. |
|
abstract fun getTasks(): TaskContainer
Returns the tasks of this project. |
|
abstract fun getTasksByName(name: String, recursive: Boolean): MutableSet<Task>
Returns the set of tasks with the given name contained in this project, and optionally its subprojects. |
|
abstract fun getVersion(): Any
Returns the version of this project. Gradle always uses the |
|
abstract fun hasProperty(propertyName: String): Boolean
Determines if this project has the given property. See here for details of the properties which are available for a project. |
|
abstract fun javaexec(closure: Closure<Any>): ExecResult
Executes a Java main class. The closure configures a org.gradle.process.JavaExecSpec. abstract fun javaexec(action: Action<in JavaExecSpec>): ExecResult
Executes an external Java process. The given action configures a org.gradle.process.JavaExecSpec, which is used to launch the process. This method blocks until the process terminates, with its result being returned. |
|
abstract fun mkdir(path: Any): File
Creates a directory and returns a file pointing to it. |
|
abstract fun normalization(configuration: Action<in InputNormalizationHandler>): Unit
Configures input normalization. |
|
abstract fun project(path: String): Project
Locates a project by path. If the path is relative, it is interpreted relative to this project. abstract fun project(path: String, configureClosure: Closure<Any>): Project
Locates a project by path and configures it using the given closure. If the path is relative, it is interpreted relative to this project. The target project is passed to the closure as the closure's delegate. abstract fun project(path: String, configureAction: Action<in Project>): Project
Locates a project by path and configures it using the given action. If the path is relative, it is interpreted relative to this project. |
|
abstract fun <T : Any> property(clazz: Class<T>): PropertyState<T>
Creates a abstract fun property(propertyName: String): Any
Returns the value of the given property. This method locates a property as follows:
|
|
abstract fun <T : Any> provider(value: Callable<T>): Provider<T>
Creates a |
|
abstract fun relativePath(path: Any): String
Returns the relative path from the project directory to the given path. The given path object is (logically) resolved as described for |
|
abstract fun relativeProjectPath(path: String): String
Converts a name to a project path relative to this project. |
|
abstract fun repositories(configureClosure: Closure<Any>): Unit
Configures the repositories for this project. This method executes the given closure against the RepositoryHandler for this project. The is passed to the closure as the closure's delegate. |
|
abstract fun setBuildDir(path: File): Unit
Sets the build directory of this project. The build directory is the directory which all artifacts are generated into. abstract fun setBuildDir(path: Any): Unit
Sets the build directory of this project. The build directory is the directory which all artifacts are generated into. The path parameter is evaluated as described for |
|
abstract fun setDefaultTasks(defaultTasks: MutableList<String>): Unit
Sets the names of the default tasks of this project. These are used when no tasks names are provided when starting the build. |
|
abstract fun setDescription(description: String): Unit
Sets a description for this project. |
|
abstract fun setGroup(group: Any): Unit
Sets the group of this project. |
|
abstract fun setProperty(name: String, value: Any): Unit
Sets a property of this project. This method searches for a property with the given name in the following locations, and sets the property on the first location where it finds the property.
|
|
abstract fun setStatus(status: Any): Unit
Sets the status of this project. |
|
abstract fun setVersion(version: Any): Unit
Sets the version of this project. |
|
abstract fun subprojects(action: Action<in Project>): Unit
Configures the sub-projects of this project This method executes the given Action against the sub-projects of this project. abstract fun subprojects(configureClosure: Closure<Any>): Unit
Configures the sub-projects of this project. This method executes the given closure against each of the sub-projects of this project. The target is passed to the closure as the closure's delegate. |
|
abstract fun sync(action: Action<in CopySpec>): WorkResult
Synchronizes the contents of a destination directory with some source directories and files. The given action is used to configure a CopySpec, which is then used to synchronize the files. This method is like the Example: Note that you can preserve output that already exists in the destination directory:
|
|
abstract fun tarTree(tarPath: Any): FileTree
Creates a new
Unless custom implementation of resources is passed, the tar tree attempts to guess the compression based on the file extension. You can combine this method with the
|
|
abstract fun task(name: String): Task
Creates a Task with the given name and adds it to this project. Calling this method is equivalent to calling After the task is added to the project, it is made available as a property of the project, so that you can reference the task by name in your build file. See here for more details If a task with the given name already exists in this project, an exception is thrown. abstract fun task(args: MutableMap<String, *>, name: String): Task
Creates a Task with the given name and adds it to this project. A map of creation options can be passed to this method to control how the task is created. The following options are available: OptionDescriptionDefault Value{@value org.gradle.api.Task#TASK_TYPE} The class of the task to create.org.gradle.api.DefaultTask {@value org.gradle.api.Task#TASK_OVERWRITE} Replace an existing task?false {@value org.gradle.api.Task#TASK_DEPENDS_ON} A task name or set of task names which this task depends on[] {@value org.gradle.api.Task#TASK_ACTION} A closure or Action to add to the task.null {@value org.gradle.api.Task#TASK_DESCRIPTION} A description of the task. null {@value org.gradle.api.Task#TASK_GROUP} A task group which this task belongs to. null
After the task is added to the project, it is made available as a property of the project, so that you can reference the task by name in your build file. See here for more details If a task with the given name already exists in this project and the abstract fun task(args: MutableMap<String, *>, name: String, configureClosure: Closure<Any>): Task
Creates a Task with the given name and adds it to this project. Before the task is returned, the given closure is executed to configure the task. A map of creation options can be passed to this method to control how the task is created. See After the task is added to the project, it is made available as a property of the project, so that you can reference the task by name in your build file. See here for more details If a task with the given name already exists in this project and the abstract fun task(name: String, configureClosure: Closure<Any>): Task
Creates a Task with the given name and adds it to this project. Before the task is returned, the given closure is executed to configure the task. After the task is added to the project, it is made available as a property of the project, so that you can reference the task by name in your build file. See here for more details |
|
abstract fun uri(path: Any): URI
Resolves a file path to a URI, relative to the project directory of this project. Evaluates the provided path object as described for |
|
abstract fun zipTree(zipPath: Any): FileTree
Creates a new The returned file tree is lazy, so that it scans for files only when the contents of the file tree are queried. The file tree is also live, so that it scans for files each time the contents of the file tree are queried. |
abstract fun apply(closure: Closure<Any>): Unit abstract fun apply(action: Action<in ObjectConfigurationAction>): Unit
Applies zero or more plugins or scripts. The given closure is used to configure an ObjectConfigurationAction, which “builds” the plugin application. This method differs from abstract fun apply(options: MutableMap<String, *>): Unit
Applies a plugin or script, using the given options provided as a map. Does nothing if the plugin has already been applied. The given map is applied as a series of method calls to a newly created ObjectConfigurationAction. That is, each key in the map is expected to be the name of a method ObjectConfigurationAction and the value to be compatible arguments to that method. The following options are available:
|
|
abstract fun getPluginManager(): PluginManager
The plugin manager for this plugin aware object. |
|
abstract fun getPlugins(): PluginContainer
The container of plugins that have been applied to this object. While not deprecated, it is preferred to use the methods of this interface or the Use one of the 'apply' methods on this interface or on the Use |
val Project.announce: AnnouncePluginExtension
Retrieves the announce extension. |
|
val Project.application: ApplicationPluginConvention
Retrieves the application convention. |
|
val Project.base: BasePluginConvention
Retrieves the base convention. |
|
val Project.buildTypes: BuildTypeContainer
Retrieves the buildTypes extension. |
|
val Project.checkstyle: CheckstyleExtension
Retrieves the checkstyle extension. |
|
val Project.codenarc: CodeNarcExtension
Retrieves the codenarc extension. |
|
val Project.defaultArtifacts: <ERROR CLASS>
Retrieves the defaultArtifacts extension. |
|
val Project.distributions: DistributionContainer
Retrieves the distributions extension. |
|
val Project.ear: EarPluginConvention
Retrieves the ear convention. |
|
val Project.eclipse: EclipseModel
Retrieves the eclipse extension. |
|
val Project.ext: ExtraPropertiesExtension
Retrieves the ext extension. |
|
val Project.findbugs: FindBugsExtension
Retrieves the findbugs extension. |
|
val Project.flavors: FlavorContainer
Retrieves the flavors extension. |
|
val Project.gradlePlugin: GradlePluginDevelopmentExtension
Retrieves the gradlePlugin extension. |
|
val Project.groovyRuntime: GroovyRuntime
Retrieves the groovyRuntime extension. |
|
val Project.idea: IdeaModel
Retrieves the idea extension. |
|
val Project.jacoco: JacocoPluginExtension
Retrieves the jacoco extension. |
|
val Project.java: JavaPluginConvention
Retrieves the java convention. |
|
val Project.javaScript: JavaScriptExtension
Retrieves the javaScript extension. |
|
val Project.jdepend: JDependExtension
Retrieves the jdepend extension. |
|
val Project.maven: MavenPluginConvention
Retrieves the maven convention. |
|
val Project.osgi: OsgiPluginConvention
Retrieves the osgi convention. |
|
val Project.platforms: PlatformContainer
Retrieves the platforms extension. |
|
val Project.playConfigurations: PlayPluginConfigurations
Retrieves the playConfigurations extension. |
|
val Project.pmd: PmdExtension
Retrieves the pmd extension. |
|
val Project.projectReports: ProjectReportsPluginConvention
Retrieves the projectReports convention. |
|
val Project.publishing: PublishingExtension
Retrieves the publishing extension. |
|
val Project.reporting: ReportingExtension
Retrieves the reporting extension. |
|
val Project.scalaRuntime: ScalaRuntime
Retrieves the scalaRuntime extension. |
|
val Project.signing: SigningExtension
Retrieves the signing extension. |
|
val Project.toolChains: NativeToolChainRegistry
Retrieves the toolChains extension. |
|
val Project.visualStudio: VisualStudioRootExtension
Retrieves the visualStudio extension. |
|
val Project.war: WarPluginConvention
Retrieves the war convention. |
|
val Project.xcode: XcodeRootExtension
Retrieves the xcode extension. |
fun Project.announce(configure: AnnouncePluginExtension.() -> Unit): Unit
Configures the announce extension. |
|
fun Project.application(configure: ApplicationPluginConvention.() -> Unit): Unit
Configures the application convention. |
|
fun <T : Plugin<Project>> Project.apply(): Unit
Applies the plugin of the given type T. Does nothing if the plugin has already been applied. |
|
fun Project.base(configure: BasePluginConvention.() -> Unit): Unit
Configures the base convention. |
|
fun Project.buildTypes(configure: BuildTypeContainer.() -> Unit): Unit
Configures the buildTypes extension. |
|
fun Project.buildscript(action: ScriptHandlerScope.() -> Unit): Unit |
|
fun Project.checkstyle(configure: CheckstyleExtension.() -> Unit): Unit
Configures the checkstyle extension. |
|
fun Project.codenarc(configure: CodeNarcExtension.() -> Unit): Unit
Configures the codenarc extension. |
|
fun <T : Any> Project.configure(configuration: T.() -> Unit): Unit
Executes the given configuration block against the plugin convention or extension of the specified type. |
|
fun <T : Task> Project.createTask(name: String, type: KClass<T>, configuration: T.() -> Unit): T |
|
fun Project.defaultArtifacts(configure: <ERROR CLASS>.() -> Unit): Unit
Configures the defaultArtifacts extension. |
|
fun Project.defaultTasks(vararg tasks: Task): Unit
Sets the default tasks of this project. These are used when no tasks names are provided when starting the build. |
|
fun Project.dependencies(configuration: DependencyHandlerScope.() -> Unit): Unit
Configures the dependencies for this project. |
|
fun Project.distributions(configure: DistributionContainer.() -> Unit): Unit
Configures the distributions extension. |
|
fun Project.ear(configure: EarPluginConvention.() -> Unit): Unit
Configures the ear convention. |
|
fun Project.eclipse(configure: EclipseModel.() -> Unit): Unit
Configures the eclipse extension. |
|
fun Project.ext(configure: ExtraPropertiesExtension.() -> Unit): Unit
Configures the ext extension. |
|
fun Project.findbugs(configure: FindBugsExtension.() -> Unit): Unit
Configures the findbugs extension. |
|
fun Project.flavors(configure: FlavorContainer.() -> Unit): Unit
Configures the flavors extension. |
|
fun Project.gradleKotlinDsl(): Dependency
Creates a dependency on the API of the current version of the Gradle Kotlin DSL. |
|
fun Project.gradlePlugin(configure: GradlePluginDevelopmentExtension.() -> Unit): Unit
Configures the gradlePlugin extension. |
|
fun Project. |
|
fun Project.groovyRuntime(configure: GroovyRuntime.() -> Unit): Unit
Configures the groovyRuntime extension. |
|
fun Project.idea(configure: IdeaModel.() -> Unit): Unit
Configures the idea extension. |
|
fun Project.jacoco(configure: JacocoPluginExtension.() -> Unit): Unit
Configures the jacoco extension. |
|
fun Project.java(configure: JavaPluginConvention.() -> Unit): Unit
Configures the java convention. |
|
fun Project.javaScript(configure: JavaScriptExtension.() -> Unit): Unit
Configures the javaScript extension. |
|
fun Project.jdepend(configure: JDependExtension.() -> Unit): Unit
Configures the jdepend extension. |
|
fun Project.maven(configure: MavenPluginConvention.() -> Unit): Unit
Configures the maven convention. |
|
fun Project.osgi(configure: OsgiPluginConvention.() -> Unit): Unit
Configures the osgi convention. |
|
fun Project.platforms(configure: PlatformContainer.() -> Unit): Unit
Configures the platforms extension. |
|
fun Project.playConfigurations(configure: PlayPluginConfigurations.() -> Unit): Unit
Configures the playConfigurations extension. |
|
fun Project.pmd(configure: PmdExtension.() -> Unit): Unit
Configures the pmd extension. |
|
fun Project.projectReports(configure: ProjectReportsPluginConvention.() -> Unit): Unit
Configures the projectReports convention. |
|
fun <T> Project.
Creates a PropertyState that holds values of the given type T. |
|
operator fun Project.provideDelegate(any: Any?, property: KProperty<*>): PropertyDelegate
Locates a property on Project. |
|
fun Project.publishing(configure: PublishingExtension.() -> Unit): Unit
Configures the publishing extension. |
|
fun Project.reporting(configure: ReportingExtension.() -> Unit): Unit
Configures the reporting extension. |
|
fun Project.repositories(configuration: RepositoryHandler.() -> Unit): Unit
Configures the repositories for this project. |
|
fun Project.scalaRuntime(configure: ScalaRuntime.() -> Unit): Unit
Configures the scalaRuntime extension. |
|
fun Project.signing(configure: SigningExtension.() -> Unit): Unit
Configures the signing extension. |
|
fun <type : Task> Project.task(name: String, configuration: type.() -> Unit): type
Creates a Task with the given name and type, configures it with the given configuration action, and adds it to this project tasks container. fun <type : Task> Project.task(name: String): type
Creates a Task with the given name and type, and adds it to this project tasks container. fun <T : Task> Project.task(name: String, type: KClass<T>, configuration: T.() -> Unit): T fun Project.task(name: String, configuration: Task.() -> Unit): DefaultTask
Creates a Task with the given name and DefaultTask type, configures it with the given configuration action, and adds it to this project tasks container. |
|
fun <T : Any> Project.the(): T fun <T : Any> Project.the(extensionType: KClass<T>): T
Returns the plugin convention or extension of the specified type. |
|
fun Project.toolChains(configure: NativeToolChainRegistry.() -> Unit): Unit
Configures the toolChains extension. |
|
fun Project.visualStudio(configure: VisualStudioRootExtension.() -> Unit): Unit
Configures the visualStudio extension. |
|
fun Project.war(configure: WarPluginConvention.() -> Unit): Unit
Configures the war convention. |
|
fun Project.xcode(configure: XcodeRootExtension.() -> Unit): Unit
Configures the xcode extension. |
abstract class KotlinBuildScript : Project
Base class for Kotlin build scripts. |