Reputation: 3330
I have a custom task, like this one:
task hello {
doLast {
println 'Hello, World!'
}
}
Now I can set breakpoint on doLast
and IntelliJ will stop there, but I'am unable to debug into gradle core classes, like for example: org.gradle.api.internal.project.DefaultProject#task(...)
Is is possible to attach Gradle sources for debugging Gradle internal classes in IntelliJ?
Upvotes: 3
Views: 665
Reputation: 1522
I don't know how to convert comment into answer, but essentially, @m-ricciuti is correct, what has to be done is:
implementation(gradleApi())
(it's in Kotlin DSL) to dependencies
-all
distribution in gradle-wrapper.properties
:distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip
gradlew <task> -Dorg.gradle.debug=true --no-daemon
, it will say "Starting daemon" and pauseThis way, you can set breakpoints on @TaskAction
methods, and a lot more, however, I still was not capable to set a breakpoint in a CloseableHttpClient
or an InternalHttpClient
classes. Which is essentially what I was most interested in, so if anyone knows more... please chime in!
Upvotes: 4