我想在test.gradle中调试我的gradle任务,该任务不在IntelliJ IDEA的build.gradle中。
喜欢这个 test.gradle file debugTestwithGradle task in test.gradle
因此,我尝试按照这些指南进行远程调试。
- https://www.jetbrains.com/help/idea/run-debug-configuration-remote-debug.html?_ga=2.146766132.1892324613.1590646291-1406325537.1590646291#top
- Gradle 远程调试过程
但是这些指南对我不起作用。
有没有调试 gradle 脚本的解决方案?
要调试 gradle 脚本,只需设置以下 VM 选项:
-Dorg.gradle.debug=true
然后将调试器连接到标准端口 5005。
详情请见此处: https://docs.gradle.org/current/userguide/troubleshooting.html#sec:troubleshooting_build_logic
甚至还有一个如何在 IntelliJ Idea 中做到这一点的例子:(