api / org.gradle.kotlin.dsl / org.gradle.api.Project

Extensions for org.gradle.api.Project

announce

val Project.announce: AnnouncePluginExtension

Retrieves the announce extension.

fun Project.announce(configure: AnnouncePluginExtension.() -> Unit): Unit

Configures the announce extension.

application

val Project.application: ApplicationPluginConvention

Retrieves the application convention.

fun Project.application(configure: ApplicationPluginConvention.() -> Unit): Unit

Configures the application convention.

apply

fun <T : Plugin<Project>> Project.apply(): Unit

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

base

val Project.base: BasePluginConvention

Retrieves the base convention.

fun Project.base(configure: BasePluginConvention.() -> Unit): Unit

Configures the base convention.

buildTypes

val Project.buildTypes: BuildTypeContainer

Retrieves the buildTypes extension.

fun Project.buildTypes(configure: BuildTypeContainer.() -> Unit): Unit

Configures the buildTypes extension.

buildscript

fun Project.buildscript(action: ScriptHandlerScope.() -> Unit): Unit

checkstyle

val Project.checkstyle: CheckstyleExtension

Retrieves the checkstyle extension.

fun Project.checkstyle(configure: CheckstyleExtension.() -> Unit): Unit

Configures the checkstyle extension.

codenarc

val Project.codenarc: CodeNarcExtension

Retrieves the codenarc extension.

fun Project.codenarc(configure: CodeNarcExtension.() -> Unit): Unit

Configures the codenarc extension.

configure

fun <T : Any> Project.configure(configuration: T.() -> Unit): Unit

Executes the given configuration block against the plugin convention or extension of the specified type.

createTask

fun <T : Task> Project.createTask(name: String, type: KClass<T>, configuration: T.() -> Unit): T

defaultArtifacts

val Project.defaultArtifacts: <ERROR CLASS>

Retrieves the defaultArtifacts extension.

fun Project.defaultArtifacts(configure: <ERROR CLASS>.() -> Unit): Unit

Configures the defaultArtifacts extension.

defaultTasks

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.

dependencies

fun Project.dependencies(configuration: DependencyHandlerScope.() -> Unit): Unit

Configures the dependencies for this project.

distributions

val Project.distributions: DistributionContainer

Retrieves the distributions extension.

fun Project.distributions(configure: DistributionContainer.() -> Unit): Unit

Configures the distributions extension.

ear

val Project.ear: EarPluginConvention

Retrieves the ear convention.

fun Project.ear(configure: EarPluginConvention.() -> Unit): Unit

Configures the ear convention.

eclipse

val Project.eclipse: EclipseModel

Retrieves the eclipse extension.

fun Project.eclipse(configure: EclipseModel.() -> Unit): Unit

Configures the eclipse extension.

ext

val Project.ext: ExtraPropertiesExtension

Retrieves the ext extension.

fun Project.ext(configure: ExtraPropertiesExtension.() -> Unit): Unit

Configures the ext extension.

findbugs

val Project.findbugs: FindBugsExtension

Retrieves the findbugs extension.

fun Project.findbugs(configure: FindBugsExtension.() -> Unit): Unit

Configures the findbugs extension.

flavors

val Project.flavors: FlavorContainer

Retrieves the flavors extension.

fun Project.flavors(configure: FlavorContainer.() -> Unit): Unit

Configures the flavors extension.

gradleKotlinDsl

fun Project.gradleKotlinDsl(): Dependency

Creates a dependency on the API of the current version of the Gradle Kotlin DSL.

gradlePlugin

val Project.gradlePlugin: GradlePluginDevelopmentExtension

Retrieves the gradlePlugin extension.

fun Project.gradlePlugin(configure: GradlePluginDevelopmentExtension.() -> Unit): Unit

Configures the gradlePlugin extension.

gradleScriptKotlinApi

fun Project.gradleScriptKotlinApi(): Dependency

groovyRuntime

val Project.groovyRuntime: GroovyRuntime

Retrieves the groovyRuntime extension.

fun Project.groovyRuntime(configure: GroovyRuntime.() -> Unit): Unit

Configures the groovyRuntime extension.

idea

val Project.idea: IdeaModel

