Appendix A. Build script reference

This chapter is under construction.

This chapter describes the various types which make up the Gradle build DSL.

Table A.1. Core types

Type Description
Project

The main API you use to interact with Gradle from your build file.

SourceSet

Represents a logical group of Java source and resources.

Table A.2. Task types

Type Description
IdeaProject

Generates an IDEA project file.

Tar

Assembles a TAR archive.

Zip

Assembles a ZIP archive.

A.1. Project

The main API you use to interact with Gradle from your build file.

A.1.1. API Documentation

Project

A.1.2. Properties

Name Type Description
name String (read-only) The name of the project.
path String (read-only) The path of the project.

A.1.3. Methods

Name Signature Description
file File file(Object path) Resolves a file path relative to the project directory of this project.

A.1.4. Java Plugin - ReportingBasePluginConvention

A.1.4.1. API Documentation

ReportingBasePluginConvention

A.1.4.2. Properties

Name Type Description
reportsDirName String The name of the reports directory, relative to the project's build directory.

A.1.4.3. Methods

Name Signature Description

A.1.5. Java Plugin - BasePluginConvention

A.1.5.1. API Documentation

BasePluginConvention

A.1.5.2. Properties

Name Type Description
distsDir File (read-only) The directory which distributions should be generated into.

A.1.5.3. Methods

Name Signature Description

A.2. SourceSet

Represents a logical group of Java source and resources.

A.2.1. API Documentation

SourceSet

A.2.2. Properties

Name Type Description
name String (read-only) The name of the source set.
compileClasspath FileCollection The classpath used to compile this source.
runtimeClasspath FileCollection The classpath used to execute this source.

A.2.3. Methods

Name Signature Description

A.2.4. Groovy Plugin - GroovySourceSet

A.2.4.1. API Documentation

GroovySourceSet

A.2.4.2. Properties

Name Type Description
groovy SourceDirectorySet (read-only) The source to be compiled by the Groovy compiler for this source set. Any Java source present in this set will be passed to the Groovy compiler for joint compilation.

A.2.4.3. Methods

Name Signature Description

A.3. IdeaProject

Generates an IDEA project file.

A.3.1. API Documentation

IdeaProject

A.3.2. Properties

Name Type Description
outputFile File The ipr file.
javaVersion String The java version used for defining the project sdk.

A.3.3. Methods

Name Signature Description
withXml IdeaProject withXml(Closure closure) Adds a closure to be called when the ipr xml has been created.

A.4. Tar

Assembles a TAR archive.

A.4.1. API Documentation

Tar

A.4.2. Properties

Name Type Description
compression Compression The compression to use for this archive.
archiveName String The archive name. If the name has not been explicitly set, the pattern for the name is: [baseName]-[appendix]-[version]-[classifier].[extension].
destinationDir File The directory where the archive is generated into.
includes Set The set of include patterns.
excludes Set The set of exclude patterns.

A.4.3. Methods

Name Signature Description
from AbstractCopyTask from(Object... sourcePaths) Specifies source files or directories to include.

A.5. Zip

Assembles a ZIP archive.

A.5.1. API Documentation

Zip

A.5.2. Properties

Name Type Description
archiveName String The archive name. If the name has not been explicitly set, the pattern for the name is: [baseName]-[appendix]-[version]-[classifier].[extension].
destinationDir File The directory where the archive is generated into.
includes Set The set of include patterns.
excludes Set The set of exclude patterns.

A.5.3. Methods

Name Signature Description
from AbstractCopyTask from(Object... sourcePaths) Specifies source files or directories to include.