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'
}$ ./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