Gradle

Represents an invocation of Gradle.

You can obtain a Gradle instance by calling getGradle.

Properties

Link copied to clipboard

The extra properties extension in this object's extension container.

Functions

Link copied to clipboard
abstract fun addBuildListener(buildListener: BuildListener)
Adds a BuildListener to this Build instance.
Link copied to clipboard
abstract fun addListener(listener: Any)
Adds the given listener to this build.
Link copied to clipboard
Adds a listener to this build, to receive notifications as projects are evaluated.
Link copied to clipboard
abstract fun afterProject(closure: Closure)
Adds a closure to be called immediately after a project is evaluated.
abstract fun afterProject(action: Action<in Project>)
Adds an action to be called immediately after a project is evaluated.
Link copied to clipboard
abstract fun allprojects(action: Action<in Project>)
Adds an action to execute against all projects of this build.
Link copied to clipboard
abstract fun apply(closure: Closure)
Link copied to clipboard
inline fun <T : Plugin<Gradle>> Gradle.apply()
inline fun <T : Plugin<*>> PluginAware.apply()

Applies the plugin of the given type T. Does nothing if the plugin has already been applied.

inline fun PluginAware.apply(vararg options: Pair<String, Any?>)

Kotlin extension function for org.gradle.api.plugins.PluginAware.apply.

fun PluginAware.apply(from: Any? = null, plugin: String? = null, to: Any? = null)

Applies the given plugin or script.

Link copied to clipboard
inline fun <T : Plugin<*>> PluginAware.applyTo(vararg targets: Any)

Applies the plugin of the given type T to the specified object. Does nothing if the plugin has already been applied.

Link copied to clipboard
abstract fun beforeProject(closure: Closure)
Adds a closure to be called immediately before a project is evaluated.
abstract fun beforeProject(action: Action<in Project>)
Adds an action to be called immediately before a project is evaluated.
Link copied to clipboard
abstract fun beforeSettings(@DelegatesTo(value = Settings::class) closure: Closure<out Any>)
abstract fun beforeSettings(action: Action<in Settings>)
Adds an action to be called before the build settings have been loaded and evaluated.
Link copied to clipboard
abstract fun buildFinished(closure: Closure)
Adds a closure to be called when the build is completed.
abstract fun buildFinished(action: Action<in BuildResult>)
Adds an action to be called when the build is completed.
Link copied to clipboard
inline fun <T : Any> ExtensionAware.configure(noinline configuration: T.() -> Unit)

Executes the given configuration block against the extension of the specified type.

Link copied to clipboard
Link copied to clipboard
abstract fun getGradle(): Gradle
Returns this Gradle instance.
Link copied to clipboard
@Nullable
abstract fun getGradleHomeDir(): File
Returns the Gradle home directory, if any.
Link copied to clipboard
abstract fun getGradleUserHomeDir(): File
Returns the Gradle user home directory.
Link copied to clipboard
abstract fun getGradleVersion(): String
Returns the current Gradle version.
Link copied to clipboard
Returns the included builds for this build.
Link copied to clipboard
Gives access to the new Gradle build lifecycle callbacks.
Link copied to clipboard
@Nullable
abstract fun getParent(): Gradle
Returns the parent build of this build, if any.
Link copied to clipboard
Link copied to clipboard
abstract fun getPlugins(): PluginContainer
Link copied to clipboard
abstract fun getRootProject(): Project
Returns the root project of this build.
Link copied to clipboard
Returns the build services that are shared by all projects of this build.
Link copied to clipboard
Returns the StartParameter used to start this build.
Link copied to clipboard
Returns the TaskExecutionGraph for this build.
Link copied to clipboard
abstract fun includedBuild(name: String): IncludedBuild
Returns the included build with the specified name for this build.
Link copied to clipboard
abstract fun projectsEvaluated(closure: Closure)
Adds a closure to be called when all projects for the build have been evaluated.
abstract fun projectsEvaluated(action: Action<in Gradle>)
Adds an action to be called when all projects for the build have been evaluated.
Link copied to clipboard
abstract fun projectsLoaded(closure: Closure)
Adds a closure to be called when the projects for the build have been created from the settings.
abstract fun projectsLoaded(action: Action<in Gradle>)
Adds an action to be called when the projects for the build have been created from the settings.
Link copied to clipboard
abstract fun removeListener(listener: Any)
Removes the given listener from this build.
Link copied to clipboard
Removes the given listener from this build.
Link copied to clipboard
abstract fun rootProject(action: Action<in Project>)
Adds an action to execute against the root project of this build.
Link copied to clipboard
abstract fun settingsEvaluated(closure: Closure)
Adds a closure to be called when the build settings have been loaded and evaluated.
abstract fun settingsEvaluated(action: Action<in Settings>)
Adds an action to be called when the build settings have been loaded and evaluated.
Link copied to clipboard
inline fun <T : Any> ExtensionAware.the(): T

Returns the extension of the specified type.

fun <T : Any> ExtensionAware.the(extensionType: KClass<T>): T

Returns the extension of the specified extensionType.

Link copied to clipboard
abstract fun useLogger(logger: Any)
Uses the given object as a logger.