Is there a tool that will allow me to set breakpoints in a build.gradle file and step through tasks in a debugger?
Note: I believe that I\'m asking a different ques
After reading various answers here the following steps will help you debug build.gradle
to being able to break and investigate variables inside any custom task. I am using Eclipse remote debugging facilities
try {throw new RuntimeException('Break');} catch (RuntimeException e) {}
gradle mytask -Dorg.gradle.debug=true --no-daemon
in the command prompt (don't have to do it in Eclipse)Run -> Add Java Exception Breakpoint
, choose RuntimeException
and click "OK"Run -> Debug Configurations -> Remote Java Application
and create new configuration that listens on localhost:5005
. Name it whatever you want. Select a project that contains build.gradle
you are debugging. Click Apply
and Debug
build.gradle
but you can pretty much guess where you are atFor example:
void halt() {
try {
throw new RuntimeException('Break');
} catch (RuntimeException e) {
print('Paused')
}
}
task iterateDeclaredDependencies {
doLast {
Object configs = configurations.all
halt();
print(configs)
}
}