How to debug a Gradle build.gradle file (in a debugger, with breakpoints)?

后端 未结 5 846
攒了一身酷
攒了一身酷 2020-12-12 13:01

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

5条回答
  •  醉梦人生
    2020-12-12 13:32

    Personnaly I do this when I need to debug build scripts:

    Inside you terminal do

    export GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
    

    Then run your build

    gradle clean install
    

    Finally put some breakpoints and launch the remote debug configuration inside your IDE on the port 5005 and you’re good to go!

提交回复
热议问题