Gradle

  • Written in groovy
  • Tasks chains than linear phases (Maven)

Exemplary project

task compile << {
    println 'Compiling source code'
}

task compileTest(dependsOn: compile) << {
    println 'Compiling unit tests'
}

task test(dependsOn: compileTest) << {
    println 'Running unit tests'
}

task dist(dependsOn: [compile, test]) << {
    println 'Building the distribution'
}

Exemplary project

$ ./gradlew dist
:compile
Compiling source code
:compileTest
Compiling unit tests
:test
Running unit tests
:dist
Building the distribution

BUILD SUCCESSFUL

Total time: 2.675 secs

Tasks

  • Performed in specified order
  • Some can be excluded (-x)
  • No need to specify whole task name (gradle di == gradle dist)

Tasks

  • gradle tasks
  • gradle project

deck

By Artur Owczarek

deck

  • 384