Task dependencies in gradle

Gradle allows you to specify the dependencies between tasks. In below example , we have got 2 tasks – task1 and task2. If we execute task2, task1 will be executed as well as we have specified that task2 depends on task1
 
task task1;
task1 <<{
println “This block will be executed after doLast block of task1”
}

task task2 (dependsOn:task1) << {
println “Declaring and defining new task at the same time”
}
We can also specify the dependencies using below syntax.

task2.dependsOn(testClasses)

Web development and Automation testing

solutions delivered!!