0

I want to debug my gradle task in test.gradle which is not in build.gradle in IntelliJ IDEA.

Like this, test.gradle file debugTestwithGradle task in test.gradle

So, I tried remote debugging follow these guides.

But these guide does not work for me.

Is there any solution to debug gradle script?

1 Answers1

1

To debug gradle scripts, you just need to set the following VM option:

-Dorg.gradle.debug=true

And then attach debugger to standard port 5005.

See details here: https://docs.gradle.org/current/userguide/troubleshooting.html#sec:troubleshooting_build_logic

there is even an example how to do it in IntelliJ Idea:)

Piotr Kucia
  • 381
  • 2
  • 9
  • Thanks your answer! But I still have a problem with debugging. I follow that guide, then it's working with task in build.gradle, but still cannot debug task in test.gradle (which file i made it). Is there any different option in build.gradle script? – Sung Kyong Park May 28 '20 at 09:13
  • it should work for both files. How are you including test.gradle to your build? are you sure that task from test.gradle is executed? – Piotr Kucia May 28 '20 at 09:21
  • I called debugTestwithGradle task(test.gradle) in debugTest task(build.gradle), then excute ./gradlew debugTest -Dorg.gradle.daemon.debug=true and attach remote debugger. So, It's working at debugTest task and can't debug debugTestwithGradle task. – Sung Kyong Park May 28 '20 at 09:30