Predefined Gradle Tasks

Predefined Task Types

Gradle provides many built-in task types that perform common operations, including:

  • Copy: Copies files from one location to another.
  • Exec: Executes an external process. (task<Exec>)
  • JavaCompile: Compiles Java source files.
  • Test: Runs unit tests.

Example Using the Copy Task (Kotlin DSL):

tasks.register<Copy>("copyFiles") {
    from("src/main/resources")
    into("build/output")
}

Children
  1. task<Exec>

Backlinks