Retrieves the idea extension.

fun Project.idea(configure: IdeaModel.() -> Unit): Unit

Configures the idea extension.

jacoco

val Project.jacoco: JacocoPluginExtension

Retrieves the jacoco extension.

fun Project.jacoco(configure: JacocoPluginExtension.() -> Unit): Unit

Configures the jacoco extension.

java

val Project.java: JavaPluginConvention

Retrieves the java convention.

fun Project.java(configure: JavaPluginConvention.() -> Unit): Unit

Configures the java convention.

javaScript

val Project.javaScript: JavaScriptExtension

Retrieves the javaScript extension.

fun Project.javaScript(configure: JavaScriptExtension.() -> Unit): Unit

Configures the javaScript extension.

jdepend

val Project.jdepend: JDependExtension

Retrieves the jdepend extension.

fun Project.jdepend(configure: JDependExtension.() -> Unit): Unit

Configures the jdepend extension.

maven

fun Project.maven(configure: MavenPluginConvention.() -> Unit): Unit

Configures the maven convention.

val Project.maven: MavenPluginConvention

Retrieves the maven convention.

osgi

val Project.osgi: OsgiPluginConvention

Retrieves the osgi convention.

fun Project.osgi(configure: OsgiPluginConvention.() -> Unit): Unit

Configures the osgi convention.

platforms

val Project.platforms: PlatformContainer

Retrieves the platforms extension.

fun Project.platforms(configure: PlatformContainer.() -> Unit): Unit

Configures the platforms extension.

playConfigurations

val Project.playConfigurations: PlayPluginConfigurations

Retrieves the playConfigurations extension.

fun Project.playConfigurations(configure: PlayPluginConfigurations.() -> Unit): Unit

Configures the playConfigurations extension.

pmd

val Project.pmd: PmdExtension

Retrieves the pmd extension.

fun Project.pmd(configure: PmdExtension.() -> Unit): Unit

Configures the pmd extension.

projectReports

val Project.projectReports: ProjectReportsPluginConvention

Retrieves the projectReports convention.

fun Project.projectReports(configure: ProjectReportsPluginConvention.() -> Unit): Unit

Configures the projectReports convention.

property

fun <T> Project.property(): PropertyState<T>

Creates a PropertyState that holds values of the given type T.

provideDelegate

operator fun Project.provideDelegate(any: Any?, property: KProperty<*>): PropertyDelegate

Locates a property on Project.

publishing

val Project.publishing: PublishingExtension

Retrieves the publishing extension.

fun Project.publishing(configure: PublishingExtension.() -> Unit): Unit

Configures the publishing extension.

reporting

val Project.reporting: ReportingExtension

Retrieves the reporting extension.

fun Project.reporting(configure: ReportingExtension.() -> Unit): Unit

Configures the reporting extension.

repositories

fun Project.repositories(configuration: RepositoryHandler.() -> Unit): Unit

Configures the repositories for this project.

scalaRuntime

val Project.scalaRuntime: ScalaRuntime

Retrieves the scalaRuntime extension.

fun Project.scalaRuntime(configure: ScalaRuntime.() -> Unit): Unit

Configures the scalaRuntime extension.

signing

val Project.signing: SigningExtension

Retrieves the signing extension.

fun Project.signing(configure: SigningExtension.() -> Unit): Unit

Configures the signing extension.

task

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): Tfun 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.

the

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.

toolChains

val Project.toolChains: NativeToolChainRegistry

Retrieves the toolChains extension.

fun Project.toolChains(configure: NativeToolChainRegistry.() -> Unit): Unit

Configures the toolChains extension.

visualStudio

val Project.visualStudio: VisualStudioRootExtension

Retrieves the visualStudio extension.

fun Project.visualStudio(configure: VisualStudioRootExtension.() -> Unit): Unit

Configures the visualStudio extension.

war

val Project.war: WarPluginConvention

Retrieves the war convention.

fun Project.war(configure: WarPluginConvention.() -> Unit): Unit

Configures the war convention.

xcode

val Project.xcode: XcodeRootExtension

Retrieves the xcode extension.

fun Project.xcode(configure: XcodeRootExtension.() -> Unit): Unit

Configures the xcode extension.