Chapter 20. Standard Gradle tasks

There are a number of tasks included in the Gradle distribution. These are listed below.

Table 20.1. Standard tasks

Task class Description
AntlrTask Generates parsers from Antlr grammars.
Checkstyle Runs Checkstyle against some source files.
CodeNarc Runs CodeNarc against some source files.
Compile Compiles Java source files.
Copy Copies files into a destination directory. See Section 15.6, “Copying files”.
Delete Deletes files or directories.
Directory Creates a directory. See Section 12.1, “Directory creation”.
DependencyReportTask Displays the dependency tree for a project.
EclipseClasspath Generates an Eclipse .classpath file.
EclipseProject Generates an Eclipse .project file.
EclipseWtp Generates Eclipse configuration files for Eclipse WTP.
Exec Executes a command line process.
GradleBuild Executes a Gradle build. See Section 40.4, “Running another Gradle build from a build”.
GroovyCompile Compiles Groovy and Java source files.
Groovydoc Generates HTML API documentation for Groovy and Java classes.
IdeaModule Generates an IDEA module file.
IdeaProject Generates an IDEA project file.
IdeaWorkspace Generates an IDEA workspace file.
Jar Assembles a JAR archive. See Section 15.8, “Creating archives”.
Javadoc Generates HTML API documentation for Java classes.
JavaExec Executes a Java application.
JettyRun Deploys an exploded web application to an embedded Jetty web container.
JettyRunWar Deploys a WAR to an embedded Jetty web container.
JettyStop Stops the embedded Jetty web container.
PropertyReportTask Displays the properties of a project.
ScalaCompile Compiles Scala and Java source files.
ScalaDoc Generates HTML API documentation for Scala source files.
Sync Synchronises the contents of a destination directory with some source. See Section 15.7, “Using the Sync task”.
Tar Assembles a TAR archive. See Section 15.8, “Creating archives”.
TaskReportTask Displays a list of tasks in the project.
Test Executes tests.
Upload Uploads the artifacts of a configuration to a set of repositories.
War Assembles a WAR archive. See Section 15.8, “Creating archives”.
Wrapper Generates scripts (for *nix and windows) which enable you to build your project with Gradle, without having to install Gradle. See Chapter 42, The Gradle Wrapper.
Zip Assembles a ZIP archive. See Section 15.8, “Creating archives”.